Ë
    óÿæibO  ã                  ó  — d dl mZ d dlmZ d dlmZmZ d dlmZ d dl	m
Z
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 d dlmZ d dlmZmZmZmZ d dlmZ d dl m!Z!m"Z"m#Z# d dl$m%Z%  G d„ de«      Z&d„ Z'd e'e«      giejP                  e&<    G d„ de&e
«      Z) G d„ dee&«      Z* G d„ dee&«      Z+ G d„ dee&«      Z, G d„ de&«      Z- G d„ de«      Z.d „ Z/d!„ Z0e&e&_1        e+e&_2        e*e&_3        e,e&_4        e)e&_5         e,«       e&_6        y")#é    )Úannotations)Úproduct)ÚAddÚBasic)Ú	StdFactKB)Ú
AtomicExprÚExpr)ÚPow)ÚS)Údefault_sort_key)Úsympify©Úsqrt)ÚImmutableDenseMatrix)ÚBasisDependentZeroÚBasisDependentÚBasisDependentMulÚBasisDependentAdd)Ú
CoordSys3D)ÚDyadicÚ
BaseDyadicÚ	DyadicAdd)Ú
VectorKindc                  óH  — e Zd ZU dZdZdZdZded<   ded<   ded<   ded	<   ded
<   ded<    e«       Z	ded<   e
d„ «       Zd„ Zd„ Zd„ Zd„ Zd„ Zej                  e_        d„ Zd„ Zej                  e_        d„ Zdd„Ze
d„ «       Zd„ Zej                  e_        d„ Zd„ Zd„ Zy) ÚVectorz�
    Super class for all Vector classes.
    Ideally, neither this class nor any of its subclasses should be
    instantiated by the user.
    FTg      (@ztype[Vector]Ú
_expr_typeÚ	_mul_funcÚ	_add_funcÚ
_zero_funcÚ
_base_funcÚ
VectorZeroÚzeror   Úkindc                ó   — | j                   S )a‚  
        Returns the components of this vector in the form of a
        Python dictionary mapping BaseVector instances to the
        corresponding measure numbers.

        Examples
        ========

        >>> from sympy.vector import CoordSys3D
        >>> C = CoordSys3D('C')
        >>> v = 3*C.i + 4*C.j + 5*C.k
        >>> v.components
        {C.i: 3, C.j: 4, C.k: 5}

        )Ú_components©Úselfs    úh/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/sympy/vector/vector.pyÚ
