+
    i.                         ^ RI Ht ^ RIHt ^ RIHtHt ^ RIHtH	t	H
t
Ht ^ RIHt ^ RIHt ^ RIHt ^ RIt ! R	 R
]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      tR tR# )    )Basic)sympify)cossin)eye	rot_axis1	rot_axis2	rot_axis3)ImmutableDenseMatrix)cacheit)StrNc                   *   a  ] tR t^t o RtR tRtV tR# )Orienterz'
Super-class for all orienter classes.
c                    V P                   # )z>
The rotation matrix corresponding to this orienter
instance.
)_parent_orientselfs   &T/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/vector/orienters.pyrotation_matrixOrienter.rotation_matrix   s    
 """     N)__name__
__module____qualname____firstlineno____doc__r   __static_attributes____classdictcell____classdict__s   @r   r   r      s     # #r   r   c                   l   a a ] tR t^t oRtV 3R ltR t]R 4       t]	R 4       t
]	R 4       tRtVtV ;t# )AxisOrienterz#
Class to denote an axis orienter.
c                   < \        V\        P                  P                  4      '       g   \	        R 4      h\        V4      p\        SV `  WV4      pWn        W#n	        V# )zaxis should be a Vector)

isinstancesympyvectorVector	TypeErrorr   super__new___angle_axis)clsangleaxisobj	__class__s   &&& r   r+   AxisOrienter.__new__   sN    $ 3 344566goc$/
	
r   c                    R# )aI  
Axis rotation is a rotation about an arbitrary axis by
some angle. The angle is supplied as a SymPy expr scalar, and
the axis is supplied as a Vector.

Parameters
==========

angle : Expr
    The angle by which the new system is to be rotated

axis : Vector
    The axis around which the rotation has to be performed

Examples
========

>>> from sympy.vector import CoordSys3D
>>> from sympy import symbols
>>> q1 = symbols('q1')
>>> N = CoordSys3D('N')
>>> from sympy.vector import AxisOrienter
>>> orienter = AxisOrienter(q1, N.i + 2 * N.j)
>>> B = N.orient_new('B', (orienter, ))

Nr   )r   r/   r0   s   &&&r   __init__AxisOrienter.__init__(   s    8 	r   c                   \         P                  P                  V P                  V4      P	                  4       pVP                  V4      pV P                  p\        ^4      W"P                  ,          ,
          \        V4      ,          \        ^ V^,          ) V^,          .V^,          ^ V^ ,          ) .V^,          ) V^ ,          ^ ..4      \        V4      ,          ,           W"P                  ,          ,           pVP                  pV# )z
The rotation matrix corresponding to this orienter
instance.

Parameters
==========

system : CoordSys3D
    The coordinate system wrt which the rotation matrix
    is to be computed
)r&   r'   expressr0   	normalize	to_matrixr/   r   Tr   Matrixr   )r   systemr0   thetaparent_orients   &&   r   r   AxisOrienter.rotation_matrixF   s     ||##DIIv6@@B~~f%

a&4&&=0CJ>!d1gXtAw!7"&q'1tAwh!7#'7(DGQ!7!9 :<?JGG 	'
 &r   c                    V P                   # N)r,   r   s   &r   r/   AxisOrienter.angle_   s    {{r   c                    V P                   # rB   )r-   r   s   &r   r0   AxisOrienter.axisc   s    zzr   r   )r   r   r   r   r   r+   r5   r   r   propertyr/   r0   r   r   __classcell__r2   r!   s   @@r   r#   r#      sU     	<  0     r   r#   c                   v   a a ] tR t^ht oRtV 3R lt]R 4       t]R 4       t]R 4       t	]R 4       t
RtVtV ;t# )ThreeAngleOrienterz+
Super-class for Body and Space orienters.
c           	       < \        V\        4      '       d   VP                  pR
pTp\        V4      P	                  4       p\        V4      ^8X  g   \        R4      hV Uu. uF  qwP                  RR4      NK  	  ppV Uu. uF  qwP                  RR4      NK  	  ppV Uu. uF  qwP                  RR4      NK  	  ppRP                  V4      pWE9  d   \        R	4      h\        V^ ,          4      p\        V^,          4      p	\        V^,          4      p
\        V4      p\        V4      p\        V4      pV P                  '       d-   \        W4      \        W4      ,          \        W4      ,          pM+\        W4      \        W4      ,          \        W4      ,          pVP                  p\        SV `=  WW#\        V4      4      pWn        W,n        W<n        Wln        Wn        V# u upi u upi u upi )123 z%rot_order should be a str of length 3X1Y2Z3zInvalid rot_type parameter)rL   231312132213321121131212232313323rM   )r%   r   namestrupperlenr)   replacejoinintr   	_in_order_rotr;   r*   r+   _angle1_angle2_angle3
_rot_orderr   )r.   angle1angle2angle3	rot_orderapproved_ordersoriginal_rot_orderia1a2a3r?   r1   r2   s   &&&&&        r   r+   ThreeAngleOrienter.__new__m   s   i%%!I- '	N((*	I!#CDD2;<)QYYsC()	<2;<)QYYsC()	<2;<)QYYsC()	<GGI&	+899111===!"-!"-.!"-.M ""-!"-.!"-.M &goY9+*
= =<<s    G$ G) G.c                    V P                   # rB   )rh   r   s   &r   rl   ThreeAngleOrienter.angle1       ||r   c                    V P                   # rB   )ri   r   s   &r   rm   ThreeAngleOrienter.angle2   ry   r   c                    V P                   # rB   )rj   r   s   &r   rn   ThreeAngleOrienter.angle3   ry   r   c                    V P                   # rB   )rk   r   s   &r   ro   ThreeAngleOrienter.rot_order   s    r   r   )r   r   r   r   r   r+   rF   rl   rm   rn   ro   r   r   rG   rH   s   @@r   rJ   rJ   h   se     )V         r   rJ   c                   4   a  ] tR t^t o RtRtR tR tRtV t	R# )BodyOrienterz"
Class to denote a body-orienter.
Tc                4    \         P                  WW#V4      pV# rB   rJ   r+   r.   rl   rm   rn   ro   r1   s   &&&&& r   r+   BodyOrienter.__new__        ((f)24
r   c                    R# )aZ  
Body orientation takes this coordinate system through three
successive simple rotations.

Body fixed rotations include both Euler Angles and
Tait-Bryan Angles, see https://en.wikipedia.org/wiki/Euler_angles.

Parameters
==========

angle1, angle2, angle3 : Expr
    Three successive angles to rotate the coordinate system by

rotation_order : string
    String defining the order of axes for rotation

Examples
========

>>> from sympy.vector import CoordSys3D, BodyOrienter
>>> from sympy import symbols
>>> q1, q2, q3 = symbols('q1 q2 q3')
>>> N = CoordSys3D('N')

A 'Body' fixed rotation is described by three angles and
three body-fixed rotation axes. To orient a coordinate system D
with respect to N, each sequential rotation is always about
the orthogonal unit vectors fixed to D. For example, a '123'
rotation will specify rotations about N.i, then D.j, then
D.k. (Initially, D.i is same as N.i)
Therefore,

>>> body_orienter = BodyOrienter(q1, q2, q3, '123')
>>> D = N.orient_new('D', (body_orienter, ))

is same as

>>> from sympy.vector import AxisOrienter
>>> axis_orienter1 = AxisOrienter(q1, N.i)
>>> D = N.orient_new('D', (axis_orienter1, ))
>>> axis_orienter2 = AxisOrienter(q2, D.j)
>>> D = D.orient_new('D', (axis_orienter2, ))
>>> axis_orienter3 = AxisOrienter(q3, D.k)
>>> D = D.orient_new('D', (axis_orienter3, ))

Acceptable rotation orders are of length 3, expressed in XYZ or
123, and cannot have a rotation about about an axis twice in a row.

>>> body_orienter1 = BodyOrienter(q1, q2, q3, '123')
>>> body_orienter2 = BodyOrienter(q1, q2, 0, 'ZXZ')
>>> body_orienter3 = BodyOrienter(0, 0, 0, 'XYX')

Nr   r   rl   rm   rn   ro   s   &&&&&r   r5   BodyOrienter.__init__   s    n 	r   r   N
r   r   r   r   r   rf   r+   r5   r   r   r    s   @r   r   r      s       I
7 7r   r   c                   4   a  ] tR t^t o RtRtR tR tRtV t	R# )SpaceOrienterz#
Class to denote a space-orienter.
Fc                4    \         P                  WW#V4      pV# rB   r   r   s   &&&&& r   r+   SpaceOrienter.__new__   r   r   c                    R# )a  
Space rotation is similar to Body rotation, but the rotations
are applied in the opposite order.

Parameters
==========

angle1, angle2, angle3 : Expr
    Three successive angles to rotate the coordinate system by

rotation_order : string
    String defining the order of axes for rotation

See Also
========

BodyOrienter : Orienter to orient systems wrt Euler angles.

Examples
========

>>> from sympy.vector import CoordSys3D, SpaceOrienter
>>> from sympy import symbols
>>> q1, q2, q3 = symbols('q1 q2 q3')
>>> N = CoordSys3D('N')

To orient a coordinate system D with respect to N, each
sequential rotation is always about N's orthogonal unit vectors.
For example, a '123' rotation will specify rotations about
N.i, then N.j, then N.k.
Therefore,

>>> space_orienter = SpaceOrienter(q1, q2, q3, '312')
>>> D = N.orient_new('D', (space_orienter, ))

is same as

>>> from sympy.vector import AxisOrienter
>>> axis_orienter1 = AxisOrienter(q1, N.i)
>>> B = N.orient_new('B', (axis_orienter1, ))
>>> axis_orienter2 = AxisOrienter(q2, N.j)
>>> C = B.orient_new('C', (axis_orienter2, ))
>>> axis_orienter3 = AxisOrienter(q3, N.k)
>>> D = C.orient_new('C', (axis_orienter3, ))

Nr   r   s   &&&&&r   r5   SpaceOrienter.__init__   s    ` 	r   r   Nr   r    s   @r   r   r      s       I
0 0r   r   c                   |   a a ] tR tRt oRtV 3R ltR t]R 4       t]R 4       t	]R 4       t
]R 4       tR	tVtV ;t# )
QuaternionOrienteri.  z(
Class to denote a quaternion-orienter.
c           	     b  < \        V4      p\        V4      p\        V4      p\        V4      p\        V^,          V^,          ,           V^,          ,
          V^,          ,
          ^W#,          W,          ,
          ,          ^W,          W$,          ,           ,          .^W#,          W,          ,           ,          V^,          V^,          ,
          V^,          ,           V^,          ,
          ^W4,          W,          ,
          ,          .^W$,          W,          ,
          ,          ^W,          W4,          ,           ,          V^,          V^,          ,
          V^,          ,
          V^,          ,           ..4      pVP                  p\        SV `  WW#V4      pWn        W&n        W6n        WFn        WVn	        V# )   )
r   r<   r;   r*   r+   _q0_q1_q2_q3r   )r.   q0q1q2q3r?   r1   r2   s   &&&&&  r   r+   QuaternionOrienter.__new__3  s_   R[R[R[R["'B!G"3bAg"="$'#*"#rw'8"9"#rw'8"9"; #$rw'8"9"$'B!G"3"$'#*,.!G#4"#rw'8"9"; #$rw'8"9"#rw'8"9"$'B!G"3"$'#*,.!G#4"5!6 7 &gocrr2*
r   c                    R# )a  
Quaternion orientation orients the new CoordSys3D with
Quaternions, defined as a finite rotation about lambda, a unit
vector, by some amount theta.

This orientation is described by four parameters:

q0 = cos(theta/2)

q1 = lambda_x sin(theta/2)

q2 = lambda_y sin(theta/2)

q3 = lambda_z sin(theta/2)

Quaternion does not take in a rotation order.

Parameters
==========

q0, q1, q2, q3 : Expr
    The quaternions to rotate the coordinate system by

Examples
========

>>> from sympy.vector import CoordSys3D
>>> from sympy import symbols
>>> q0, q1, q2, q3 = symbols('q0 q1 q2 q3')
>>> N = CoordSys3D('N')
>>> from sympy.vector import QuaternionOrienter
>>> q_orienter = QuaternionOrienter(q0, q1, q2, q3)
>>> B = N.orient_new('B', (q_orienter, ))

Nr   r   s   &&&&&r   r5   QuaternionOrienter.__init__O  s    J 	r   c                    V P                   # rB   )r   r   s   &r   r   QuaternionOrienter.q0v      xxr   c                    V P                   # rB   )r   r   s   &r   r   QuaternionOrienter.q1z  r   r   c                    V P                   # rB   )r   r   s   &r   r   QuaternionOrienter.q2~  r   r   c                    V P                   # rB   )r   r   s   &r   r   QuaternionOrienter.q3  r   r   r   )r   r   r   r   r   r+   r5   rF   r   r   r   r   r   r   rG   rH   s   @@r   r   r   .  sj     8%N         r   r   c                    V ^8X  d   \        \        V4      P                  4      # V ^8X  d   \        \        V4      P                  4      # V ^8X  d   \        \	        V4      P                  4      # R# )z)DCM for simple axis 1, 2 or 3 rotations. N)r<   r   r;   r	   r
   )r0   r/   s   &&r   rg   rg     s^    qyi&(())	i&(())	i&(()) 
r   )sympy.core.basicr   sympy.core.sympifyr   (sympy.functions.elementary.trigonometricr   r   sympy.matrices.denser   r   r	   r
   sympy.matrices.immutabler   r<   sympy.core.cacher   sympy.core.symbolr   sympy.vectorr&   r   r#   rJ   r   r   r   rg   r   r   r   <module>r      sz    " & ? G G C $ ! 
#u 
#M8 M`> >BC% CL<& <~V Vr*r   