
    Цi                     b    S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
Jr   " S S\5      rg	)
    )Basic)Str)Vector)
CoordSys3D)_path)cacheitc                   j   ^  \ rS rSrSr\R                  S4U 4S jjr\S 5       r	S r
S rS rS	rU =r$ )
Point	   z"
Represents a point in 3-D space.
Nc                   > [        U5      n[        U[        5      (       d  [        S[	        U5      -  5      e[        U[
        5      (       d  Ub  [        S[	        U5      -  5      eUc  [        TU ]  U [        U5      U5      nO[        TU ]  U [        U5      X#5      nXl	        X$l
        Uc  S Ul        XDl        U$ X4l        UR                  Ul        U$ )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        Q/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/sympy/vector/point.pyr   Point.__new__   s    4y(F++BTF   <//(E I" "# # '/#s4y(;C'/#s4y(IC	CKI
 
 'K$**CI
    c                 b   [        U[        5      (       d,  [        U[        5      (       d  [        [	        U5      S-   5      e[        U[        5      (       a  UR
                  nX:X  a  [        R                  $ XR                  :X  a  U R                  $ UR                  U :X  a  SUR                  -  $ [        X5      u  p#[        R                  nSn[        U5       H  nXCU   R                  -  nM     US-  nU[        U5      :  a'  XCU   R                  -  nUS-  nU[        U5      :  a  M'  U$ )a  
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_wrtPoint.position_wrt+   s   2 5%((uj11CJ:; < <eZ((LLE=;;ll"99]]d"

?",	y!A1gll"F "	Q#d)m1gll"FFA #d)m r   c                     [        XU 5      $ )a  
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_newPoint.locate_new]   s    4 TT**r   c                 l    U R                  UR                  5      n[        UR                  U5      5      $ )a  
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_coordinatesPoint.express_coordinatesy   s2    2 $$%6%=%=>X''(9:;;r   c                     U R                   $ )N)r   )r(   printers     r   	_sympystrPoint._sympystr   s    zzr    )__name__
__module____qualname____firstlineno____doc__r   r%   r   r   r.   r1   r8   r<   __static_attributes____classcell__)r   s   @r   r
   r
   	   sA     %+KKd : / /b+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   r   <module>rL      s%    " ! & 0 ( $NE Nr   