componentszVector.components(   s   € ð& ×ÑÐó    c                ó   — t        | | z  «      S )z7
        Returns the magnitude of this vector.
        r   r&   s    r(   Ú	magnitudezVector.magnitude=   s   € ô �D˜4‘KÓ Ð r*   c                ó(   — | | j                  «       z  S )z@
        Returns the normalized version of this vector.
        )r,   r&   s    r(   Ú	normalizezVector.normalizeC   s   € ð �d—n‘nÓ&Ñ&Ð&r*   c                óP   — | |z
  }|j                  |«      }|j                  d«      S )aM  
        Check if ``self`` and ``other`` are identically equal vectors.

        Explanation
        ===========

        Checks if two vector expressions are equal for all possible values of
        the symbols present in the expressions.

        Examples
        ========

        >>> from sympy.vector import CoordSys3D
        >>> from sympy.abc import x, y
        >>> from sympy import pi
        >>> C = CoordSys3D('C')

        Compare vectors that are equal or not:

        >>> C.i.equals(C.j)
        False
        >>> C.i.equals(C.i)
        True

        These two vectors are equal if `x = y` but are not identically equal
        as expressions since for some values of `x` and `y` they are unequal:

        >>> v1 = x*C.i + C.j
        >>> v2 = y*C.i + C.j
        >>> v1.equals(v1)
        True
        >>> v1.equals(v2)
        False

        Vectors from different coordinate systems can be compared:

        >>> D = C.orient_new_axis('D', pi/2, C.i)
        >>> D.j.equals(C.j)
        False
        >>> D.j.equals(C.k)
        True

        Parameters
        ==========

        other: Vector
            The other vector expression to compare with.

        Returns
        =======

        ``True``, ``False`` or ``None``. A return value of ``True`` indicates
        that the two vectors are identically equal. A return value of ``False``
        indicates that they are not. In some cases it is not possible to
        determine if the two vectors are identically equal and ``None`` is
        returned.

        See Also
        ========

        sympy.core.expr.Expr.equals
        r   )ÚdotÚequals)r'   ÚotherÚdiffÚ	diff_mag2s       r(   r1   zVector.equalsI   s,   € ð~ �e‰|ˆØ—H‘H˜T“Nˆ	Ø×Ñ Ó"Ð"r*   c                óÚ  ‡ — t        |t        «      rŠt        ‰ t        «      rt        j                  S t        j                  }|j
                  j                  «       D ];  \  }}|j                  d   j                  ‰ «      }|||z  |j                  d   z  z  }Œ= |S ddl	m
} t        ||t        f«      st        t        |«      dz   dz   «      ‚t        ||«      rˆ fd„}|S t        ‰ |«      S )aN  
        Returns the dot product of this Vector, either with another
        Vector, or a Dyadic, or a Del operator.
        If 'other' is a Vector, returns the dot product scalar (SymPy
        expression).
        If 'other' is a Dyadic, the dot product is returned as a Vector.
        If 'other' is an instance of Del, returns the directional
        derivative operator as a Python function. If this function is
        applied to a scalar expression, it returns the directional
        derivative of the scalar field wrt this Vector.

        Parameters
        ==========

        other: Vector/Dyadic/Del
            The Vector or Dyadic we are dotting with, or a Del operator .

        Examples
        ========

        >>> from sympy.vector import CoordSys3D, Del
        >>> C = CoordSys3D('C')
        >>> delop = Del()
        >>> C.i.dot(C.j)
        0
        >>> C.i & C.i
        1
        >>> v = 3*C.i + 4*C.j + 5*C.k
        >>> v.dot(C.k)
        5
        >>> (C.i & delop)(C.x*C.y*C.z)
        C.y*C.z
        >>> d = C.i.outer(C.i)
        >>> C.i.dot(d)
        C.i

        r   é   )ÚDelz is not a vector, dyadic or zdel operatorc                ó"   •— ddl m}  || ‰«      S )Nr   )Údirectional_derivative)Úsympy.vector.functionsr9   )Úfieldr9   r'   s     €r(   r9   z*Vector.dot.<locals>.directional_derivativeÃ   s   ø€ ÝIÙ-¨e°TÓ:Ð:r*   )Ú
isinstancer   r!   r   r"   r)   ÚitemsÚargsr0   Úsympy.vector.deloperatorr7   Ú	TypeErrorÚstr)r'   r2   ÚoutvecÚkÚvÚvect_dotr7   r9   s   `       r(   r0   z
Vector.dotŒ   sÚ   ø€ ôP �eœVÔ$Ü˜$¤
Ô+Ü—{‘{Ð"Ü—[‘[ˆFØ×(Ñ(×.Ñ.Ö0‘��1ØŸ6™6 !™9Ÿ=™=¨Ó.�Ø˜( Q™,¨¯©°©Ñ2Ñ2‘ð 1ð ˆMÝ0Ü˜% #¤v Ô/ÜœC ›JÐ)GÑGØ*ñ+ó ,ð ,ô �e˜SÔ!ô;ð *Ð)ä�4˜ÓÐr*   c                ó$   — | j                  |«      S ©N©r0   ©r'   r2   s     r(   Ú__and__zVector.__and__Ê   s   € Ø�x‰x˜‹Ðr*   c                ój  — t        |t        «      r˜t        | t        «      rt        j                  S t        j                  }|j                  j                  «       D ]I  \  }}| j                  |j                  d   «      }|j                  |j                  d   «      }|||z  z  }ŒK |S t        | |«      S )aÃ  
        Returns the cross product of this Vector with another Vector or
        Dyadic instance.
        The cross product is a Vector, if 'other' is a Vector. If 'other'
        is a Dyadic, this returns a Dyadic instance.

        Parameters
        ==========

        other: Vector/Dyadic
            The Vector or Dyadic we are crossing with.

        Examples
        ========

        >>> from sympy.vector import CoordSys3D
        >>> C = CoordSys3D('C')
        >>> C.i.cross(C.j)
        C.k
        >>> C.i ^ C.i
        0
        >>> v = 3*C.i + 4*C.j + 5*C.k
        >>> v ^ C.i
        5*C.j + (-4)*C.k
        >>> d = C.i.outer(C.i)
        >>> C.j.cross(d)
        (-1)*(C.k|C.i)

        r   r6   )	r<   r   r!   r"   r)   r=   Úcrossr>   Úouter)r'   r2   ÚoutdyadrC   rD   Úcross_productrM   s          r(   rL   zVector.crossÏ   s™   € ô@ �eœVÔ$Ü˜$¤
Ô+Ü—{‘{Ð"Ü—k‘kˆGØ×(Ñ(×.Ñ.Ö0‘��1Ø $§
¡
¨1¯6©6°!©9Ó 5�Ø%×+Ñ+¨A¯F©F°1©IÓ6�Ø˜1˜u™9Ñ$‘ð 1ð ˆNä�T˜5Ó!Ð!r*   c                ó$   — | j                  |«      S rG   ©rL   rI   s     r(   Ú__xor__zVector.__xor__û   ó   € Ø�z‰z˜%Ó Ð r*   c                óˆ  — t        |t        «      st        d«      ‚t        | t        «      st        |t        «      rt        j
                  S t        | j                  j                  «       |j                  j                  «       «      D ����cg c]  \  \  }}\  }}||z  t        ||«      z  ‘Œ }}}}}t        |Ž S c c}}}}w )a±  
        Returns the outer product of this vector with another, in the
        form of a Dyadic instance.

        Parameters
        ==========

        other : Vector
            The Vector with respect to which the outer product is to
            be computed.

        Examples
        ========

        >>> from sympy.vector import CoordSys3D
        >>> N = CoordSys3D('N')
        >>> N.i.outer(N.j)
        (N.i|N.j)

        z!Invalid operand for outer product)r<   r   r@   r!   r   r"   r   r)   r=   r   r   )r'   r2   Úk1Úv1Úk2Úv2r>   s          r(   rM   zVector.outer   s¯   € ô. ˜%¤Ô(ÜÐ?Ó@Ð@Ü˜œzÔ*Ü˜5¤*Ô-Ü—;‘;Ðô
 ˜4Ÿ?™?×0Ñ0Ó2°E×4DÑ4D×4JÑ4JÓ4LÔMöOÙMñ 4F±8°B¸¹X¸bÀ"��b‘œJ r¨2Ó.Ó.ØMð 	ó Oô ˜$ÐÐùõOs   Â"B<
