§
    PŠtjˆ  ã                   ój   — d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ  G d„ de¦  «        Zd	S )
é    )ÚBasic)ÚStr)ÚVector)Ú
CoordSys3D)Ú_path)Úcacheitc                   óZ   ‡ — e Zd ZdZej        dfˆ fd„	Zed„ ¦   «         Zd„ Z	d„ Z
d„ Zˆ xZS )ÚPointz*
    Represents a point in 3-D space.
    Nc                 ó&  •— t          |¦  «        }t          |t          ¦  «        st          dt	          |¦  «        z  ¦  «        ‚t          |t
          ¦  «        s!|�t          dt	          |¦  «        z  ¦  «        ‚|€1t          ¦   «                              | t          |¦  «        |¦  «        }n1t          ¦   «                              | t          |¦  «        ||¦  «        }||_	        ||_
        |€d |_        ||_        n||_        |j        |_        |S )Nz0position should be an instance of Vector, not %sz3parent_point should be an instance of Point, not %s)ÚstrÚ
isinstancer   Ú	TypeErrorÚtyper
   ÚsuperÚ__new__r   Ú_nameÚ_posÚ_parentÚ_root)ÚclsÚnameÚpositionÚparent_pointÚobjÚ	__class__s        €úP/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/vector/point.pyr   zPoint.__new__   s  ø€ Ý�4‰yŒyˆå˜(¥FÑ+Ô+ð 	ÝØBÅTØñFô Fñ ñô ð õ ˜<­Ñ/Ô/ð 	#ØÐ(ÝØEÍØ ñI"ô I"ñ "ñ#ô #ð #ð ÐÝ‘'”'—/’/ #¥s¨4¡y¤y°(Ñ;Ô;ˆCˆCå‘'”'—/’/ #¥s¨4¡y¤y°(¸LÑIÔIˆCàˆŒ	ØˆŒØÐØˆCŒKØˆCŒIˆIà&ˆCŒKØ$Ô*ˆCŒIàˆ
ó    c                 ó*  — t          |t          ¦  «        s4t          |t          ¦  «        st          t	          |¦  «        dz   ¦  «        ‚t          |t          ¦  «        r|j        }|| k    rt          j        S || j        k    r| j	        S |j        | k    r
d|j	        z  S t          | |¦  «        \  }}t          j        }t          |¦  «        D ]}|||         j	        z  }Œt          |dz   t          |¦  «        ¦  «        D ]}|||         j	        z  }Œ|S )aL  
        Returns the position vector of this Point with respect to
        another Point/CoordSys3D.

        Parameters
        ==========

        other : Point/CoordSys3D
            If other is a Point, the position of this Point wrt it is
            returned. If its an instance of CoordSyRect, the position
            wrt its origin is returned.

        Examples
        ========

        >>> from sympy.vector import CoordSys3D
        >>> N = CoordSys3D('N')
        >>> p1 = N.origin.locate_new('p1', 10 * N.i)
        >>> N.origin.position_wrt(p1)
        (-10)*N.i

        zis not a Point or CoordSys3Déÿÿÿÿé   )r   r
   r   r   r   Úoriginr   Úzeror   r   r   ÚrangeÚlen)ÚselfÚotherÚ	rootindexÚpathÚresultÚis         r   Úposition_wrtzPoint.position_wrt+   s  € õ2 ˜5¥%Ñ(Ô(ð 	<Ý˜u¥jÑ1Ô1ð	<å�C ™JœJØ:ñ;ñ <ô <ð <å�e�ZÑ(Ô(ð 	!Ø”LˆEà�DŠ=ˆ=Ý”;ÐØ�d”lÒ"Ð"Ø”9ÐØŒ]˜dÒ"Ð"Ø˜œ
‘?Ð"å  eÑ,Ô,‰ˆ	�4Ý”ˆÝ�yÑ!Ô!ð 	#ð 	#ˆAØ�d˜1”g”lÑ"ˆFˆFÝ�y 1‘}¥c¨$¡i¤iÑ0Ô0ð 	#ð 	#ˆAØ�d˜1”g”lÑ"ˆFˆFØˆr   c                 ó$   — t          ||| ¦  «        S )ai  
        Returns a new Point located at the given position wrt this
        Point.
        Thus, the position vector of the new Point wrt this one will
        be equal to the given 'position' parameter.

        Parameters
        ==========

        name : str
            Name of the new point

        position : Vector
            The position vector of the new Point wrt this one

        Examples
        ========

        >>> from sympy.vector import CoordSys3D
        >>> N = CoordSys3D('N')
        >>> p1 = N.origin.locate_new('p1', 10 * N.i)
        >>> p1.position_wrt(N.origin)
        10*N.i

        )r
   )r%   r   r   s      r   Ú
locate_newzPoint.locate_newZ   s   € õ4 �T˜8 TÑ*Ô*Ð*r   c                 óz   — |                       |j        ¦  «        }t          |                     |¦  «        ¦  «        S )aA  
        Returns the Cartesian/rectangular coordinates of this point
        wrt the origin of the given CoordSys3D instance.

        Parameters
        ==========

        coordinate_system : CoordSys3D
            The coordinate system to express the coordinates of this
            Point in.

        Examples
        ========

        >>> from sympy.vector import CoordSys3D
        >>> N = CoordSys3D('N')
        >>> p1 = N.origin.locate_new('p1', 10 * N.i)
        >>> p2 = p1.locate_new('p2', 5 * N.j)
        >>> p2.express_coordinates(N)
        (10, 5, 0)

        )r+   r!   ÚtupleÚ	to_matrix)r%   Úcoordinate_systemÚpos_vects      r   Úexpress_coordinateszPoint.express_coordinatesv   s8   € ð2 ×$Ò$Ð%6Ô%=Ñ>Ô>ˆå�X×'Ò'Ð(9Ñ:Ô:Ñ;Ô;Ð;r   c                 ó   — | j         S )N)r   )r%   Úprinters     r   Ú	_sympystrzPoint._sympystr“   s
   € ØŒzÐr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r"   r   r   r+   r-   r3   r6   Ú__classcell__)r   s   @r   r
   r
   	   s™   ø€ € € € € ðð ð %+¤K¸dð ð ð ð ð ð ð: ð,ð ,ñ „Wð,ð\+ð +ð +ð8<ð <ð <ð:ð ð ð ð ð ð r   r
   N)Úsympy.core.basicr   Úsympy.core.symbolr   Úsympy.vector.vectorr   Úsympy.vector.coordsysrectr   Úsympy.vector.functionsr   Úsympy.core.cacher   r
   © r   r   ú<module>rC      s¯   ðØ "Ð "Ð "Ð "Ð "Ð "Ø !Ð !Ð !Ð !Ð !Ð !Ø &Ð &Ð &Ð &Ð &Ð &Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø (Ð (Ð (Ð (Ð (Ð (Ø $Ð $Ð $Ð $Ð $Ð $ðKð Kð Kð Kð KˆEñ Kô Kð Kð Kð Kr   