U
    ZÊ¹jr  ã                   @   sê   d dl mZ d dlmZ d dlmZ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mZ d d	lmZ d d
lmZ edƒZedƒ\ZZZZZe deej¡Z e  dee j!¡Z"e" dee"j#¡Z$dd„ Z%dd„ Z&dd„ Z'dS )é    )ÚVector)Ú
CoordSys3D)ÚexpressÚmatrix_to_vectorÚorthogonalize)ÚRational)ÚS)Úsymbols)Úsqrt)ÚcosÚsin)ÚImmutableDenseMatrix)ÚraisesÚNzq1 q2 q3 q4 q5ÚAÚBÚCc                   C   sN  t tjtƒtjkst‚t tjtƒtjks,t‚t tjt	ƒt
tƒt	j ttƒt	j  ksXt‚t tjt	ƒttƒttƒ t	j t
tƒt	j  ttƒt
tƒ t	j  ks¢t‚t tjt	ƒttƒ t
tƒ t	j ttƒt	j  t
tƒt
tƒ t	j  ksît‚t tjtƒt
tƒtj ttƒtj  k�st‚t tjtƒttƒ tj t
tƒtj  k�sLt‚t tjtƒtjk�sdt‚t tjtƒtjk�s|t‚t tjtƒtjk�s”t‚t tjtƒtjk�s¬t‚t tjtƒtjk�sÄt‚t tjtƒt
tƒtj ttƒtj  k�sòt‚t tjtƒttƒtj t
tƒtj  k�s t‚t tjt	ƒt
tƒt	j ttƒt	j  k�sNt‚t tjt	ƒttƒttƒ t	j t
tƒt	j  ttƒt
tƒ t	j  k�sšt‚t tjt	ƒttƒ t
tƒ t	j ttƒt	j  t
tƒt
tƒ t	j  k�sèt‚t tjtƒtjk�s t‚t tjtƒtjk�st‚t tjtƒtjk�s0t‚t tjtƒt
tƒtj ttƒtj  k�s^t‚t tjtƒttƒtj t
tƒtj  k�sŒt‚t tjtƒtjk�s¤t‚t tjtƒt
tƒtj ttƒt
tƒ tj  ttƒttƒ tj  k�sðt‚t tjtƒttƒtj t
tƒt
tƒ tj  ttƒt
tƒ tj  k�s<t‚t tjtƒttƒtj t
tƒtj  k�sjt‚t tjt	ƒt
tƒt
tƒ ttƒttƒ ttƒ  t	j ttƒt
tƒ t	j  ttƒt
tƒ ttƒttƒ t
tƒ  t	j  k�sît‚t tjt	ƒttƒt
tƒ ttƒttƒ t
tƒ  t	j t
tƒt
tƒ t	j  ttƒttƒ ttƒt
tƒ t
tƒ  t	j  k�srt‚t tjt	ƒttƒ t
tƒ t	j ttƒt	j  t
tƒt
tƒ t	j  k�sÀt‚t tjtƒt
tƒtj ttƒtj  k�sît‚t tjtƒttƒ tj t
tƒtj  k�st‚t tjtƒtjk�s6t‚t tjtƒtjk�sNt‚t tjtƒtjk�sft‚t tjtƒtjk�s~t‚t tjtƒtjk�s–t‚t tjtƒt
tƒtj ttƒtj  k�sÄt‚t tjtƒttƒtj t
tƒtj  k�sòt‚t tjt	ƒt
tƒt	j ttƒt	j  k�s t‚t tjt	ƒttƒttƒ t	j t
tƒt	j  ttƒt
tƒ t	j  k�slt‚t tjt	ƒttƒ t
tƒ t	j ttƒt	j  t
tƒt
tƒ t	j  k�sºt‚t tjtƒt
tƒtj ttƒtj  k�sèt‚t tjtƒttƒ t
tƒ tj t
tƒt
tƒ tj  ttƒtj  k�s6t‚t tjtƒttƒttƒ tj ttƒt
tƒ tj  t
tƒtj  k�s‚t‚t tjtƒtjk�sšt‚t tjtƒt
tƒtj ttƒtj  k�sÈt‚t tjtƒttƒ tj t
tƒtj  k�søt‚t tjtƒtjk�	st‚t tjtƒtjk�	s(t‚t tjtƒtjk�	s@t‚t tjt	ƒt
tƒt	j ttƒt	j  k�	snt‚t tjt	ƒt	jk�	s†t‚t tjt	ƒttƒ t	j t
tƒt	j  k�	s¶t‚t t	jtƒt
tƒt
tƒ ttƒttƒ ttƒ  tj ttƒt
tƒ ttƒttƒ t
tƒ  tj  ttƒt
tƒ tj  k�
s:t‚t t	jtƒttƒ t
tƒ tj t
tƒt
tƒ tj  ttƒtj  k�
sˆt‚t t	jtƒttƒt
tƒ ttƒttƒ t
tƒ  tj ttƒttƒ ttƒt
tƒ t
tƒ  tj  t
tƒt
tƒ tj  k�st‚t t	jtƒt
tƒtj ttƒttƒ tj  ttƒt
tƒ tj  k�sXt‚t t	jtƒt
tƒtj ttƒtj  k�s†t‚t t	jtƒttƒtj ttƒt
tƒ tj  t
tƒt
tƒ tj  k�sÒt‚t t	jtƒt
tƒtj ttƒtj  k�s t‚t t	jtƒtjk�st‚t t	jtƒttƒtj t
tƒtj  k�sFt‚t t	jt	ƒt	jk�s^t‚t t	jt	ƒt	jk�svt‚t t	jt	ƒt	j  k�ršt	jk�s n t‚tjt t
tƒtj ttƒtj  tƒ ¡ k�sÒt‚tjt ttƒtj t
tƒtj  tƒ ¡ k�st‚tjt t
tƒtj ttƒt
tƒ tj  ttƒttƒ tj  tƒ ¡ k�sTt‚tjt ttƒtj t
tƒt
tƒ tj  ttƒt
tƒ tj  tƒ ¡ k�s¤t‚tjt ttƒtj t
tƒtj  tƒ ¡ k�sÖt‚tjt t
tƒtj ttƒtj  tƒ ¡ k�st‚tjt ttƒ tj t
tƒtj  tƒ ¡ k�s<t‚tjt t
tƒtj ttƒtj  tƒ ¡ k�snt‚tjt ttƒtj t
tƒtj  tƒ ¡ k�s t‚tjt t
tƒt	j ttƒt	j  tƒ ¡ k�sÒt‚tjt ttƒttƒ t	j t
tƒt	j  ttƒt
tƒ t	j  tƒ ¡ k�s"t‚tjt ttƒ t
tƒ t	j ttƒt	j  t
tƒt
tƒ t	j  tƒ ¡ k�stt‚tjt t
tƒtj ttƒtj  tƒ ¡ k�s¦t‚tjt ttƒ t
tƒ tj t
tƒt
tƒ tj  ttƒtj  tƒ ¡ k�søt‚tjt ttƒttƒ tj ttƒt
tƒ tj  t
tƒtj  tƒ ¡ k�sHt‚tjt t
tƒtj ttƒtj  tƒ ¡ k�szt‚tjt ttƒ tj t
tƒtj  tƒ ¡ k�s®t‚tjt t
tƒt	j ttƒt	j  tƒ ¡ k�sàt‚tjt ttƒ t	j t
tƒt	j  tƒ ¡ k�st‚t	jt t
tƒtj ttƒttƒ tj  ttƒt
tƒ tj  t	ƒ ¡ k�sdt‚t	jt t
tƒtj ttƒtj  t	ƒ ¡ k�s–t‚t	jt ttƒtj ttƒt
tƒ tj  t
tƒt
tƒ tj  t	ƒ ¡ k�sæt‚t	jt t
tƒtj ttƒtj  t	ƒ ¡ k�st‚t	jt ttƒtj t
tƒtj  t	ƒ ¡ k�sJt‚d S ©N)r   r   Úzeror   ÚAssertionErrorr   ZZeror   Úir   r   Úq3r   ÚkÚjÚq2Úq1r   Úsimplify© r   r   ú`/var/www/html/bwave/python/venv/lib/python3.8/site-packages/sympy/vector/tests/test_functions.pyÚtest_express   sj   ,,ÿ
.ÿ
.0...,ÿ.ÿ..,ÿ,ÿ.
,ÿ,þÿ

,ÿ,þÿ
.ÿ.0...,ÿ.ÿ. ÿÿÿÿ.0.0
,,ÿþÿ

:ÿ

,,ÿþÿ
,ÿ.,ÿ..*22(ÿÿ(ÿÿ224222(ÿÿ*ÿÿ2ÿÿÿÿÿÿ2424(ÿÿ2(ÿÿ2r   c                  C   s¼   t dgdgdggƒ} t| tƒtjdtj  dtj  ks<t‚t dgdgdggƒ} t| tƒt| tƒ  krrtj	ksxn t‚t t
gtgtggƒ} t| tƒt
tj ttj  ttj  ks¸t‚d S )Né   é   é   r   )ÚMatrixr   r   r   r   r   r   r   r   r   r   r   r   )Úmr   r   r   Útest_matrix_to_vectorž   s    (ÿr%   c                     sd  t dƒ} tddd�\}}|  ¡ \}}}|d|  ‰ d| d|  ‰d| d|  ‰d| | }d| d|  }|| ||  ‰d| | d| |  ‰tˆ ˆƒ| jd| j  | jtddƒ | j d  gksÐt‚t||dd	�dtd
ƒ | j d
 td
ƒ| j d
  td
ƒ | j d
 dtd
ƒ | j d
  gk�s6t‚t	t
‡ ‡‡fdd„ƒ t	t
‡‡fdd„ƒ d S )Nr   za bT)Úintegerr!   r"   é   é   )Zorthonormalé
   c                      s   t ˆ ˆˆƒS r   ©r   r   )Úv1Úv2Úv3r   r   Ú<lambda>·   ó    z$test_orthogonalize.<locals>.<lambda>c                      s
   t ˆ ˆƒS r   r*   r   )Úv6Úv7r   r   r.   ¸   r/   )r   r	   Zbase_vectorsr   r   r   r   r   r
   r   Ú
ValueError)r   ÚaÚbr   r   r   Zv4Zv5r   )r+   r,   r-   r0   r1   r   Útest_orthogonalize¨   s     :Pÿ
r5   N)(Zsympy.vector.vectorr   Zsympy.vector.coordsysrectr   Zsympy.vector.functionsr   r   r   Zsympy.core.numbersr   Zsympy.core.singletonr   Zsympy.core.symbolr	   Z(sympy.functions.elementary.miscellaneousr
   Z(sympy.functions.elementary.trigonometricr   r   Zsympy.matrices.immutabler   r#   Zsympy.testing.pytestr   r   r   r   r   Zq4Zq5Zorient_new_axisr   r   r   r   r   r   r   r%   r5   r   r   r   r   Ú<module>   s$    