c                ó  — | j                  t        j                  «      r"|rt        j                  S t        j                  S |r#| j                  |«      | j                  | «      z  S | j                  |«      | j                  | «      z  | z  S )a«  
        Returns the vector or scalar projection of the 'other' on 'self'.

        Examples
        ========

        >>> from sympy.vector.coordsysrect import CoordSys3D
        >>> C = CoordSys3D('C')
        >>> i, j, k = C.base_vectors()
        >>> v1 = i + j + k
        >>> v2 = 3*i + 4*j
        >>> v1.projection(v2)
        7/3*C.i + 7/3*C.j + 7/3*C.k
        >>> v1.projection(v2, scalar=True)
        7/3

        )r1   r   r"   r   ÚZeror0   )r'   r2   Úscalars      r(   Ú
projectionzVector.projection$  sg   € ð$ �;‰;”v—{‘{Ô#Ù#”1—6‘6Ð4¬¯©Ð4áØ—8‘8˜E“? T§X¡X¨d£^Ñ3Ð3à—8‘8˜E“? T§X¡X¨d£^Ñ3°dÑ:Ð:r*   c                ó6  — ddl m} t        | t        «      r/t        j
                  t        j
                  t        j
                  fS t        t         || «      «      «      j                  «       }t        |D �cg c]  }| j                  |«      ‘Œ c}«      S c c}w )aé  
        Returns the components of this vector but the output includes
        also zero values components.

        Examples
        ========

        >>> from sympy.vector import CoordSys3D, Vector
        >>> C = CoordSys3D('C')
        >>> v1 = 3*C.i + 4*C.j + 5*C.k
        >>> v1._projections
        (3, 4, 5)
        >>> v2 = C.x*C.y*C.z*C.i
        >>> v2._projections
        (C.x*C.y*C.z, 0, 0)
        >>> v3 = Vector.zero
        >>> v3._projections
        (0, 0, 0)
        r   )Ú_get_coord_systems)Úsympy.vector.operatorsr^   r<   r!   r   rZ   ÚnextÚiterÚbase_vectorsÚtupler0   )r'   r^   Úbase_vecÚis       r(   Ú_projectionszVector._projections>  sm   € õ, 	>Ü�dœJÔ'Ü—F‘FœAŸF™F¤A§F¡FÐ+Ð+ÜœÑ/°Ó5Ó6Ó7×DÑDÓFˆÜ©8Ó4©8 a�d—h‘h˜q•k¨8Ñ4Ó5Ð5ùÒ4s   Á7Bc                ó$   — | j                  |«      S rG   )rM   rI   s     r(   Ú__or__zVector.__or__Z  rS   r*   c                óx   — t        |j                  «       D �cg c]  }| j                  |«      ‘Œ c}«      S c c}w )a  
        Returns the matrix form of this vector with respect to the
        specified coordinate system.

        Parameters
        ==========

        system : CoordSys3D
            The system wrt which the matrix form is to be computed

        Examples
        ========

        >>> from sympy.vector import CoordSys3D
        >>> C = CoordSys3D('C')
        >>> from sympy.abc import a, b, c
        >>> v = a*C.i + b*C.j + c*C.k
        >>> v.to_matrix(C)
        Matrix([
        [a],
        [b],
        [c]])

        )ÚMatrixrb   r0   )r'   ÚsystemÚunit_vecs      r(   Ú	to_matrixzVector.to_matrix_  sC   € ô4 Ø×*Ñ*Ô,ó.Ù,ð /7�t—x‘x Õ)Ø,ñ.ó /ð 	/ùò .s   ˜7c                óÈ   — i }| j                   j                  «       D ]B  \  }}|j                  |j                  t        j
                  «      ||z  z   ||j                  <   ŒD |S )aÅ  
        The constituents of this vector in different coordinate systems,
        as per its definition.

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

        Examples
        ========

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

        )r)   r=   Úgetrk   r   r"   )r'   ÚpartsÚvectÚmeasures       r(   ÚseparatezVector.separate|  sX   € ð( ˆØ!Ÿ_™_×2Ñ2Ö4‰MˆD�'Ø"'§)¡)¨D¯K©K¼¿¹Ó"EØ"&¨¡.ñ#1ˆE�$—+‘+Òð 5ð ˆr*   c                ó  — t        | t        «      rt        |t        «      rt        d«      ‚t        | t        «      rB|t        j                  k(  rt        d«      ‚t        | t        |t        j                  «      «      S t        d«      ‚)z( Helper for division involving vectors. zCannot divide two vectorszCannot divide a vector by zeroz#Invalid division involving a vector)	r<   r   r@   r   rZ   Ú
