K ibddlmZddlmZddlmZddlmZddlm Z ddl m Z GddeZ y ) )Basic)Str)Vector) CoordSys3D)_path)cacheitc^eZdZdZej dffd ZedZdZ dZ dZ xZ S)Pointz* Represents a point in 3-D space. Nct|}t|tstdt |zt|t s|tdt |z|t ||t||}nt ||t|||}||_ ||_ |d|_ ||_ |S||_ |j|_ |S)Nz0position should be an instance of Vector, not %sz3parent_point should be an instance of Point, not %s) str isinstancer TypeErrortyper super__new__r_name_pos_parent_root)clsnameposition parent_pointobj __class__s X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/vector/point.pyrz Point.__new__s4y(F+BTF </(E I""# #  '/#s4y(;C'/#s4y(LIC   CKCI  'CK$**CI c(t|ts't|tstt |dzt|tr |j }||k(rt jS||jk(r |jS|j|k(rd|jzSt||\}}t j}t|D]}|||jz }t|dzt|D]}|||jz}|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 zis not a Point or CoordSys3D) r r rrr originrzerorrrrangelen)selfother rootindexpathresultis r position_wrtzPoint.position_wrt+s25%(uj1CJ:;< < eZ (LLE D=;;  dll "99  ]]d " ? "e, 4y! #A d1gll "F #y1}c$i0 #A d1gll "F # rct|||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%rrs r locate_newzPoint.locate_newZs4T8T**rcl|j|j}t|j|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_systempos_vects rexpress_coordinateszPoint.express_coordinatesvs22$$%6%=%=>X''(9:;;rc|jS)N)r)r%printers r _sympystrzPoint._sympystrs zzr) __name__ __module__ __qualname____doc__rr"rrr+r-r3r6 __classcell__)rs@rr r s<%+KKd: , ,\+8<:rr N) sympy.core.basicrsympy.core.symbolrsympy.vector.vectorrsympy.vector.coordsysrectrsympy.vector.functionsrsympy.core.cacherr rrrCs%"!&0($KEKr