+
    ‹°³j^<  ã                   óÒ   € ^ RI Ht ^ RIHt ^ RIHt ^ RIHtHt ^ RI	H
t
HtHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt RR ltR tR tR tR tR tR tR tR tRR/R lt R# )é    )Ú
CoordSys3D)ÚDel)Ú
BaseScalar)ÚVectorÚ
BaseVector)ÚgradientÚcurlÚ
divergence)Údiff)ÚS)Ú	integrate)Úsympify)ÚDyadicNFc           
     óÐ  € V ^ \         P                  39   d   V # \        V\        4      '       g   \	        R4      h\        V \         4      '       Ed   Ve   \        R4      hV'       dx   V P                  \        \        4       Uu0 uF  qDP                  kK  	  upV0,
          p/ pV F#  pVP                  VP                  V4      4       K%  	  V P                  V4      p \         P                  pV P                  4       p	V	 FY  pWA8w  dB   VP                  V4      W”,          P                  V4      ,          p
V\!        W¡4      ,          pKJ  W‰V,          ,          pK[  	  V# \        V \"        4      '       d¹   Vf   Tp\        V\        4      '       g   \	        R4      h\"        P                  pTpV P$                  P'                  4        F_  w  rÞV\)        WáVR7      \)        VP*                  ^ ,          WR7      \)        VP*                  ^,          W,R7      ,          ,          ,          pKa  	  V# Ve   \        R4      hV'       dœ   \-        4       p\/        V 4      p V P                  \        4       F1  pVP                  V8w  g   K  VP1                  VP                  4       K3  	  / pV F#  pVP                  VP                  V4      4       K%  	  V P                  V4      # V # u upi )a¿  
Global function for 'express' functionality.

Re-expresses a Vector, Dyadic or scalar(sympyfiable) in the given
coordinate system.

If 'variables' is True, then the coordinate variables (base scalars)
of other coordinate systems present in the vector/scalar field or
dyadic are also substituted in terms of the base scalars of the
given system.

Parameters
==========

expr : Vector/Dyadic/scalar(sympyfiable)
    The expression to re-express in CoordSys3D 'system'

system: CoordSys3D
    The coordinate system the expr is to be expressed in

system2: CoordSys3D
    The other coordinate system required for re-expression
    (only for a Dyadic Expr)

variables : boolean
    Specifies whether to substitute the coordinate variables present
    in expr, in terms of those of parameter system

Examples
========

>>> from sympy.vector import CoordSys3D
>>> from sympy import Symbol, cos, sin
>>> N = CoordSys3D('N')
>>> q = Symbol('q')
>>> B = N.orient_new_axis('B', q, N.k)
>>> from sympy.vector import express
>>> express(B.i, N)
(cos(q))*N.i + (sin(q))*N.j
>>> express(N.x, B, variables=True)
B.x*cos(q) - B.y*sin(q)
>>> d = N.i.outer(N.i)
>>> express(d, B, N) == (cos(q))*(B.i|N.i) + (-sin(q))*(B.j|N.i)
True

z>system should be a CoordSys3D                         instancezJsystem2 should not be provided for                                 VectorszCsystem2 should be a CoordSys3D                             instance©Ú	variables)r   ÚzeroÚ
isinstancer   Ú	TypeErrorÚ
ValueErrorÚatomsr   r   ÚsystemÚupdateÚ
scalar_mapÚsubsÚseparateÚrotation_matrixÚ	to_matrixÚmatrix_to_vectorr   Ú
componentsÚitemsÚexpressÚargsÚsetr   Úadd)Úexprr   Úsystem2r   ÚxÚsystem_listÚ	subs_dictÚfÚoutvecÚpartsÚtempÚoutdyadÚvarÚkÚvÚ
system_sets   &&&&            ÚW/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/vector/functions.pyr"   r"      sw  € ð` �”6—;‘;ÐÔØˆä�fœj×)Ò)Üð "ó #ð 	#ô �$œ×ÓØÒÜð )ó *ð *÷ ð .2¯Z©Z¼
ÄJÔ-OÓPÑ-O¨Ÿ8œ8Ñ-OÑPÐTZÐS[Õ[ˆKØˆIÛ �Ø× Ñ  §¡¨fÓ!5Ö6ñ !à—9‘9˜YÓ'ˆDä—‘ˆØ—‘“ˆÛˆAØŒ{Ø×-Ñ-¨aÓ0°5µ8×3EÑ3EÀaÓ3HÕH�ØÔ*¨4Ó8Õ8’à �(Õ"’ñ ð ˆä	�Dœ&×	!Ò	!ØŠ?ØˆGÜ˜'¤:×.Ò.Üð &ó 'ð 'ä—+‘+ˆØˆØ—O‘O×)Ñ)Ö+‰DˆAØœ °SÔ9Ü  §¡¨¥¨FÔBÜ  §¡¨¥¨GÔCõDõEõ FŠGñ ,ð
 ˆð ÒÜð )ó *ð *çä›ˆJÜ˜4“=ˆDà—Z‘Z¤
Ö+�Ø—8‘8˜vÖ%Ø—N‘N 1§8¡8Ö,ñ ,ð ˆIÛ�Ø× Ñ  §¡¨fÓ!5Ö6ñ  à—9‘9˜YÓ'Ð'Øˆùò_ Qs   ÂK#c                ó–  € ^ RI Hp V! V 4      p\        V4      ^ 8”  d÷   \        \	        V4      4      p\        WRR7      p VP                  4       w  rEpVP                  4       w  rxp	\        P                  ! W4      \        W4      ,          p
V
\        P                  ! W4      \        W4      ,          ,          p
V
\        P                  ! W4      \        W	4      ,          ,          p
V
^ 8X  d'   \        V \        4      '       d   \        P                  p
V
# \        V \        4      '       d   \        P                  # \        P                  # )a™  
Returns the directional derivative of a scalar or vector field computed
along a given vector in coordinate system which parameters are expressed.

Parameters
==========

field : Vector or Scalar
    The scalar or vector field to compute the directional derivative of

direction_vector : Vector
    The vector to calculated directional derivative along them.


Examples
========

>>> from sympy.vector import CoordSys3D, directional_derivative
>>> R = CoordSys3D('R')
>>> f1 = R.x*R.y*R.z
>>> v1 = 3*R.i + 4*R.j + R.k
>>> directional_derivative(f1, v1)
R.x*R.y + 4*R.x*R.z + 3*R.y*R.z
>>> f2 = 5*R.x**2*R.z
>>> directional_derivative(f2, v1)
5*R.x**2 + 30*R.x*R.z

)Ú_get_coord_systemsTr   )Úsympy.vector.operatorsr6   ÚlenÚnextÚiterr"   Úbase_vectorsÚbase_scalarsr   Údotr   r   r   r   ÚZero)ÚfieldÚdirection_vectorr6   Ú	coord_sysÚiÚjr1   r(   ÚyÚzÚouts   &&         r4   Údirectional_derivativerG   ~   sî   € õ: :Ù" 5Ó)€IÜ
ˆ9ƒ~˜Ôäœ˜i›Ó)ˆ	Ü˜°DÔ9ˆØ×(Ñ(Ó*‰ˆˆaØ×(Ñ(Ó*‰ˆˆaÜ�jŠjÐ)Ó-´°U³Õ>ˆØŒv�zŠzÐ*Ó.´°e³Õ?Õ?ˆØŒv�zŠzÐ*Ó.´°e³Õ?Õ?ˆØ�!Œ8œ
 5¬&×1Ò1Ü—+‘+ˆCØˆ
Ü	�Eœ6×	"Ò	"Ü�{‰{Ðä�v‰vˆó    c                óú   € \        4       pV P                  '       d<   \        \        V 4      4      \	        \	        V 4      4      ,
          P                  4       # VP                  V! V 4      4      P                  4       # )aÝ  
Return the laplacian of the given field computed in terms of
the base scalars of the given coordinate system.

Parameters
==========

expr : SymPy Expr or Vector
    expr denotes a scalar or vector field.

Examples
========

>>> from sympy.vector import CoordSys3D, laplacian
>>> R = CoordSys3D('R')
>>> f = R.x**2*R.y**5*R.z
>>> laplacian(f)
20*R.x**2*R.y**3*R.z + 2*R.y**5*R.z
>>> f = R.x**2*R.i + R.y**3*R.j + R.z**4*R.k
>>> laplacian(f)
2*R.i + 6*R.y*R.j + 12*R.z**2*R.k

)r   Ú	is_Vectorr   r
   r	   Údoitr=   )r&   Údelops   & r4   Ú	laplacianrM   ¯   sW   € ô2 ‹E€EØ‡~‡~€~Üœ DÓ)Ó*¬T´$°t³*Ó-=Õ=×CÑCÓEÐEØ�9‰9‘U˜4“[Ó!×&Ñ&Ó(Ð(rH   c                óÆ   € \        V \        4      '       g   \        R4      hV \        P                  8X  d   R# \	        V 4      P                  4       \        P                  8H  # )ac  
Checks if a field is conservative.

Parameters
==========

field : Vector
    The field to check for conservative property

Examples
========

>>> from sympy.vector import CoordSys3D
>>> from sympy.vector import is_conservative
>>> R = CoordSys3D('R')
>>> is_conservative(R.y*R.z*R.i + R.x*R.z*R.j + R.x*R.y*R.k)
True
>>> is_conservative(R.z*R.j)
False

úfield should be a VectorT)r   r   r   r   r	   Úsimplify©r?   s   &r4   Úis_conservativerR   Î   sH   € ô4 �eœV×$Ò$ÜÐ2Ó3Ð3Ø”—‘ÔÙÜ�‹;×ÑÓ!¤V§[¡[Ñ0Ð0rH   c                óÄ   € \        V \        4      '       g   \        R4      hV \        P                  8X  d   R# \	        V 4      P                  4       \        P                  J # )a[  
Checks if a field is solenoidal.

Parameters
==========

field : Vector
    The field to check for solenoidal property

Examples
========

>>> from sympy.vector import CoordSys3D
>>> from sympy.vector import is_solenoidal
>>> R = CoordSys3D('R')
>>> is_solenoidal(R.y*R.z*R.i + R.x*R.z*R.j + R.x*R.y*R.k)
True
>>> is_solenoidal(R.y * R.j)
False

rO   T)r   r   r   r   r
   rP   r   r>   rQ   s   &r4   Úis_solenoidalrT   ï   sI   € ô4 �eœV×$Ò$ÜÐ2Ó3Ð3Ø”—‘ÔÙÜ�eÓ×%Ñ%Ó'¬1¯6©6Ð1Ð1rH   c                óN  € \        V 4      '       g   \        R4      hV \        P                  8X  d   \        P
                  # \        V\        4      '       g   \        R4      h\        WRR7      p VP                  4       pVP                  4       p\        V P                  V^ ,          4      V^ ,          4      p\        VR,          4       FV  w  rV\        WCV^,           ,          4      pV P                  V4      V,
          pV\        WsV^,           ,          4      ,          pKX  	  V# )ao  
Returns the scalar potential function of a field in a given
coordinate system (without the added integration constant).

Parameters
==========

field : Vector
    The vector field whose scalar potential function is to be
    calculated

coord_sys : CoordSys3D
    The coordinate system to do the calculation in

Examples
========

>>> from sympy.vector import CoordSys3D
>>> from sympy.vector import scalar_potential, gradient
>>> R = CoordSys3D('R')
>>> scalar_potential(R.k, R) == R.z
True
>>> scalar_field = 2*R.x**2*R.y*R.z
>>> grad_field = gradient(scalar_field)
>>> scalar_potential(grad_field, R)
2*R.x**2*R.y*R.z

zField is not conservativeúcoord_sys must be a CoordSys3DTr   :é   NN)rR   r   r   r   r   r>   r   r   r   r"   r;   r<   r   r=   Ú	enumerater   )r?   rA   Ú
dimensionsÚscalarsÚtemp_functionrB   ÚdimÚpartial_diffs   &&      r4   Úscalar_potentialr^     sè   € ô> ˜5×!Ò!ÜÐ4Ó5Ð5Ø”—‘ÔÜ�v‰vˆô �i¤×,Ò,ÜÐ8Ó9Ð9Ü�E°Ô5€EØ×'Ñ'Ó)€JØ×$Ñ$Ó&€Gä˜eŸi™i¨
°1­Ó6¸À½
ÓC€MÜ˜J r�NÖ+‰ˆÜ˜M°1°qµ5­>Ó:ˆØ—y‘y “~¨Õ4ˆØœ <¸¸Q½µÓ@Õ@Šñ ,ð ÐrH   c                ó:  € \        V\        4      '       g   \        R4      h\        V \        4      '       d   \	        W4      pMT pVP
                  p\        VP                  V4      VRR7      p\        VP                  V4      VRR7      p/ p/ p	VP                  4       p
\        VP                  4       4       F9  w  r¼VP                  V4      WŠV,          &   VP                  V4      WšV,          &   K;  	  VP                  V	4      VP                  V4      ,
          # )a­  
Returns the scalar potential difference between two points in a
certain coordinate system, wrt a given field.

If a scalar field is provided, its values at the two points are
considered. If a conservative vector field is provided, the values
of its scalar potential function at the two points are used.

Returns (potential at point2) - (potential at point1)

The position vectors of the two Points are calculated wrt the
origin of the coordinate system provided.

Parameters
==========

field : Vector/Expr
    The field to calculate wrt

coord_sys : CoordSys3D
    The coordinate system to do the calculations in

point1 : Point
    The initial Point in given coordinate system

position2 : Point
    The second Point in the given coordinate system

Examples
========

>>> from sympy.vector import CoordSys3D
>>> from sympy.vector import scalar_potential_difference
>>> R = CoordSys3D('R')
>>> P = R.origin.locate_new('P', R.x*R.i + R.y*R.j + R.z*R.k)
>>> vectfield = 4*R.x*R.y*R.i + 2*R.x**2*R.j
>>> scalar_potential_difference(vectfield, R, R.origin, P)
2*R.x**2*R.y
>>> Q = R.origin.locate_new('O', 3*R.i + R.j + 2*R.k)
>>> scalar_potential_difference(vectfield, R, P, Q)
-2*R.x**2*R.y + 18

rV   Tr   )r   r   r   r   r^   Úoriginr"   Úposition_wrtr<   rX   r;   r=   r   )r?   rA   Úpoint1Úpoint2Ú	scalar_fnr`   Ú	position1Ú	position2Ú
subs_dict1Ú
subs_dict2rZ   rB   r(   s   &&&&         r4   Úscalar_potential_differenceri   C  sü   € ôZ �i¤×,Ò,ÜÐ8Ó9Ð9Ü�%œ× Ò ä$ UÓ6‰	ð ˆ	à×Ñ€FÜ˜×+Ñ+¨FÓ3°YØ"&ô(€Iä˜×+Ñ+¨FÓ3°YØ"&ô(€Ið €JØ€JØ×$Ñ$Ó&€GÜ˜)×0Ñ0Ó2Ö3‰ˆØ!"§¡ yÓ!1ˆ
˜1•:ÑØ!"§¡ yÓ!1ˆ
˜1•:Óñ 4ð �>‰>˜*Ó%¨	¯©°zÓ(BÕBÐBrH   c                ó˜   € \         P                  pVP                  4       p\        V 4       F  w  rEW%W4,          ,          ,          pK  	  V# )aˆ  
Converts a vector in matrix form to a Vector instance.

It is assumed that the elements of the Matrix represent the
measure numbers of the components of the vector along basis
vectors of 'system'.

Parameters
==========

matrix : SymPy Matrix, Dimensions: (3, 1)
    The matrix to be converted to a vector

system : CoordSys3D
    The coordinate system the vector is to be defined in

Examples
========

>>> from sympy import ImmutableMatrix as Matrix
>>> m = Matrix([1, 2, 3])
>>> from sympy.vector import CoordSys3D, matrix_to_vector
>>> C = CoordSys3D('C')
>>> v = matrix_to_vector(m, C)
>>> v
C.i + 2*C.j + 3*C.k
>>> v.to_matrix(C) == m
True

)r   r   r;   rX   )Úmatrixr   r,   ÚvectsrB   r(   s   &&    r4   r   r   ˆ  s@   € ô@ �[‰[€FØ×ÑÓ!€EÜ˜&Ö!‰ˆØ�e•h•,ÕŠñ "à€MrH   c                óö  € V P                   VP                   8w  d3   \        R\        V 4      ,           R,           \        V4      ,           4      h. pTpVP                  e    VP	                  V4       VP                  pK-  VP	                  V4       \        V4      p. pT pW49  d    VP	                  V4       VP                  pK%  \        V4      pVP                  W"P                  V4      RR1,          4       We3# )z«
Calculates the 'path' of objects starting from 'from_object'
to 'to_object', along with the index of the first common
ancestor in the tree.

Returns (index, list) tuple.
z!No connecting path found between z and Néÿÿÿÿ)	Ú_rootr   ÚstrÚ_parentÚappendr$   r8   ÚextendÚindex)Úfrom_objectÚ	to_objectÚ
other_pathÚobjÚ
object_setÚ	from_pathrt   s   &&     r4   Ú_pathr{   ¯  së   € ð ×Ñ˜IŸO™OÔ+ÜÐ<Ü˜[Ó)õ*Ø,3õ4Ü69¸)³nõEó Fð 	Fð €JØ
€CØ
�+‰+Ò
!Ø×Ñ˜#ÔØ�k‰kŠØ×Ñ�cÔÜ�Z“€JØ€IØ
€CØ
Ô
Ø×Ñ˜ÔØ�k‰kŠÜ�	‹N€EØ×Ñ�Z× 0Ñ 0°Ó 5Ð 9°rÐ 9Õ:Ô;ØÐÐrH   Úorthonormalc                ó   € \         ;QJ d    R V 4       F  '       d   K   RM	  RM! R V 4       4      '       g   \        R4      h. p\        V4       F|  w  r4\        V4       F'  pWBV,          P	                  W,          4      ,          pK)  	  VP                  \        P                  4      '       d   \        R4      hVP                  V4       K~  	  V '       d   V Uu. uF  qfP                  4       NK  	  ppV# u upi )aï  
Takes a sequence of independent vectors and orthogonalizes them
using the Gram - Schmidt process. Returns a list of
orthogonal or orthonormal vectors.

Parameters
==========

vlist : sequence of independent vectors to be made orthogonal.

orthonormal : Optional parameter
              Set to True if the vectors returned should be
              orthonormal.
              Default: False

Examples
========

>>> from sympy.vector.coordsysrect import CoordSys3D
>>> from sympy.vector.functions import orthogonalize
>>> C = CoordSys3D('C')
>>> i, j, k = C.base_vectors()
>>> v1 = i + 2*j
>>> v2 = 2*i + 3*j
>>> orthogonalize(v1, v2)
[C.i + 2*C.j, 2/5*C.i + (-1/5)*C.j]

References
==========

.. [1] https://en.wikipedia.org/wiki/Gram-Schmidt_process

c              3   óB   "  € T F  p\        V\        4      x € K  	  R # 5i)N)r   r   )Ú.0Úvecs   & r4   Ú	<genexpr>Ú orthogonalize.<locals>.<genexpr>ð  s   é € Ð8±%¨3Œz˜#œv×&Ð&³%ùs   ‚FTz#Each element must be of Type Vectorz#Vector set not linearly independent)Úallr   rX   ÚrangeÚ
projectionÚequalsr   r   r   rr   Ú	normalize)r|   ÚvlistÚortho_vlistrB   ÚtermrC   r€   s   $*     r4   Úorthogonalizer‹   Í  sÆ   € ÷F ‹3Ñ8±%Ó8�3�3Š3Ñ8±%Ó8×8Ò8ÜÐ=Ó>Ð>à€KÜ˜UÖ#‰ˆÜ�q–ˆAØ •N×-Ñ-¨e­hÓ7Õ7ŠDñ ð
 �;‰;”v—{‘{×#Ò#ÜÐBÓCÐCØ×Ñ˜4Ö ñ $÷ Ù2=Ó>±+¨3—}‘}–±+ˆÐ>àÐùò ?s   ÃC;)NF)!Úsympy.vector.coordsysrectr   Úsympy.vector.deloperatorr   Úsympy.vector.scalarr   Úsympy.vector.vectorr   r   r7   r   r	   r
   Úsympy.core.functionr   Úsympy.core.singletonr   Úsympy.integrals.integralsr   Ú
sympy.corer   Úsympy.vector.dyadicr   r"   rG   rM   rR   rT   r^   ri   r   r{   r‹   © rH   r4   Ú<module>r–      si   ðÝ 0Ý (Ý *ß 2ß =Ñ =Ý $Ý "Ý /Ý Ý &ônòb.òb)ò>1òB2òB0òfBCòJ$òNð<4 eö 4rH   