ValueErrorÚ	VectorMulr
   ÚNegativeOne)Úoner2   s     r(   Ú_div_helperzVector._div_helper–  sf   € ä�cœ6Ô"¤z°%¼Ô'@ÜÐ7Ó8Ð8Ü˜œVÔ$ØœŸ™ŠÜ Ð!AÓBÐBÜ˜S¤# e¬Q¯]©]Ó";Ó<Ð<äÐAÓBÐBr*   N)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	is_scalarÚ	is_VectorÚ_op_priorityÚ__annotations__r   r#   Úpropertyr)   r,   r.   r1   r0   rJ   rL   rR   rM   r\   rf   rh   rm   rs   ry   © r*   r(   r   r      sÜ   … ñð €IØ€IØ€LàÓØÓØÓØÓØÓØ
Óá!“|€Dˆ*Ó#àñ ó ð ò(!ò'òA#òF< ò|ð —k‘k€G„Oò*"òX!ð —m‘m€G„Oò" óH;ð4 ñ6ó ð6ò6!ð —]‘]€F„Nò/ò:ó4	Cr*   r   c                ó   ‡ — ˆ fd„}|S )Nc                óä   •— t         t        i‰   }g }| j                  D ].  }t        |j                  t
        «      sŒ|j                  |«       Œ0 |t        k(  rt        |Ž j                  d¬«      S y )NF)Údeep)r   Ú	VectorAddr>   r<   r#   r   ÚappendÚdoit)ÚexprÚ	vec_classÚvectorsÚtermÚclss       €r(   Ú_postprocessorz)get_postprocessor.<locals>._postprocessor¤  sg   ø€ Üœ)Ð$ SÑ)ˆ	ØˆØ—I”IˆDÜ˜$Ÿ)™)¤ZÕ0Ø—‘˜tÕ$ð ð œ	Ò!Ü˜gÐ&×+Ñ+°Ð+Ó7Ð7ð "r*   rƒ   )rŽ   r�   s   ` r(   Úget_postprocessorr�   £  s   ø€ ô8ð Ðr*   r   c                  óV   ‡ — e Zd ZdZdˆ fd„	Zed„ «       Zd„ Zd„ Zed„ «       Z	d„ Z
