
    \h*a                         S SK JrJrJrJrJrJrJrJr	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/r " S S\\5      r " S	 S
\5      rS rg)    )	SsympifyexpandsqrtAddzerosacosImmutableMatrixsimplify)trigsimp)	Printable)
filldedent)
EvalfMixin)prec_to_dpsVectorc                   z   \ rS rSrSrSrSrS r\S 5       r	S r
S rS rS	 rS
 rS rS rS rS rS rS rS)S jrS rS r\r\rS rS r\R                  \l        \rS r\R                  \l        S r\R                  \l        S)S jrS*S jr S r!S r"S r#S r$S r%S r&S  r'S! r(S" r)S# r*S$ r+S% r,S& r-S'r.g()+r      a  The class used to define vectors.

It along with ReferenceFrame are the building blocks of describing a
classical mechanics system in PyDy and sympy.physics.vector.

Attributes
==========

simp : Boolean
    Let certain methods use trigsimp on their outputs

Fc                 F   / U l         US:X  a  / n[        U[        5      (       a  UnO20 nU H*  nUS   U;   a  X#S   ==   US   -  ss'   M   US   X#S   '   M,     UR                  5        H4  u  pEU[	        / SQ5      :w  d  M  U R                   R                  XT45        M6     g)a_  This is the constructor for the Vector class. You should not be
calling this, it should only be used by other functions. You should be
treating Vectors like you would with if you were doing the math by
hand, and getting the first 3 from the standard basis vectors from a
ReferenceFrame.

The only exception is to create a zero vector:
zv = Vector(0)

r      )r   r   r   N)args
isinstancedictitemsMatrixappend)selfinlistdinpkvs         S/var/www/auris/envauris/lib/python3.13/site-packages/sympy/physics/vector/vector.py__init__Vector.__init__   s     	Q;Ffd##AAq6Q;!fIQ'I #AA!fI	  GGIDAF9%%		  !(     c                     [         $ )zReturns the class Vector. )r   r   s    r"   funcVector.func<   s	     r%   c                 >    [        [        U R                  5      5      $ N)hashtupler   r'   s    r"   __hash__Vector.__hash__A   s    E$))$%%r%   c                 l    US:X  a  U $ [        U5      n[        U R                  UR                  -   5      $ )zThe add operator for Vector. r   )_check_vectorr   r   r   others     r"   __add__Vector.__add__D   s0    A:Ke$dii%**,--r%   c                    SSK JnJn  [        X5      (       aJ  U" U5      n[	        S5      nUR
                   H%  nXES   US   -  US   R                  U 5      -  -  nM'     U$ [        U5      n[        R                  nU R
                   HH  nUR
                   H5  nXhS   R                  US   R                  US   5      -  US   -  S   -  nM7     MJ     [        R                  (       a
  [        USS9$ U$ )a  Dot product of two vectors.

Returns a scalar, the dot product of the two Vectors

Parameters
==========

other : Vector
    The Vector which we are dotting with

Examples
========

>>> from sympy.physics.vector import ReferenceFrame, dot
>>> from sympy import symbols
>>> q1 = symbols('q1')
>>> N = ReferenceFrame('N')
>>> dot(N.x, N.x)
1
>>> dot(N.x, N.y)
0
>>> A = N.orientnew('A', 'Axis', [q1, N.x])
>>> dot(N.y, A.y)
cos(q1)

r   Dyadic_check_dyadic   r   T)	recursive)sympy.physics.vector.dyadicr8   r9   r   r   r   dotr1   r   ZeroTdcmsimpr   )	r   r3   r8   r9   olr!   outv1v2s	            r"   r=   
Vector.dotK   s    8 	Fe$$!%(EBZZdQqTkQqTXXd^44  Ie$ff))BjjARUYYr!u%56"Q%@!DD !  ;;C400Jr%   c                 F    U R                  [        R                  U-  5      $ )z6This uses mul and inputs self and 1 divided by other. )__mul__r   Oner2   s     r"   __truediv__Vector.__truediv__x   s    ||AEEEM**r%   c                 \   US:X  a  [        S5      n [        U5      nU R                  / :X  a  UR                  / :X  a  gU R                  / :X  d  UR                  / :X  a  gU R                  S   S   nU H%  n[	        X-
  R                  U5      5      S:w  d  M%    g   g! [         a     gf = f)a<  Tests for equality.

It is very import to note that this is only as good as the SymPy
equality test; False does not always mean they are not equivalent
Vectors.
If other is 0, and self is empty, returns True.
If other is 0 and self is not empty, returns False.
If none of the above, only accepts other as a Vector.

r   FTr   )r   r1   	TypeErrorr   r   r=   )r   r3   framer!   s       r"   __eq__Vector.__eq__|   s     A:1IE	!%(E IIO%**"2ii2o5::#3		!QAt|((+,1    		s   B 
B+*B+c                     [        U R                  5      n[        U5      n[        [	        U5      5       H  nXU   S   -  X#   S   4X#'   M     [        U5      $ )aL  Multiplies the Vector by a sympifyable expression.

Parameters
==========

other : Sympifyable
    The scalar to multiply this Vector with

Examples
========

>>> from sympy.physics.vector import ReferenceFrame
>>> from sympy import Symbol
>>> N = ReferenceFrame('N')
>>> b = Symbol('b')
>>> V = 10 * b * N.x
>>> print(V)
10*b*N.x

r   r   )listr   r   rangelenr   )r   r3   newlistis       r"   rH   Vector.__mul__   sT    , tyy/s7|$A!*Q-/A?GJ %gr%   c                     U S-  $ N r'   s    r"   __neg__Vector.__neg__   s    byr%   c           	      j   SSK Jn  [        U5      nU" S5      nU R                   GH  nUR                   GH  nX2" US   S   US   S   -  US   R                  US   R                  4/5      -  nX2" US   S   US   S   -  US   R                  US   R
                  4/5      -  nX2" US   S   US   S   -  US   R                  US   R                  4/5      -  nX2" US   S   US   S   -  US   R
                  US   R                  4/5      -  nX2" US   S   US   S   -  US   R
                  US   R
                  4/5      -  nX2" US   S   US   S   -  US   R
                  US   R                  4/5      -  nX2" US   S   US   S   -  US   R                  US   R                  4/5      -  nX2" US   S   US   S   -  US   R                  US   R
                  4/5      -  nX2" US   S   US   S   -  US   R                  US   R                  4/5      -  nGM     GM     U$ )aH  Outer product between two Vectors.

A rank increasing operation, which returns a Dyadic from two Vectors

Parameters
==========

other : Vector
    The Vector to take the outer product with

Examples
========

>>> from sympy.physics.vector import ReferenceFrame, outer
>>> N = ReferenceFrame('N')
>>> outer(N.x, N.x)
(N.x|N.x)

r   )r8   r   r:   )r<   r8   r1   r   xyz)r   r3   r8   rB   r!   rE   s         r"   outerVector.outer   sm   * 	7e$AYAjj fqtAwAq11Q4662a577CDEEfqtAwAq11Q4662a577CDEEfqtAwAq11Q4662a577CDEEfqtAwAq11Q4662a577CDEEfqtAwAq11Q4662a577CDEEfqtAwAq11Q4662a577CDEEfqtAwAq11Q4662a577CDEEfqtAwAq11Q4662a577CDEEfqtAwAq11Q4662a577CDEE !  	r%   c                    U R                   n[        U5      S:X  a  [        S5      $ / nU H  nS H  nUS   U   S:X  a&  UR                  SUS   R                  U   -   5        M5  US   U   S:X  a&  UR                  SUS   R                  U   -   5        Mg  US   U   S:w  d  Mu  UR                  US   U   5      n[        US   U   [        5      (       a  SU-  nUS   S:X  a  USS	 nSnOSnUR                  Xv-   US   R                  U   -   5        M     M     S
R                  U5      nUR                  S5      (       a  USS	 nU$ UR                  S5      (       a  USS	 nU$ )zLatex Printing method. r   r   r   r:   r    + rZ    - (%s)-N     )
r   rT   strr   
latex_vecs_printr   r   join
startswith)	r   printerarrB   r!   jarg_str	str_startoutstrs	            r"   _latexVector._latex   sq    YYr7a<q6MAQ47a<IIeadooa&889qT!W]IIeadooa&889qT!W\ &nnQqT!W5G!!A$q'3//"(7"2qzS(")!"+$)	$)	IIi1AaDOOA4FFG%  ( U##ABZF  s##ABZFr%   c           	        ^^ SSK Jm  / nUU4S jnU R                   H  u  pE[        S5       H  nXF   S:X  a  M  XF   S:X  a&  UR	                  T" UR
                  U   5      5        M;  XF   S:X  a/  UR	                  T" S5      T" UR
                  U   5      -  5        Mr  UR	                  U" XF   UR
                  U   5      5        M     M     U(       a  TR                  " U6 nU$ T" S5      nU$ )	zPretty Printing method. r   )
