ó
¡¼™\c           @   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	 m
 Z
 m Z m Z m Z m Z d  d l m Z e d ƒ Z e	 d ƒ \ Z Z Z Z Z e j d e e j ƒ Z e j d	 e e j ƒ Z e j d
 e e j ƒ Z d „  Z d „  Z  d „  Z! d S(   iÿÿÿÿ(   t   Vector(   t
   CoordSys3D(   t   expresst   matrix_to_vectort   orthogonalize(   t   symbolst   St   sqrtt   sint   cost   ImmutableMatrix(   t   raisest   Ns   q1 q2 q3 q4 q5t   At   Bt   Cc           C   sÏ  t  t j t ƒ t j k s! t ‚ t  t d ƒ t ƒ t d ƒ k sH 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 så t ‚ t  t j t ƒ t t
 ƒ t	 t ƒ t j t t ƒ t j t	 t ƒ t	 t
 ƒ t j k sG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 j k sDt ‚ t  t j t ƒ t j k se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 sz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 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	 t ƒ t j t t ƒ t	 t ƒ t j t t ƒ t t ƒ t j k s9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	 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 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 sÿt ‚ t  t j t ƒ t j k s t ‚ t  t j t ƒ t j k sAt ‚ t  t j t ƒ t j k sb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 sX	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	 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 sW
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 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 sw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 sSt ‚ t  t j t ƒ t j k st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 sX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 sa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 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 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 oct j k n snt ‚ t j t  t	 t ƒ t j t t ƒ t j t ƒ j ƒ  k s°t ‚ t j t  t t ƒ t j t	 t ƒ t j t ƒ j ƒ  k sòt ‚ t j t  t	 t ƒ t j t t ƒ t	 t ƒ t j t t ƒ t t ƒ t j t ƒ j ƒ  k sYt ‚ t j t  t t ƒ t j t	 t ƒ t	 t ƒ t j t t ƒ t	 t ƒ t j t ƒ j ƒ  k sÀt ‚ t j t  t t ƒ t j t	 t ƒ t j t ƒ j ƒ  k st ‚ t j t  t	 t ƒ t j t t ƒ t j t ƒ j ƒ  k sDt ‚ t j t  t t ƒ t j t	 t ƒ t j t ƒ j ƒ  k s‡t ‚ t j t  t	 t ƒ t j t t ƒ t j t ƒ j ƒ  k sÉt ‚ t j t  t t ƒ t j t	 t ƒ t j t ƒ j ƒ  k st ‚ t j t  t	 t
 ƒ t j t t
 ƒ t j t ƒ j ƒ  k sMt ‚ t j t  t t ƒ t t
 ƒ t j t	 t ƒ t j t t ƒ t	 t
 ƒ t j t ƒ j ƒ  k s´t ‚ t j t  t t
 ƒ t	 t ƒ t j t t ƒ t j t	 t ƒ t	 t
 ƒ t j t ƒ j ƒ  k st ‚ t j t  t	 t ƒ t j t t ƒ t j t ƒ j ƒ  k s^t ‚ t j t  t t ƒ t	 t ƒ t j t	 t ƒ t	 t ƒ t j t t ƒ t j t ƒ j ƒ  k sÆt ‚ t j t  t t ƒ t t ƒ t j t t ƒ t	 t ƒ t j t	 t ƒ t j t ƒ j ƒ  k s-t ‚ t j t  t	 t ƒ t j t t ƒ t j t ƒ j ƒ  k sot ‚ t j t  t t ƒ t j t	 t ƒ t j t ƒ j ƒ  k s²t ‚ t j t  t	 t
 ƒ t j t t
 ƒ t j t ƒ j ƒ  k sôt ‚ t j t  t t
 ƒ t j t	 t
 ƒ t j t ƒ j ƒ  k s7t ‚ t j t  t	 t
 ƒ t j t t ƒ t t
 ƒ t j t t
 ƒ t	 t ƒ t j t ƒ j ƒ  k sžt ‚ t j t  t	 t ƒ t j t t ƒ t j t ƒ j ƒ  k sàt ‚ t j t  t t
 ƒ t j t t ƒ t	 t
 ƒ t j t	 t ƒ t	 t
 ƒ t j t ƒ j ƒ  k sGt ‚ t j t  t	 t
 ƒ t j t t
 ƒ t j t ƒ j ƒ  k s‰t ‚ t j t  t t
 ƒ t j t	 t
 ƒ t j t ƒ j ƒ  k sËt ‚ d  S(   Ni    (   R   R    t   zeroR   t   AssertionErrorR   R   t   iR   R	   t   q3R   t   kt   jt   q2t   q1R   t   simplify(    (    (    s@   lib/python2.7/site-packages/sympy/vector/tests/test_functions.pyt   test_express   sî    !'<:';'<=!!!!!<<<:';'!!!<<!:':'<SESE;'<=!!!!!<<<:';'<SR!<=!!!<!=q'Sq':'<:'<!<!!4BB4343BBCBBB4353B	_	^BCBC43B43Bc          C   s  t  d g d g d g g ƒ }  t |  t ƒ t j d t j d t j k sR t ‚ t  d g d g d g g ƒ }  t |  t ƒ t |  t ƒ k oœ t j	 k n s§ 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(   Ni   i   i   i    (   t   MatrixR   R   R   R   R   R   R   R    R   R   R   R   (   t   m(    (    s@   lib/python2.7/site-packages/sympy/vector/tests/test_functions.pyt   test_matrix_to_vector™   s    4 c             s²  t  d ƒ }  t d d t ƒ\ } } |  j ƒ  \ } } } | d | ‰  d | d | ‰ d | d | ‰ d | | } d | d | } | | | | ‰ d | | d | | ‰ t ˆ  ˆ ƒ |  j d |  j d |  j d |  j d g k sý t ‚ t | | d t ƒd t d	 ƒ |  j d	 t d	 ƒ |  j d	 t d	 ƒ |  j d	 d t d	 ƒ |  j d	 g k syt ‚ t	 t
 ‡  ‡ ‡ f d
 †  ƒ t	 t
 ‡ ‡ f d †  ƒ d  S(   NR   s   a bt   integeri   i   i   i   t   orthonormali
   c              s   t  ˆ  ˆ ˆ ƒ S(   N(   R   (    (   t   v1t   v2t   v3(    s@   lib/python2.7/site-packages/sympy/vector/tests/test_functions.pyt   <lambda>²   t    c              s   t  ˆ  ˆ ƒ S(   N(   R   (    (   t   v6t   v7(    s@   lib/python2.7/site-packages/sympy/vector/tests/test_functions.pyR"   ³   R#   (   R   R   t   Truet   base_vectorsR   R   R   R   R   R   t
   ValueError(   R   t   at   bR   R   R   t   v4t   v5(    (   R   R    R!   R$   R%   s@   lib/python2.7/site-packages/sympy/vector/tests/test_functions.pyt   test_orthogonalize£   s    FjN("   t   sympy.vector.vectorR    t   sympy.vector.coordsysrectR   t   sympy.vector.functionsR   R   R   t   sympyR   R   R   R   R	   R
   R   t   sympy.utilities.pytestR   R   R   R   R   t   q4t   q5t   orient_new_axisR   R   R   R   R   R   R   R   R-   (    (    (    s@   lib/python2.7/site-packages/sympy/vector/tests/test_functions.pyt   <module>   s   .	‹	