ˆ xZS )	Ú
BaseVectorz)
    Class to denote a base vector.

    c                óF  •— |€dj                  |«      }|€dj                  |«      }t        |«      }t        |«      }|t        dd«      vrt        d«      ‚t	        |t
        «      st        d«      ‚|j                  |   }t        ‰| �%  | t        |«      |«      }||_        |t        j                  i|_        t        j                  |_        |j                  dz   |z   |_        d|z   |_        ||_        ||_        ||f|_        d	d
i}t)        |«      |_        ||_        |S )Nzx{}zx_{}r   é   zindex must be 0, 1 or 2zsystem should be a CoordSys3DÚ.Ú ÚcommutativeT)ÚformatrA   Úrangeru   r<   r   r@   Ú_vector_namesÚsuperÚ__new__r   Ú_base_instanceÚOner%   Ú_measure_numberÚ_nameÚ_pretty_formÚ_latex_formÚ_systemÚ_idr   Ú_assumptionsÚ_sys)	rŽ   Úindexrk   Ú
pretty_strÚ	latex_strÚnameÚobjÚassumptionsÚ	__class__s	           €r(   rœ   zBaseVector.__new__º  s  ø€ ØÐØŸ™ eÓ,ˆJØÐØŸ™ eÓ,ˆIÜ˜“_ˆ
Ü˜	“Nˆ	àœ˜a ›Ñ#ÜÐ6Ó7Ð7Ü˜&¤*Ô-ÜÐ;Ó<Ð<Ø×#Ñ# EÑ*ˆä‰g‰o˜c¤1 U£8¨VÓ4ˆà ˆÔØ¤§¡˜,ˆŒÜŸe™eˆÔØ—L‘L 3Ñ&¨Ñ-ˆŒ	Ø 
™?ˆÔØ#ˆŒØˆŒà˜&�/ˆŒØ$ dÐ+ˆÜ$ [Ó1ˆÔð
 ˆŒàˆ
r*   c                ó   — | j                   S rG   )r£   r&   s    r(   rk   zBaseVector.systemÝ  s   € à�|‰|Ðr*   c                ó   — | j                   S rG   )r    )r'   Úprinters     r(   Ú	_sympystrzBaseVector._sympystrá  s   € Ø�z‰zÐr*   c                óh   — | j                   \  }}|j                  |«      dz   |j                  |   z   S )Nr•   )r¤   Ú_printrš   )r'   r°   r§   rk   s       r(   Ú
_sympyreprzBaseVector._sympyreprä  s3   € ØŸ™‰ˆˆvØ�~‰~˜fÓ%¨Ñ+¨f×.BÑ.BÀ5Ñ.IÑIÐIr*   c                ó   — | hS rG   rƒ   r&   s    r(   Úfree_symbolszBaseVector.free_symbolsè  s	   € àˆvˆr*   c                ó   — | S rG   rƒ   r&   s    r(   Ú_eval_conjugatezBaseVector._eval_conjugateì  s   € Øˆr*   )NN)rz   r{   r|   r}   rœ   r‚   rk   r±   r´   r¶   r¸   Ú__classcell__)r­   s   @r(   r’   r’   ´  sF   ø„ ñõ
!ðF ñó ðòòJð ñó ðör*   r’   c                  ó   — e Zd ZdZd„ Zd„ Zy)r‡   z2
    Class to denote sum of Vector instances.
    c                ó8   — t        j                  | g|¢­i |¤Ž}|S rG   )r   rœ   ©rŽ   r>   Úoptionsr«   s       r(   rœ   zVectorAdd.__new__õ  ó!   € Ü×'Ñ'¨Ð>¨dÒ>°gÑ>ˆØˆ
r*   c                ó6  — d}t        | j                  «       j                  «       «      }|j                  d„ ¬«       |D ]T  \  }}|j	                  «       }|D ]:  }||j
                  v sŒ| j
                  |   |z  }||j                  |«      dz   z  }Œ< ŒV |d d S )Nr–   c                ó(   — | d   j                  «       S )Nr   )Ú__str__)Úxs    r(   Ú<lambda>z%VectorAdd._sympystr.<locals>.<lambda>ü  s   €   1¡§¡¤r*   ©Úkeyz + éýÿÿÿ)Úlistrs   r=   Úsortrb   r)   r³   )	r'   r°   Úret_strr=   rk   rq   Ú