prettyFormc                    > TR                  U 5      nTR                  U5      nU R                  (       a  T" UR                  5       6 nTR                  X#/SS9$ )Nrl   )	delimiter)ro   is_Addparens
_print_seq)abpapbr{   rr   s       r"   	juxtapose!Vector._pretty.<locals>.juxtapose  sN    "B"Bxx-%%rh#%>>r%   rk   r   rZ   z-10) sympy.printing.pretty.stringpictr{   r   rS   r   pretty_vecsr4   )	r   rr   termsr   MNrV   pretty_resultr{   s	    `      @r"   _prettyVector._pretty  s    ?	? IIDA1X419TQYLLAMM!,<!=>TRZLLD!1Jq}}Q?O4P!PQLL14q1A!BC   &..6M  'sOMr%   c                     SU -  U-   $ rY   r[   r2   s     r"   __rsub__Vector.__rsub__!  s    T	U""r%   c                 
   U(       a  [        U R                  5      S:X  a  [        U R                  5      nO[        U R                  5      S:X  a  UR                  S5      $ U R                   Vs0 s H  oDS   US   _M     nn[	        UR                  5       S S9n/ nU H  nUR                  XW   U45        M     / nU H  nS H  n	US   U	   S:X  a&  UR                  SUS   R                  U	   -   5        M5  US   U	   S:X  a&  UR                  SUS   R                  U	   -   5        Mg  US   U	   S:w  d  Mu  UR                  US   U	   5      n
[        US   U	   [        5      (       a  S	U
-  n
U
S   S
:X  a  U
SS n
SnOSnUR                  X-   S-   US   R                  U	   -   5        M     M     SR                  U5      nUR                  S5      (       a  USS nU$ UR                  S5      (       a  USS nU$ s  snf )zPrinting method. r   r   c                     U R                   $ r+   )index)r_   s    r"   <lambda>"Vector._sympystr.<locals>.<lambda>,  s    !''r%   )keyre   rf   rZ   rg   rh   ri   N*rj   rk   rl   )rT   r   rR   ro   sortedkeysr   str_vecsr   r   rp   rq   )r   rr   orderrs   r!   r   r   r   rB   rt   ru   rv   rw   s                r"   	_sympystrVector._sympystr$  s   DII!+diiB^q >>!$$%)YY/Y1qtYA/!&&((9:DB		163-( AQ47a<IIeadmmA&667qT!W]IIeadmmA&667qT!W\ &nnQqT!W5G!!A$q'3//"(7"2qzS(")!"+$)	$)	IIi1C7!A$--:JJK%  ( U##ABZF  s##ABZF? 0s   /H c                 *    U R                  US-  5      $ )zThe subtraction operator. rZ   )r4   r2   s     r"   __sub__Vector.__sub__L  s    ||EBJ''r%   c                    SSK JnJn  [        X5      (       a^  U" U5      nU" S5      n[	        UR
                  5       H3  u  pVXFS   U R                  US   5      R                  US   5      -  -  nM5     U$ [        U5      nUR
                  / :X  a  [        S5      $ S n/ nUR
                  n	U	 H  nUS   R                  n
US   R                  nUS   R                  nXU/U R                  U
5      U R                  U5      U R                  U5      /[        U/5      R                  U
5      [        U/5      R                  U5      [        U/5      R                  U5      //nX" U5      R
                  -  nM     [        U5      $ )a  The cross product operator for two Vectors.

Returns a Vector, expressed in the same ReferenceFrames as self.

Parameters
==========

other : Vector
    The Vector which we are crossing with

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.vector import ReferenceFrame, cross
>>> q1 = symbols('q1')
>>> N = ReferenceFrame('N')
>>> cross(N.x, N.y)
N.z
>>> A = ReferenceFrame('A')
>>> A.orient_axis(N, q1, N.x)
>>> cross(A.x, N.y)
N.z
>>> cross(N.y, A.x)
- sin(q1)*A.y - cos(q1)*A.z

r   r7   r   r:   c                    U S   S   U S   S   U S   S   -  U S   S   U S   S   -  -
  -  U S   S   U S   S   U S   S   -  U S   S   U S   S   -  -
  -  -   U S   S   U S   S   U S   S   -  U S   S   U S   S   -  -
  -  -   $ )zThis is needed as a little method for to find the determinant
of a list in python; needs to work for a 3x3 list.
SymPy's Matrix will not take in Vector, so need a custom function.
You should not be calling this.

r   r   r:   r[   )mats    r"   _detVector.cross.<locals>._detx  s     F1IQSVAY!6QSVAY9N!NO!fQi3q6!9s1vay#83q6!9F1I< $ !$Qc!fQi#a&).CF1IAq	)/* "++ ,r%   )r<   r8   r9   r   	enumerater   crossrb   r1   r   r_   r`   ra   r=   )r   r3   r8   r9   rB   rV   r!   r   outlistrs   tempxtempytempztempms                 r"   r   Vector.crossP  s`   : 	Fe$$!%(EB!%**-dtzz!A$/66qt<== .Ie$::!9	, ZZAaDFFEaDFFEaDFFEU+xx%Iqc{u-vqc{u/Eqc{u-/0E tE{'''G  gr%   c                 R    0 nU R                    H  n[        U/5      XS   '   M     U$ )as  
The constituents of this vector in different reference frames,
as per its definition.

Returns a dict mapping each ReferenceFrame to the corresponding
constituent Vector.

Examples
========

>>> from sympy.physics.vector import ReferenceFrame
>>> R1 = ReferenceFrame('R1')
>>> R2 = ReferenceFrame('R2')
>>> v = R1.x + R2.x
>>> v.separate() == {R1: R1.x, R2: R2.x}
True

r   )r   r   )r   
componentsr_   s      r"   separateVector.separate  s/    ( 
A%qc{Jt r%   c                 $    U R                  U5      $ r+   )r=   r2   s     r"   __and__Vector.__and__  s    xxr%   c                 $    U R                  U5      $ r+   )r   r2   s     r"   __xor__Vector.__xor__      zz%  r%   c                 $    U R                  U5      $ r+   )rb   r2   s     r"   __or__Vector.__or__  r   r%   c                    SSK Jn  U" U5        [        U5      n/ nU R                   H  nUS   nUS   nX:X  a  XWR	                  U5      U4/-  nM*  U(       a.  UR                  U5      R	                  U5      [        SS5      :X  a  XWR	                  U5      U4/-  nMw  [        U/5      R                  U5      n	U	R                  S   S   R	                  U5      n
U[        X4/5      R                  -  nM     [        U5      $ )a  Returns the partial derivative of the vector with respect to a
variable in the provided reference frame.

Parameters
==========
var : Symbol
    What the partial derivative is taken with respect to.
frame : ReferenceFrame
    The reference frame that the partial derivative is taken in.
var_in_dcm : boolean
    If true, the differentiation algorithm assumes that the variable
    may be present in any of the direction cosine matrices that relate
    the frame to the frames of any component of the vector. But if it
    is known that the variable is not present in the direction cosine
    matrices, false can be set to skip full reexpression in the desired
    frame.

Examples
========

>>> from sympy import Symbol
>>> from sympy.physics.vector import dynamicsymbols, ReferenceFrame
>>> from sympy.physics.vector import init_vprinting
>>> init_vprinting(pretty_print=False)
>>> t = Symbol('t')
>>> q1 = dynamicsymbols('q1')
>>> N = ReferenceFrame('N')
>>> A = N.orientnew('A', 'Axis', [q1, N.y])
>>> A.x.diff(t, N)
- sin(q1)*q1'*N.x - cos(q1)*q1'*N.z
>>> A.x.diff(t, N).express(A).simplify()
- q1'*A.z
>>> B = ReferenceFrame('B')
>>> u1, u2 = dynamicsymbols('u1, u2')
>>> v = u1 * A.x + u2 * B.y
>>> v.diff(u2, N, var_in_dcm=False)
B.y

r   )_check_framer   rk   )	sympy.physics.vector.framer   r   r   diffr@   r   r   express)r   varrN   
var_in_dcmr   r   vector_componentmeasure_numbercomponent_framereexp_vec_compderivs              r"   r   Vector.diff  s   R 	<Ucl $		-a0N.q1O'//4e<== "eii&@&E&Ec&J&+Aqk'2 3 3C 8/JKKF%+-=,>%?%G%G%NN*//215::3?Efun%56;;;F !*  f~r%   c                     SSK Jn  U" XUS9$ )a  
Returns a Vector equivalent to this one, expressed in otherframe.
Uses the global express method.

Parameters
==========

otherframe : ReferenceFrame
    The frame for this Vector to be described in

variables : boolean
    If True, the coordinate symbols(if present) in this Vector
    are re-expressed in terms otherframe

Examples
========

>>> from sympy.physics.vector import ReferenceFrame, dynamicsymbols
>>> from sympy.physics.vector import init_vprinting
>>> init_vprinting(pretty_print=False)
>>> q1 = dynamicsymbols('q1')
>>> N = ReferenceFrame('N')
>>> A = N.orientnew('A', 'Axis', [q1, N.y])
>>> A.x.express(N)
cos(q1)*N.x - sin(q1)*N.z

r   )r   )	variables)sympy.physics.vectorr   )r   
otherframer   r   s       r"   r   Vector.express  s    8 	1t9==r%   c                     [        U Vs/ s H  o R                  U5      PM     sn5      R                  SS5      $ s  snf )a  Returns the matrix form of the vector with respect to the given
frame.

Parameters
----------
reference_frame : ReferenceFrame
    The reference frame that the rows of the matrix correspond to.

Returns
-------
matrix : ImmutableMatrix, shape(3,1)
    The matrix that gives the 1D vector.

Examples
========

>>> from sympy import symbols
>>> from sympy.physics.vector import ReferenceFrame
>>> a, b, c = symbols('a, b, c')
>>> N = ReferenceFrame('N')
>>> vector = a * N.x + b * N.y + c * N.z
>>> vector.to_matrix(N)
Matrix([
[a],
[b],
[c]])
>>> beta = symbols('beta')
>>> A = N.orientnew('A', 'Axis', (beta, N.x))
>>> vector.to_matrix(A)
Matrix([
[                         a],
[ b*cos(beta) + c*sin(beta)],
[-b*sin(beta) + c*cos(beta)]])

rk   r   )r   r=   reshape)r   reference_frameunit_vecs      r"   	to_matrixVector.to_matrix  sD    J &(& /7xx)&( ))0A	7 (s   ;c                 ~   ^ 0 nU R                    H   nUS   R                  U4S j5      X#S   '   M"     [        U5      $ )z(Calls .doit() on each term in the Vectorr   c                 (   > U R                   " S0 TD6$ )Nr[   )doit)r_   hintss    r"   r   Vector.doit.<locals>.<lambda>H  s    qvvr%   r   )r   	applyfuncr   )r   r   r   r!   s    `  r"   r   Vector.doitD  s9    Adnn%>?AdG ayr%   c                     SSK Jn  U" X5      $ )z
Returns a Vector which is the time derivative of
the self Vector, taken in frame otherframe.

Calls the global time_derivative method

Parameters
==========

otherframe : ReferenceFrame
    The frame to calculate the time derivative in

r   )time_derivative)r   r   )r   r   r   s      r"   dt	Vector.dtK  s     	9t00r%   c                 h    0 nU R                    H  n[        US   5      XS   '   M     [        U5      $ )zReturns a simplified Vector.r   r   )r   r   r   )r   r   r!   s      r"   r   Vector.simplify\  s2    AqtnAdG ayr%   c                 v    0 nU R                    H  nUS   R                  " U0 UD6X4S   '   M     [        U5      $ )zSubstitution on the Vector.

Examples
========

>>> from sympy.physics.vector import ReferenceFrame
>>> from sympy import Symbol
>>> N = ReferenceFrame('N')
>>> s = Symbol('s')
>>> a = N.x * s
>>> a.subs({s: 2})
2*N.x

r   r   )r   subsr   )r   r   kwargsr   r!   s        r"   r   Vector.subsc  s>      Adii00AdG ayr%   c                 6    [        U R                  U 5      5      $ )zReturns the magnitude (Euclidean norm) of self.

Warnings
========

Python ignores the leading negative sign so that might
give wrong results.
``-A.x.magnitude()`` would be treated as ``-(A.x.magnitude())``,
instead of ``(-A.x).magnitude()``.

)r   r=   r'   s    r"   	magnitudeVector.magnitudex  s     DHHTN##r%   c                 T    [        U R                  / -   5      U R                  5       -  $ )z9Returns a Vector of magnitude 1, codirectional with self.)r   r   r   r'   s    r"   	normalizeVector.normalize  s!    dii"n%(888r%   c                     [        U5      (       d  [        S5      e0 nU R                   H  nUS   R                  U5      X#S   '   M     [	        U5      $ )z/Apply a function to each component of a vector.z`f` must be callable.r   r   )callablerM   r   r   r   )r   fr   r!   s       r"   r   Vector.applyfunc  sL    {{344AdnnQ'AdG ayr%   c                 z    U R                  5       nUR                  5       n[        UR                  U5      5      nU$ )a;  
Returns the smallest angle between Vector 'vec' and self.

Parameter
=========

vec : Vector
    The Vector between which angle is needed.

Examples
========

>>> from sympy.physics.vector import ReferenceFrame
>>> A = ReferenceFrame("A")
>>> v1 = A.x
>>> v2 = A.y
>>> v1.angle_between(v2)
pi/2

>>> v3 = A.x + A.y + A.z
>>> v1.angle_between(v3)
acos(sqrt(3)/3)

Warnings
========

Python ignores the leading negative sign so that might give wrong
results. ``-A.x.angle_between()`` would be treated as
``-(A.x.angle_between())``, instead of ``(-A.x).angle_between()``.

)r   r	   r=   )r   vecvec1vec2angles        r"   angle_betweenVector.angle_between  s3    B ~~}}TXXd^$r%   c                 8    U R                  U5      R                  $ )an  Returns the free symbols in the measure numbers of the vector
expressed in the given reference frame.

Parameters
==========
reference_frame : ReferenceFrame
    The frame with respect to which the free symbols of the given
    vector is to be determined.

Returns
=======
set of Symbol
    set of symbols present in the measure numbers of
    ``reference_frame``.

)r   free_symbols)r   r   s     r"   r   Vector.free_symbols  s    $ ~~o.;;;r%   c                     SSK Jn  U" XS9$ )a  Returns the free dynamic symbols (functions of time ``t``) in the
measure numbers of the vector expressed in the given reference frame.

Parameters
==========
reference_frame : ReferenceFrame
    The frame with respect to which the free dynamic symbols of the
    given vector is to be determined.

Returns
=======
set
    Set of functions of time ``t``, e.g.
    ``Function('f')(me.dynamicsymbols._t)``.

r   )find_dynamicsymbols)r   )!sympy.physics.mechanics.functionsr   )r   r   r   s      r"   free_dynamicsymbolsVector.free_dynamicsymbols  s    & 	J"4IIr%   c                     U R                   (       d  U $ / n[        U5      nU R                    H%  u  pEUR                  UR                  US9U/5        M'     [	        U5      $ )N)n)r   r   r   evalfr   )r   precnew_argsdpsr   rN   s         r"   _eval_evalfVector._eval_evalf  sT    yyK$))JCOOSYYY-u56 $hr%   c                     / nU R                    H(  u  p4UR                  U5      nUR                  X4/5        M*     [        U5      $ )a  Replace occurrences of objects within the measure numbers of the
vector.

Parameters
==========

rule : dict-like
    Expresses a replacement rule.

Returns
=======

Vector
    Result of the replacement.

Examples
========

>>> from sympy import symbols, pi
>>> from sympy.physics.vector import ReferenceFrame
>>> A = ReferenceFrame('A')
>>> x, y, z = symbols('x y z')
>>> ((1 + x*y) * A.x).xreplace({x: pi})
(pi*y + 1)*A.x
>>> ((1 + x*y) * A.x).xreplace({x: pi, y: 2})
(1 + 2*pi)*A.x

Replacements occur only if an entire node in the expression tree is
matched:

>>> ((x*y + z) * A.x).xreplace({x*y: pi})
(z + pi)*A.x
>>> ((x*y*z) * A.x).xreplace({x*y: pi})
x*y*z*A.x

)r   xreplacer   r   )r   ruler  r   rN   s        r"   r	  Vector.xreplace  sC    L ))JC,,t$COOSL) $ hr%   )r   N)T)F)/__name__
__module____qualname____firstlineno____doc__rA   	is_numberr#   propertyr(   r.   r4   r=   rJ   rO   rH   r\   rb   rx   r   r   r   r   r   __radd____rmul__r   r   __rand__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  __static_attributes__r[   r%   r"   r   r      s    DI):  &.+Z+:8&P D>#&P(@D HH2kkGOH!mmGO!]]FN@D>>&7P1"*$9$L<(J. * r%   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )VectorTypeErrori  c           
      x   > [        S[        U5      < SU< S[        U5      < S35      n[        TU ]  U5        g )NzExpected an instance of z, but received object 'z' of .)r   typesuperr#   )r   r3   wantmsg	__class__s       r"   r#   VectorTypeError.__init__  s0    *.t*eT%[J Kr%   r[   )r  r  r  r  r#   r  __classcell__)r  s   @r"   r  r    s     r%   r  c                 F    [        U [        5      (       d  [        S5      eU $ )NzA Vector must be supplied)r   r   rM   )r3   s    r"   r1   r1   #  s     eV$$344Lr%   N)sympyr   r   r   r   r   r   r	   r
   r   r   sympy.simplify.trigsimpr   sympy.printing.defaultsr   sympy.utilities.miscr   sympy.core.evalfr   mpmath.libmp.libmpfr   __all__r   rM   r  r1   r[   r%   r"   <module>r*     sN   8 8 8 , - + ' + *J Y
 J Zi r%   