base_vectsrÂ   Ú	temp_vects	            r(   r±   zVectorAdd._sympystrù  sš   € ØˆÜ�T—]‘]“_×*Ñ*Ó,Ó-ˆØ�
‰
Ñ/ˆ
Ô0Û!‰LˆF�DØ×,Ñ,Ó.ˆJÛ�Ø˜Ÿ™Ò'Ø $§¡°Ñ 2°QÑ 6�IØ˜wŸ~™~¨iÓ8¸5Ñ@Ñ@‘Gñ  ð "ð �s˜ˆ|Ðr*   N)rz   r{   r|   r}   rœ   r±   rƒ   r*   r(   r‡   r‡   ð  s   „ ñòó
r*   r‡   c                  ó6   — e Zd ZdZd„ Zed„ «       Zed„ «       Zy)rv   z>
    Class to denote products of scalars and BaseVectors.
    c                ó8   — t        j                  | g|¢­i |¤Ž}|S rG   )r   rœ   r¼   s       r(   rœ   zVectorMul.__new__  r¾   r*   c                ó   — | j                   S )z) The BaseVector involved in the product. )r�   r&   s    r(   Úbase_vectorzVectorMul.base_vector  s   € ð ×"Ñ"Ð"r*   c                ó   — | j                   S )zU The scalar expression involved in the definition of
        this VectorMul.
        )rŸ   r&   s    r(   Úmeasure_numberzVectorMul.measure_number  s   € ð
 ×#Ñ#Ð#r*   N)rz   r{   r|   r}   rœ   r‚   rÏ   rÑ   rƒ   r*   r(   rv   rv     s4   „ ñòð ñ#ó ð#ð ñ$ó ñ$r*   rv   c                  ó"   — e Zd ZdZdZdZdZd„ Zy)r!   z'
    Class to denote a zero vector
    g333333(@Ú0z\mathbf{\hat{0}}c                ó0   — t        j                  | «      }|S rG   )r   rœ   )rŽ   r«   s     r(   rœ   zVectorZero.__new__%  s   € Ü ×(Ñ(¨Ó-ˆØˆ
r*   N)rz   r{   r|   r}   r€   r¡   r¢   rœ   rƒ   r*   r(   r!   r!     s   „ ñð €LØ€LØ%€Kór*   r!   c                  ó   — e Zd ZdZd„ Zd„ Zy)ÚCrossaŒ  
    Represents unevaluated Cross product.

    Examples
    ========

    >>> from sympy.vector import CoordSys3D, Cross
    >>> R = CoordSys3D('R')
    >>> v1 = R.i + R.j + R.k
    >>> v2 = R.x * R.i + R.y * R.j + R.z * R.k
    >>> Cross(v1, v2)
    Cross(R.i + R.j + R.k, R.x*R.i + R.y*R.j + R.z*R.k)
    >>> Cross(v1, v2).doit()
    (-R.y + R.z)*R.i + (R.x - R.z)*R.j + (-R.x + R.y)*R.k

    c                óÄ   — t        |«      }t        |«      }t        |«      t        |«      kD  rt        ||«       S t        j                  | ||«      }||_        ||_        |S rG   )r   r   rÖ   r	   rœ   Ú_expr1Ú_expr2©rŽ   Úexpr1Úexpr2r«   s       r(   rœ   zCross.__new__<  s\   € Ü˜“ˆÜ˜“ˆÜ˜EÓ"Ô%5°eÓ%<Ò<Ü˜% Ó'Ð'Ð'Ü�l‰l˜3  uÓ-ˆØˆŒ
ØˆŒ
Øˆ
r*   c                óB   — t        | j                  | j                  «      S rG   )rL   rØ   rÙ   ©r'   Úhintss     r(   r‰   z
Cross.doitF  s   € Ü�T—[‘[ $§+¡+Ó.Ð.r*   N©rz   r{   r|   r}   rœ   r‰   rƒ   r*   r(   rÖ   rÖ   *  s   „ ñò"ó/r*   rÖ   c                  ó   — e Zd ZdZd„ Zd„ Zy)ÚDota�  
    Represents unevaluated Dot product.

    Examples
    ========

    >>> from sympy.vector import CoordSys3D, Dot
    >>> from sympy import symbols
    >>> R = CoordSys3D('R')
    >>> a, b, c = symbols('a b c')
    >>> v1 = R.i + R.j + R.k
    >>> v2 = a * R.i + b * R.j + c * R.k
    >>> Dot(v1, v2)
    Dot(R.i + R.j + R.k, a*R.i + b*R.j + c*R.k)
    >>> Dot(v1, v2).doit()
    a + b + c

    c                ó¨   — t        |«      }t        |«      }t        ||gt        ¬«      \  }}t        j                  | ||«      }||_        ||_        |S )NrÄ   )r   Úsortedr   r	   rœ   rØ   rÙ   rÚ   s       r(   rœ   zDot.__new__^  sN   € Ü˜“ˆÜ˜“ˆÜ˜u e˜nÔ2BÔC‰ˆˆuÜ�l‰l˜3  uÓ-ˆØˆŒ
ØˆŒ
Øˆ
r*   c                óB   — t        | j                  | j                  «      S rG   )r0   rØ   rÙ   rÞ   s     r(   r‰   zDot.doitg  s   € Ü�4—;‘; §¡Ó,Ð,r*   Nrà   rƒ   r*   r(   râ   râ   J  s   „ ñò&ó-r*   râ   c                ó”  ‡ ‡— t        ‰ t        «      r(t        j                  ˆfd„‰ j                  D «       «      S t        ‰t        «      r(t        j                  ˆ fd„‰j                  D «       «      S t        ‰ t
        «      rÔt        ‰t
        «      rÄ‰ j                  ‰j                  k(  r…‰ j                  d   }‰j                  d   }||k(  rt        j                  S h d£j                  ||h«      j                  «       }|dz   dz  |k(  rdnd}|‰ j                  j                  «       |   z  S ddlm} 	  |‰ ‰j                  «      }t        |‰«      S t        ‰ t"        «      st        ‰t"        «      rt        j                  S t        ‰ t$        «      r>t'        t)        ‰ j*                  j-                  «       «      «      \  }}	|	t        |‰«      z  S t        ‰t$        «      r>t'        t)        ‰j*                  j-                  «       «      «      \  }
}|t        ‰ |
«      z  S t!        ‰ ‰«      S # t        $ r t!        ‰ ‰«      cY S w xY w)	a^  
    Returns cross product of two vectors.

    Examples
    ========

    >>> from sympy.vector import CoordSys3D
    >>> from sympy.vector.vector import cross
    >>> R = CoordSys3D('R')
    >>> v1 = R.i + R.j + R.k
    >>> v2 = R.x * R.i + R.y * R.j + R.z * R.k
    >>> cross(v1, v2)
    (-R.y + R.z)*R.i + (R.x - R.z)*R.j + (-R.x + R.y)*R.k

    c              3  ó6   •K  — | ]  }t        |‰«      –— Œ y ­wrG   rQ   ©Ú.0re   Úvect2s     €r(   Ú	<genexpr>zcross.<locals>.<genexpr>|  s   øè ø€ Ð!F¹:°a¤%¨¨5§/¹:ùó   ƒc              3  ó6   •K  — | ]  }t        ‰|«      –— Œ y ­wrG   rQ   ©ré   re   Úvect1s     €r(   rë   zcross.<locals>.<genexpr>~  s   øè ø€ Ð!F¹:°a¤%¨¨q§/¹:ùrì   r   >   r   r6   é   r6   r”   éÿÿÿÿ©Úexpress)r<   r   r‡   Úfromiterr>   r’   r¦   r   r"   Ú
differenceÚpoprb   Ú	functionsró   rL   ru   rÖ   r!   rv   r`   ra   r)   r=   )rï   rê   Ún1Ún2Ún3Úsignró   rD   rV   Úm1rX   Úm2s   ``          r(   rL   rL   k  s×  ù€ ô  �%œÔÜ×!Ñ!Ó!F¸5¿:º:Ó!FÓFÐFÜ�%œÔÜ×!Ñ!Ó!F¸5¿:º:Ó!FÓFÐFÜ�%œÔ$¬°E¼:Ô)FØ�:‰:˜Ÿ™Ò#Ø—‘˜A‘ˆBØ—‘˜A‘ˆBØ�RŠxÜ—{‘{Ð"Ú×$Ñ$ b¨" XÓ.×3Ñ3Ó5ˆBØ˜q™& A™¨Ò+‘1°"ˆDØ˜Ÿ
™
×/Ñ/Ó1°"Ñ5Ñ5Ð5Ý&ð	#Ù˜˜uŸz™zÓ*ˆAô ˜˜E“?Ð"Ü�%œÔ$¬
°5¼*Ô(EÜ�{‰{ÐÜ�%œÔ#Ü”d˜5×+Ñ+×1Ñ1Ó3Ó4Ó5‰ˆˆBØ”%˜˜EÓ"Ñ"Ð"Ü�%œÔ#Ü”d˜5×+Ñ+×1Ñ1Ó3Ó4Ó5‰ˆˆBØ”%˜˜rÓ"Ñ"Ð"ä�˜ÓÐøô ò 	'Ü˜ Ó&Ò&ð	'ús   Ä8H/ È/IÉIc                óÔ  ‡ ‡— t        ‰ t        «      r(t        j                  ˆfd„‰ j                  D «       «      S t        ‰t        «      r(t        j                  ˆ fd„‰j                  D «       «      S t        ‰ t        «      rtt        ‰t        «      rd‰ j
                  ‰j
                  k(  r%‰ ‰k(  rt        j                  S t        j                  S ddl	m
} 	  |‰‰ j
                  «      }t        ‰ |«      S t        ‰ t        «      st        ‰t        «      rt        j                  S t        ‰ t        «      r>t!        t#        ‰ j$                  j'                  «       «      «      \  }}|t        |‰«      z  S t        ‰t        «      r>t!        t#        ‰j$                  j'                  «       «      «      \  }}|t        ‰ |«      z  S t        ‰ ‰«      S # t        $ r t        ‰ ‰«      cY S w xY w)a2  
    Returns dot product of two vectors.

    Examples
    ========

    >>> from sympy.vector import CoordSys3D
    >>> from sympy.vector.vector import dot
    >>> R = CoordSys3D('R')
    >>> v1 = R.i + R.j + R.k
    >>> v2 = R.x * R.i + R.y * R.j + R.z * R.k
    >>> dot(v1, v2)
    R.x + R.y + R.z

    c              3  ó6   •K  — | ]  }t        |‰«      –— Œ y ­wrG   rH   rè   s     €r(   rë   zdot.<locals>.<genexpr>¬  s   øè ø€ Ð>±:¨aœC  5ŸM±:ùrì   c              3  ó6   •K  — | ]  }t        ‰|«      –— Œ y ­wrG   rH   rî   s     €r(   rë   zdot.<locals>.<genexpr>®  s   øè ø€ Ð>±:¨aœC  qŸM±:ùrì   r6   rò   )r<   r   rô   r>   r’   r¦   r   rž   rZ   r÷   ró   r0   ru   râ   r!   rv   r`   ra   r)   r=   )rï   rê   ró   rD   rV   rü   rX   rý   s   ``      r(   r0   r0   ›  sn  ù€ ô  �%œÔÜ�|‰|Ó>°5·:²:Ó>Ó>Ð>Ü�%œÔÜ�|‰|Ó>°5·:²:Ó>Ó>Ð>Ü�%œÔ$¬°E¼:Ô)FØ�:‰:˜Ÿ™Ò#Ø! UšN”1—5‘5Ð6´·±Ð6Ý&ð	!Ù˜˜uŸz™zÓ*ˆAô �u˜a“=Ð Ü�%œÔ$¬
°5¼*Ô(EÜ�v‰vˆÜ�%œÔ#Ü”d˜5×+Ñ+×1Ñ1Ó3Ó4Ó5‰ˆˆBØ”#�b˜%“.Ñ Ð Ü�%œÔ#Ü”d˜5×+Ñ+×1Ñ1Ó3Ó4Ó5‰ˆˆBØ”#�e˜R“.Ñ Ð äˆu�eÓÐøô ò 	%Ü�u˜eÓ$Ò$ð	%ús   ÃG ÇG'Ç&G'N)7Ú
__future__r   Ú	itertoolsr   Ú
sympy.corer   r   Úsympy.core.assumptionsr   Úsympy.core.exprr   r	   Úsympy.core.powerr
   Úsympy.core.singletonr   Úsympy.core.sortingr   Úsympy.core.sympifyr   Ú(sympy.functions.elementary.miscellaneousr   Úsympy.matrices.immutabler   rj   Úsympy.vector.basisdependentr   r   r   r   Úsympy.vector.coordsysrectr   Úsympy.vector.dyadicr   r   r   Úsympy.vector.kindr   r   r�   Ú"_constructor_postprocessor_mappingr’   r‡   rv   r!   rÖ   râ   rL   r0   r   r   r   r   r    r"   rƒ   r*   r(   Ú<module>r     s	  ðÝ "Ý ç !Ý ,ß ,Ý  Ý "Ý /Ý &Ý 9Ý C÷:ó :å 0ß =Ñ =Ý (ôKCˆ^ô KCò^
ð 
Ñ˜cÓ"Ð#ð4€× (Ñ (¨Ñ 0ô9�˜ô 9ôxÐ! 6ô ô,$Ð! 6ô $ô,Ð# Vô ô/ˆFô /ô@-ˆ$ô -òB-ò`'ðT €Ô Ø€Ô Ø€Ô Ø€Ô Ø€Ô Ù‹l€…r*   