
    sgpa                         d Z ddlZddlmZmZmZmZmZmZ ddl	m
Z
mZmZmZmZmZmZmZmZmZmZ ddlmZ d Z G d d      Z G d	 d
      Z G d d      Zy)z<Tests for the ``sympy.physics.mechanics.pathway.py`` module.    N)RationalSymbolcospisinsqrt)ForceLinearPathwayObstacleSetPathwayPathwayBasePointReferenceFrameWrappingCylinderWrappingGeometryBaseWrappingPathwayWrappingSpheredynamicsymbols)simplifyc                     | D cg c]6  }|j                  |j                  |j                  j                               8 c}S c c}w N)	__class__locationvectorr   )loadsloads     ]/var/www/html/venv/lib/python3.12/site-packages/sympy/physics/mechanics/tests/test_pathway.py_simplify_loadsr      s@      	t}}dkk&:&:&<=  s   ;Ac            
          e Zd Zd Zeej                  j                  d ed       ed      fi fg      d               Z	eej                  j                  d ed      f ed       ed       ed      fg      d               Z
eej                  j                  dd	 ed      f ed      d	fg      d
               Z ej                  d      d        Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy	)TestLinearPathwayc                 0    t        t        t              sJ y r   )
issubclassr
   r   selfs    r   test_is_pathway_base_subclassz/TestLinearPathway.test_is_pathway_base_subclass&   s    -555    zargs, kwargspApBc                    | \  }}t        | i |}t        |t               sJ t        |d      sJ t        |j                        dk(  sJ |j                  d   |u sJ |j                  d   |u sJ t        |j                  d   t
              sJ |j                  d   j                  dk(  sJ t        |j                  d   t
              sJ |j                  d   j                  dk(  sJ y )Nattachments   r      r&   r'   )r
   
isinstancehasattrlenr)   r   name)argskwargspointApointBinstances        r   test_valid_constructorz(TestLinearPathway.test_valid_constructor)   s      $1&1(M222x///8''(A---##A&&000##A&&000(..q15999##A&++t333(..q15999##A&++t333r%   r)   pZc                 p    t        j                  t              5  t        |  }d d d        y # 1 sw Y   y xY wr   )pytestraises
ValueErrorr
   r)   _s     r   )test_invalid_attachments_incorrect_numberz;TestLinearPathway.test_invalid_attachments_incorrect_number=   s/     ]]:& 	,{+A	, 	, 	,   	,5Nc                 p    t        j                  t              5  t        |  }d d d        y # 1 sw Y   y xY wr   )r8   r9   	TypeErrorr
   r;   s     r   "test_invalid_attachments_not_pointz4TestLinearPathway.test_invalid_attachments_not_pointI   s/     ]]9% 	,{+A	, 	, 	,r>   Tautousec                    t        d      | _        t        d      | _        t        d      | _        t        | j                  | j                        | _        t        d      | _        t        d      | _	        t        d      | _
        t        dd      | _        t        dd      | _        t        dd      | _        t        d      | _        y )	NNr&   r'   q1q2q3r+   F)r   rE   r   r&   r'   r
   pathwayr   rF   rG   rH   q1dq2dq3dr   rI   r"   s    r   _linear_pathway_fixturez)TestLinearPathway._linear_pathway_fixtureU   s    $++$TWWdgg6 & & &!$*!$*!$*r%   c                    t        | j                  | j                        }t        j                  t
              5  d |_        d d d        t        j                  t              5  d |j                  d<   d d d        t        j                  t              5  d |j                  d<   d d d        y # 1 sw Y   lxY w# 1 sw Y   GxY w# 1 sw Y   y xY wNr   r+   )r
   r&   r'   r8   r9   AttributeErrorr)   r@   r#   r4   s     r   test_properties_are_immutablez/TestLinearPathway.test_properties_are_immutablec   s     $''2]]>* 	(#'H 	(]]9% 	+&*H  #	+]]9% 	+&*H  #	+ 	+		( 	(	+ 	+	+ 	+s#   B-#B9C-B69CCc                 h    t        | j                  | j                        }d}t        |      |k(  sJ y )NzLinearPathway(pA, pB))r
   r&   r'   reprr#   rJ   expecteds      r   	test_reprzTestLinearPathway.test_reprl   s-    1*G}(((r%   c                     | j                   j                  | j                  d| j                  j                  z         | j
                  j                  dk(  sJ y Nr*   )r'   set_posr&   rE   xrJ   lengthr"   s    r   test_static_pathway_lengthz,TestLinearPathway.test_static_pathway_lengthq   s<    46688,||""a'''r%   c                     | j                   j                  | j                  d| j                  j                  z         | j
                  j                  dk(  sJ y Nr*   r   )r'   r[   r&   rE   r\   rJ   extension_velocityr"   s    r   &test_static_pathway_extension_velocityz8TestLinearPathway.test_static_pathway_extension_velocityu   s<    46688,||..!333r%   c                    | j                   j                  | j                  d| j                  j                  z         | j                  | j
                   | j                  j                  z  f| j                   | j
                  | j                  j                  z  fg}| j                  j                  | j
                        |k(  sJ y rZ   )r'   r[   r&   rE   r\   rI   rJ   to_loadsr#   rW   s     r   test_static_pathway_to_loadsz.TestLinearPathway.test_static_pathway_to_loadsy   s    46688,WWhtvvxx'(WWdffTVVXXo&
 ||$$TVV,888r%   c                    | j                   j                  | j                  d| j                  z  | j                  j
                  z         dt        | j                  dz        z  }| j                  j                  |k(  sJ y rZ   )	r'   r[   r&   rF   rE   r\   r   rJ   r]   re   s     r   test_2D_pathway_lengthz(TestLinearPathway.test_2D_pathway_length   s\    47746688!34T$''1*%%||""h...r%   c                 8   | j                   j                  | j                  d| j                  z  | j                  j
                  z         dt        | j                  dz        z  | j                  z  | j                  z  }| j                  j                  |k(  sJ y rZ   )
r'   r[   r&   rF   rE   r\   r   rK   rJ   ra   re   s     r   "test_2D_pathway_extension_velocityz4TestLinearPathway.test_2D_pathway_extension_velocity   sn    47746688!34T$''1*%%dhh.tww6||..(:::r%   c                 B   | j                   j                  | j                  d| j                  z  | j                  j
                  z         | j                  | j                   | j                  t        | j                  dz        z  z  | j                  j
                  z  f| j                   | j                  | j                  t        | j                  dz        z  z  | j                  j
                  z  fg}| j                  j                  | j                        |k(  sJ y rZ   )
r'   r[   r&   rF   rE   r\   rI   r   rJ   rd   re   s     r   test_2D_pathway_to_loadsz*TestLinearPathway.test_2D_pathway_to_loads   s    47746688!34WWh$twwz*: :;DFFHHDEWWdffdggTWWaZ(889$&&((BC
 ||$$TVV,888r%   c                    | j                   j                  | j                  | j                  | j                  j
                  z  | j                  | j                  j                  z  z
  d| j                  z  | j                  j                  z  z          t        | j                  dz  | j                  dz  z   d| j                  dz  z  z         }t        | j                  j                  |z
        dk(  sJ y Nr*      r   )r'   r[   r&   rF   rE   r\   rG   yrH   zr   r   rJ   r]   re   s     r   test_3D_pathway_lengthz(TestLinearPathway.test_3D_pathway_length   s    GGGGDFFHHtwwtvvxx//!DGG)DFFHH2DD	
 
TWWaZ/!DGGQJ,>?++h671<<<r%   c                    | j                   j                  | j                  | j                  | j                  j
                  z  | j                  | j                  j                  z  z
  d| j                  z  | j                  j                  z  z          t        | j                  dz  | j                  dz  z   d| j                  dz  z  z         }| j                  | j                  z  |z  | j                  | j                  z  |z  z   d| j                  z  | j                  z  |z  z   }t        | j                  j                   |z
        dk(  sJ y rn   )r'   r[   r&   rF   rE   r\   rG   rp   rH   rq   r   rK   rL   rM   r   rJ   ra   )r#   r]   rW   s      r   "test_3D_pathway_extension_velocityz4TestLinearPathway.test_3D_pathway_extension_velocity   s   GGGGDFFHHtwwtvvxx//!DGG)DFFHH2DD	
 dggqj477A:-$''1*<=GGDHHV#ggdhhv%&i '( 	
 77(BCqHHHr%   c                    | j                   j                  | j                  | j                  | j                  j
                  z  | j                  | j                  j                  z  z
  d| j                  z  | j                  j                  z  z          t        | j                  dz  | j                  dz  z   d| j                  dz  z  z         }| j                   | j                  z  | j                  j
                  z  |z  | j                  | j                  z  | j                  j                  z  |z  z   d| j                  z  | j                  z  | j                  j                  z  |z  z
  }| j                  | j                  z  | j                  j
                  z  |z  | j                  | j                  z  | j                  j                  z  |z  z
  d| j                  z  | j                  z  | j                  j                  z  |z  z   }| j                  |f| j                   |fg}| j                  j                  | j                        |k(  sJ y )Nr*   ro   )r'   r[   r&   rF   rE   r\   rG   rp   rH   rq   r   rI   rJ   rd   )r#   r]   pO_forcepI_forcerW   s        r   test_3D_pathway_to_loadsz*TestLinearPathway.test_3D_pathway_to_loads   s   GGGGDFFHHtwwtvvxx//!DGG)DFFHH2DD	
 dggqj477A:-$''1*<=ffHTWWTVVXX%f,ffTWWnTVVXX%f,-htwwtvvxx'./ 	 FF477N46688#F*ffTWWnTVVXX%f,-htwwtvvxx'./ 	 WWhWWh
 ||$$TVV,888r%   )__name__
__module____qualname__r$   staticmethodr8   markparametrizer   r5   r=   rA   fixturerN   rS   rX   r^   rb   rf   rh   rj   rl   rr   rt   rx    r%   r   r   r   $   sC   6 [[Dk5;',	
4 4 [[4[O4[%+uT{3	
, , [[5;4[$	
, , V^^D! "+)
(49/
;
9=I9r%   r   c                   :   e Zd Zd Zeej                  j                  dddD  cg c]  }t        |       c}}} fddD  cg c]  }t        |       c}}} fddD  cg c]  }t        |       c}}} fd	d
D  cg c]  }t        |       c}}} fg      d               Z	eej                  j                  d ed      g ed       ed      gg      d               Z
eej                  j                  dd ed       ed      f ed      d ed      f ed       ed      dfg      d               Zd Zeej                  j                  ddD  cg c]  }t        |       c}}} dfdD  cg c]  }t        |       c}}} dfdD  cg c]  }t        |       c}}} dfg      d               Z ej                  d      d        Zd Zd Zd Zd Zd  Zd! Zyc c}}} w c c}}} w c c}}} w c c}}} w c c}}} w c c}}} w c c}}} w )"TestObstacleSetPathwayc                 0    t        t        t              sJ y r   )r!   r   r   r"   s    r   r$   z4TestObstacleSetPathway.test_is_pathway_base_subclass   s    ,k:::r%   znum_attachments, attachments   )pOr&   pIro   )r   r&   r'   r      )r   r&   r'   pCr      )r   r&   r'   r   pDr   c                     t        | }t        |t               sJ t        |d      sJ t        |j                        | k(  sJ |j                  D ]  }t        |t
              rJ  y )Nr)   )r   r,   r-   r.   r)   r   )num_attachmentsr)   r4   
attachments       r   r5   z-TestObstacleSetPathway.test_valid_constructor   sm     &{3($6777x///8''(O;;;".. 	1Jj%000	1r%   r)   r   r   c                 p    t        j                  t              5  t        |  }d d d        y # 1 sw Y   y xY wr   )r8   r9   r:   r   r;   s     r   5test_invalid_constructor_attachments_incorrect_numberzLTestObstacleSetPathway.test_invalid_constructor_attachments_incorrect_number   s/     ]]:& 	1"K0A	1 	1 	1r>   Nr&   c                 p    t        j                  t              5  t        |  }d d d        y # 1 sw Y   y xY wr   r8   r9   r@   r   r;   s     r   .test_invalid_constructor_attachments_not_pointzETestObstacleSetPathway.test_invalid_constructor_attachments_not_point   s/     ]]9% 	.-A	. 	. 	.r>   c                 ,   t        t        d      t        d      t        d            }t        j                  t              5  d |_        d d d        t        j                  t              5  d |j
                  d<   d d d        t        j                  t              5  d |j
                  d<   d d d        t        j                  t              5  d |j
                  d<   d d d        y # 1 sw Y   xY w# 1 sw Y   xxY w# 1 sw Y   SxY w# 1 sw Y   y xY w)Nr   r&   r   r   r+   )r   r   r8   r9   rQ   r)   r@   r#   rJ   s     r   rS   z4TestObstacleSetPathway.test_properties_are_immutable   s    $U4[%+uT{K]]>* 	'"&G	']]9% 	*%)G"	*]]9% 	*%)G"	*]]9% 	+&*G#	+ 	+	' 	'	* 	*	* 	*	+ 	+s0   C&+C2C>D
&C/2C;>D
Dzattachments, expectedzObstacleSetPathway(pO, pA, pI)z"ObstacleSetPathway(pO, pA, pB, pI)z&ObstacleSetPathway(pO, pA, pB, pC, pI)c                 4    t        |  }t        |      |k(  sJ y r   )r   rU   )r)   rW   rJ   s      r   rX   z TestObstacleSetPathway.test_repr   s     & %k2G}(((r%   TrB   c                    t        d      | _        t        d      | _        t        d      | _        t        d      | _        t        d      | _        t        d      | _        t        dd      | _	        t        d      | _        y )	NrE   r   r   r&   r'   qr+   rI   )r   rE   r   r   r   r&   r'   r   r   qdr   rI   r"   s    r   _obstacle_set_pathway_fixturez4TestObstacleSetPathway._obstacle_set_pathway_fixture  s_    $++++$ a(r%   c                    | j                   j                  | j                  | j                  j                         | j
                  j                  | j                  | j                  j                         | j                  j                  | j                  | j                  j                         t        | j                  | j                   | j
                  | j                        }|j                  ddt        d      z  z   k(  sJ y )Nr+   r*   )r&   r[   r   rE   r\   r'   rp   r   rq   r   r]   r   r   s     r   r^   z1TestObstacleSetPathway.test_static_pathway_length  s    ***$TWWdggtwwH~~Qa[000r%   c                    | j                   j                  | j                  | j                  j                         | j
                  j                  | j                  | j                  j                         | j                  j                  | j                  | j                  j                         t        | j                  | j                   | j
                  | j                        }|j                  dk(  sJ y Nr   )r&   r[   r   rE   r\   r'   rp   r   rq   r   ra   r   s     r   rb   z=TestObstacleSetPathway.test_static_pathway_extension_velocity  s    ***$TWWdggtwwH))Q...r%   c                    | j                   j                  | j                  | j                  j                         | j
                  j                  | j                  | j                  j                         | j                  j                  | j                  | j                  j                         t        | j                  | j                   | j
                  | j                        }t        | j                  | j                   | j                  j                  z        t        | j                   | j                  | j                  j                  z        t        | j                   | j                  t        d      z  dz  | j                  j                  | j                  j                  z
  z        t        | j
                  | j                  t        d      z  dz  | j                  j                  | j                  j                  z
  z        t        | j
                  | j                  t        d      z  dz  | j                  j                  | j                  j                  z
  z        t        | j                  | j                  t        d      z  dz  | j                  j                  | j                  j                  z
  z        g}|j                  | j                        |k(  sJ y rZ   )r&   r[   r   rE   r\   r'   rp   r   rq   r   r	   rI   r   rd   rV   s      r   rf   z3TestObstacleSetPathway.test_static_pathway_to_loads&  s   ***$TWWdggtwwH$''DFF7TVVXX-.$''466DFFHH,-$''466DG+a/46688dffhh3FGH$''466DG+a/46688dffhh3FGH$''466DG+a/46688dffhh3FGH$''466DG+a/46688dffhh3FGH
 '8333r%   c                    | j                   j                  | j                  | j                  j                  | j                  j
                  z           | j                  j                  | j                  t        | j                        | j                  j                  z  t        | j                        dz   | j                  j
                  z  z
         | j                  j                  | j                  t        | j                        | j                  j                  z  t        | j                        dz
  | j                  j
                  z  z          t        | j                  | j                   | j                  | j                        }dt        d      z  t        ddt        | j                        z  z         z   }|j                  |z
  j                         dk(  sJ y Nr+   r*   r   )r&   r[   r   rE   r\   rp   r'   r   r   r   r   r   r   r]   r   rV   s      r   rh   z-TestObstacleSetPathway.test_2D_pathway_length5  s4   46688dffhh#6!78GGS[46688+s466{Q$&&((.JJ	
 	GGS[46688+s466{Q$&&((.JJ	
 %TWWdggtwwHtAw;a!CK-&7!88)335:::r%   c                     | j                   j                  | j                  | j                  j                  | j                  j
                  z           | j                  j                  | j                  t        | j                        | j                  j                  z  t        | j                        dz   | j                  j
                  z  z
         | j                  j                  | j                  t        | j                        | j                  j                  z  t        | j                        dz
  | j                  j
                  z  z          t        | j                  | j                   | j                  | j                        }t        d      t        | j                        z  | j                  z   dt        t        | j                        dz         z  z  }|j                  |z
  j                         dk(  sJ y r   )r&   r[   r   rE   r\   rp   r'   r   r   r   r   r   r   r   ra   r   rV   s      r   rj   z9TestObstacleSetPathway.test_2D_pathway_extension_velocityA  sL   46688dffhh#6!78GGS[46688+s466{Q$&&((.JJ	
 	GGS[46688+s466{Q$&&((.JJ	
 %TWWdggtwwH1gDFF+dgg56!d3tvv;QR?>S:ST**X5??AQFFFr%   c           
         | j                   j                  | j                  | j                  j                  | j                  j
                  z           | j                  j                  | j                  t        | j                        | j                  j                  z  t        | j                        dz   | j                  j
                  z  z
         | j                  j                  | j                  t        | j                        | j                  j                  z  t        | j                        dz
  | j                  j
                  z  z          t        | j                  | j                   | j                  | j                        }t        d      dz  | j                  j                  | j                  j
                  z   z  }t        dt        | j                        z  dz          dz  | j                  j                  z  t        d      t        | j                        z  dt        t        | j                        dz         z  z  | j                  j
                  z  z   }t        | j                  t        dz  z         | j                  j                  z  t        | j                  t        dz  z         | j                  j
                  z  z
  }t        | j                  | j                  |z        t        | j                   | j                   |z        t        | j                   | j                  |z        t        | j                  | j                   |z        t        | j                  | j                  |z        t        | j                  | j                   |z        g}t!        |j#                  | j                              |k(  sJ y )Nr+   r*   ro   )r&   r[   r   rE   r\   rp   r'   r   r   r   r   r   r   r   r	   rI   r   rd   )r#   rJ   pO_pA_force_vecpA_pB_force_vecpB_pI_force_vecrW   s         r   rl   z/TestObstacleSetPathway.test_2D_pathway_to_loadsM  s   46688dffhh#6!78GGS[46688+s466{Q$&&((.JJ	
 	GGS[46688+s466{Q$&&((.JJ	
 %TWWdggtwwHq'A+DFFHH)<=1s466{?Q&''!+dffhh61gDFF#q4DFFa+@'@ADFFHHLM 	 dffr!tm,tvvxx7#dffr!tm:Ltvvxx:WW$''466O34$''DFF7_45$''466O34$''DFF7_45$''466O34$''DFF7_45
 w//78HDDDr%   )ry   rz   r{   r$   r|   r8   r}   r~   r   r5   r   r   rS   rX   r   r   r^   rb   rf   rh   rj   rl   ).0r/   r   s   000r   r   r      sO   ; [[&);<<t<=)ABBtBC)GHHtHI)MNNtNO		
1 1 [[
+teDk231	 
1 [[5;d,4[$d,4[%+t,	
. .	+ [[ *<<<t<0
 *BBBtB4
 *HHHtH8	
")# $) V^^D! "1/4
;
GEK =BHNb = C Is)   G,G3"G: HH:HHr   c                      e Zd Zd Z ej
                  d      d        Zd Zej                  j                  d e
d      f e
d       e
d       e
d	      fg      d
        Zeej                  j                  dd e
d      f e
d      dfg      d               Zd Zej                  j                  d ed       ed       ed       ed      j$                  g      d        Zd Zd Zd Zed        Zej                  j                  dddedz  fd ed      dz   ed       dz  dfdez  dz  fd edd       ed      dz  dfedz  fg      d        Zej                  j                  ddd edd      ez  fdd efd defd ed      dz   ed       dz  dfd!ez  dz  fd edd       ed      dz  dfedz  fd ed       edd      z   ed        edd      z  df ed ed!d      ez  dz  z         fd edd       ed       edd      z  df ed edd      ez  dz  z         fg      d"        Zej                  j                  d#d$d ed       edd      z   ed        edd      z  dffd edd       ed       edd      z  dffg      d%        Zej                  j                  d#d$d&d'd ed      dz   ed       dz  dffd edd       ed      dz  dffd ed       edd      z   ed       dz  dffd edd       ed      dz  dffg      d(        Zej                  j                  d)d*d ed      dz   ed       dz  dfd ed      dz   ed      dz  dfd+ ed      dz  z
   ed       dz  dffd edd       ed      dz  dfd ed      dz   edd       df ed       dz   edd      dz
  dfff      d,        Zej                  j                  d)d*d-d.d ed      dz   ed       dz  dfd  ed       dz   ed       dz  dfd ed      dz  z    ed      dz  dffd edd       ed      dz  dfd ed      dz   edd       df ed       dz   edd      dz
  dffd ed      dz   ed      dz  dfd ed      dz   ed       dz  df ed       dz   ed      dz  dz
  dffd/d ed      dz   ed       dz  dfd0ez   ed1d2edz  z  z         z  dd ed1d2edz  z  z         z  fd0 ed      z  ez  d ed1d2edz  z  z         z  z  d0 ed      z  ez  d ed1d2edz  z  z         z  z  d3 ed1d2edz  z  z         z  fd! ed      dz   z  ez  d ed1d2edz  z  z         z  z  d! ed      z  ez  d ed1d2edz  z  z         z  z  dfff      d4        Z d5 Z!d6 Z"d7 Z#y)8TestWrappingPathwayc                 0    t        t        t              sJ y r   )r!   r   r   r"   s    r   r$   z1TestWrappingPathway.test_is_pathway_base_subclassi  s    /;777r%   TrB   c                    t        d      | _        t        d      | _        t        dd      | _        t        d      | _        t        d      | _        | j                  j                  | _	        t        | j                  | j
                        | _        t        | j                  | j
                  | j                        | _        t        | j                  | j                  | j                        | _        t        d      | _        y )	Nr&   r'   rT)positiver   rE   rI   )r   r&   r'   r   r   r   r   rE   rq   axr   spherer   cylinderr   rJ   rI   r"   s    r   _wrapping_pathway_fixturez-TestWrappingPathway._wrapping_pathway_fixturel  s    ++d++$&&(($TVVTWW5($''B&twwGr%   c                 L   t        | j                  | j                  | j                        }t	        |t               sJ t        |d      sJ t        |j                        dk(  sJ t	        |j                  d   t              sJ |j                  d   | j                  k(  sJ t	        |j                  d   t              sJ |j                  d   | j                  k(  sJ t        |d      sJ t	        |j                  t              sJ |j                  | j                  k(  sJ y )Nr)   r*   r   r+   geometry)r   r&   r'   r   r,   r-   r.   r)   r   r   r   rR   s     r   r5   z*TestWrappingPathway.test_valid_constructory  s   "477DGGT]]C(O444x///8''(A---(..q15999##A&$''111(..q15999##A&$''111x,,,(++-ABBB  DMM111r%   r)   r&   r'   r6   c                     t        j                  t              5  t        g || j                   }d d d        y # 1 sw Y   y xY wr   )r8   r9   r@   r   r   )r#   r)   r<   s      r   r   zITestWrappingPathway.test_invalid_constructor_attachments_incorrect_number  s;     ]]9% 	=<<dmm<A	= 	= 	=s	   ;ANc                 p    t        j                  t              5  t        |  }d d d        y # 1 sw Y   y xY wr   r   r;   s     r   r   zBTestWrappingPathway.test_invalid_constructor_attachments_not_point  s/     ]]9% 	.-A	. 	. 	.r>   c                     t        j                  t              5  t        | j                  | j
                        }d d d        y # 1 sw Y   y xY wr   r8   r9   r@   r   r&   r'   )r#   r<   s     r   1test_invalid_constructor_geometry_is_not_suppliedzETestWrappingPathway.test_invalid_constructor_geometry_is_not_supplied  s7    ]]9% 	21A	2 	2 	2s   !AAr   r   r   rE   c                     t        j                  t              5  t        | j                  | j
                  |      }d d d        y # 1 sw Y   y xY wr   r   )r#   r   r<   s      r   "test_invalid_geometry_not_geometryz6TestWrappingPathway.test_invalid_geometry_not_geometry  s;     ]]9% 	<(;A	< 	< 	<s   "AAc                 H   t        j                  t              5  | j                  | j                  j
                  d<   d d d        t        j                  t              5  | j                  | j                  j
                  d<   d d d        y # 1 sw Y   OxY w# 1 sw Y   y xY wrP   )r8   r9   r@   r'   rJ   r)   r&   r"   s    r   &test_attachments_property_is_immutablez:TestWrappingPathway.test_attachments_property_is_immutable  sy    ]]9% 	2*.''DLL$$Q'	2]]9% 	2*.''DLL$$Q'	2 	2	2 	2	2 	2s   $B$BBB!c                     t        j                  t              5  d | j                  _        d d d        y # 1 sw Y   y xY wr   )r8   r9   rQ   rJ   r   r"   s    r   #test_geometry_property_is_immutablez7TestWrappingPathway.test_geometry_property_is_immutable  s/    ]]>* 	)$(DLL!	) 	) 	)s   5>c                 X    d| j                   d}t        | j                        |k(  sJ y )Nz!WrappingPathway(pA, pB, geometry=))r   rU   rJ   re   s     r   rX   zTestWrappingPathway.test_repr  s6    (+ 	 DLL!X---r%   c                 :    t        d t        | |      D              S )Nc              3   ,   K   | ]  \  }}||z    y wr   r   r   magunits      r   	<genexpr>z9TestWrappingPathway._expand_pos_to_vec.<locals>.<genexpr>  s     ?d3t8?   )sumzip)posframes     r   _expand_pos_to_vecz&TestWrappingPathway._expand_pos_to_vec  s    ?s3???r%   zpA_vec, pB_vec, factorr+   r   r   r   r+   r   r*   r   r   ro   r+   c                    | j                  || j                        }| j                  || j                        }| j                  j                  | j                  | j
                  |z         | j                  j                  | j                  | j
                  |z         t        | j                  | j                  | j                        }|| j
                  z  }t        |j                  |z
        dk(  sJ y r   )r   rE   r&   r[   r   r   r'   r   r   r   r]   r#   pA_vecpB_vecfactorrJ   rW   s         r   $test_static_pathway_on_sphere_lengthz8TestWrappingPathway.test_static_pathway_on_sphere_length  s     ((8((8//!$''477DKK@$&&=12a777r%   r   r   r   r   c                    | j                  || j                        }| j                  || j                        }| j                  j                  | j                  | j
                  |z         | j                  j                  | j                  | j
                  |z         t        | j                  | j                  | j                        }|t        | j
                  dz        z  }t        |j                  |z
        dk(  sJ y r`   )r   rE   r&   r[   r   r   r'   r   r   r   r   r]   r   s         r   &test_static_pathway_on_cylinder_lengthz:TestWrappingPathway.test_static_pathway_on_cylinder_length  s    * ((8((8//!$''477DMMB$tvvqy/)12a777r%   zpA_vec, pB_vec)r   r   c                    | j                  || j                        }| j                  || j                        }| j                  j                  | j                  | j
                  |z         | j                  j                  | j                  | j
                  |z         t        | j                  | j                  | j                        }|j                  dk(  sJ y r   )
r   rE   r&   r[   r   r   r'   r   r   ra   r#   r   r   rJ   s       r   0test_static_pathway_on_sphere_extension_velocityzDTestWrappingPathway.test_static_pathway_on_sphere_extension_velocity  s     ((8((8//!$''477DKK@))Q...r%   )r   r   )r   r   c                    | j                  || j                        }| j                  || j                        }| j                  j                  | j                  | j
                  |z         | j                  j                  | j                  | j
                  |z         t        | j                  | j                  | j                        }|j                  dk(  sJ y r   )
r   rE   r&   r[   r   r   r'   r   r   ra   r   s       r   2test_static_pathway_on_cylinder_extension_velocityzFTestWrappingPathway.test_static_pathway_on_cylinder_extension_velocity  s     ((8((8//!$''477DMMB))Q...r%   zApA_vec, pB_vec, pA_vec_expected, pB_vec_expected, pO_vec_expected)r   r   r   r   )r   r   r   r   c                    | j                  || j                        }| j                  || j                        }| j                  j                  | j                  | j
                  |z         | j                  j                  | j                  | j
                  |z         t        | j                  | j                  | j                        }t        d t        || j                        D              }t        d t        || j                        D              }t        d t        || j                        D              }t        | j                  | j                  | j
                  dz  t        | j
                  dz        z  z  |z        t        | j                  | j                  | j
                  dz  t        | j
                  dz        z  z  |z        t        | j                  | j                  | j
                  dz  t        | j
                  dz        z  z  |z        g}|j                  | j                        |k(  sJ y )Nc              3   ,   K   | ]  \  }}||z    y wr   r   r   s      r   r   zMTestWrappingPathway.test_static_pathway_on_sphere_to_loads.<locals>.<genexpr>7        
$#tCH
r   c              3   ,   K   | ]  \  }}||z    y wr   r   r   s      r   r   zMTestWrappingPathway.test_static_pathway_on_sphere_to_loads.<locals>.<genexpr>:  r   r   c              3   ,   K   | ]  \  }}||z    y wr   r   r   s      r   r   zMTestWrappingPathway.test_static_pathway_on_sphere_to_loads.<locals>.<genexpr>=  r   r   r   r   )r   rE   r&   r[   r   r   r'   r   r   r   r   r	   rI   r   rd   )r#   r   r   pA_vec_expectedpB_vec_expectedpO_vec_expectedrJ   rW   s           r   &test_static_pathway_on_sphere_to_loadsz:TestWrappingPathway.test_static_pathway_on_sphere_to_loads  s   8 ((8((8//!$''477DKK@ 
(+OTVV(D
 
  
(+OTVV(D
 
  
(+OTVV(D
 
 $''46646619T$&&!)_#<=oMN$''46646619T$&&!)_#<=oMN$''46646619T$&&!)_#<=oMN

 '8333r%   )r   r   r   r   )r   r   )r   r   r   r   r   r   )r   r*   r   )r   )r   r+   r+   )r   r   r+   )r   r   r   )r   r   r         c                 `   | j                  || j                        }| j                  || j                        }| j                  j                  | j                  | j
                  |z         | j                  j                  | j                  | j
                  |z         t        | j                  | j                  | j                        }| j                  | j                  || j                        z  }| j                  | j                  || j                        z  }| j                  | j                  || j                        z  }	t        | j                  |      t        | j                  |      t        | j                  |	      g}
t        |j                  | j                              |
k(  sJ y r   )r   rE   r&   r[   r   r   r'   r   r   rI   r	   r   rd   )r#   r   r   r   r   r   rJ   pA_force_expectedpB_force_expectedpO_force_expectedrW   s              r   (test_static_pathway_on_cylinder_to_loadsz<TestWrappingPathway.test_static_pathway_on_cylinder_to_loadsG  sV   j ((8((8//!$''477DMMB FF4#:#:?;?66$C C FF4#:#:?;?66$C C FF4#:#:?;?66$C C $'',-$'',-$'',-

 w//78HDDDr%   c                     t        d      }| j                  | j                  j                  z  }| j                  t	        |      | j                  j                  z  t        |      | j                  j                  z  z   z  }| j                  j                  | j                  |       | j                  j                  | j                  |       | j                  t        |dz        z  }t        | j                  j                  |z
        dk(  sJ y )Nr   r*   r   )r   r   rE   r\   r   r   rp   r&   r[   r   r'   r   r   rJ   r]   )r#   r   pA_pospB_posrW   s        r   "test_2D_pathway_on_cylinder_lengthz6TestWrappingPathway.test_2D_pathway_on_cylinder_length  s    3Q3q6$&&((?:;((66$q!t*$++h671<<<r%   c                 D   t        d      }t        dd      }| j                  | j                  j                  z  }| j                  t	        |      | j                  j                  z  t        |      | j                  j                  z  z   z  }| j                  j                  | j                  |       | j                  j                  | j                  |       | j                  t        |dz        |z  z  |z  }t        | j                  j                  |z
        dk(  sJ y )Nr   r+   r*   r   )r   r   rE   r\   r   r   rp   r&   r[   r   r'   r   r   rJ   ra   )r#   r   r   r   r   rW   s         r   .test_2D_pathway_on_cylinder_extension_velocityzBTestWrappingPathway.test_2D_pathway_on_cylinder_extension_velocity  s    3C#Q3q6$&&((?:;((6641:a<(+77(BCqHHHr%   c                    t        d      }| j                  | j                  j                  z  }| j                  t	        |      | j                  j                  z  t        |      | j                  j                  z  z   z  }| j                  j                  | j                  |       | j                  j                  | j                  |       | j                  | j                  j                  z  }| j                  t        |      | j                  j                  z  t	        |      | j                  j                  z  z
  z  }| j                  t        |       | j                  j                  z  t	        |      dz
  | j                  j                  z  z   z  }t        | j                  |      t        | j                  |      t        | j                  |      g}t        | j                  j                  | j                              }||k(  sJ y )Nr   r+   )r   r   rE   r\   r   r   rp   r&   r[   r   r'   rI   r	   r   rJ   rd   )	r#   r   r   r   pA_forcepB_forcerv   rW   r   s	            r   $test_2D_pathway_on_cylinder_to_loadsz8TestWrappingPathway.test_2D_pathway_on_cylinder_to_loads  sa   3Q3q6$&&((?:;((66$&&((?663q6$&&((?SVDFFHH_<=66CF746688+s1vz46688.CCD$''8$$''8$$''8$
   5 5dff =>   r%   )$ry   rz   r{   r$   r8   r   r   r5   r}   r~   r   r   r|   r   r   r   r   r   r\   r   r   r   rX   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r%   r   r   r   g  s   8 V^^D!
 "
2 [[4[O4[%+uT{3	
== [[5;4[$	
. .2 [[3K333!!		
<<2). @ @ [[ 	2a4(aT!WHQJ2AbDF;!QaA61=	
88 [[ 	8Aq>"#45
B'B'aT!WHQJ2AbDF;!QaA61=a!Q'$q'(1a.)@!DQ(1a.+a//0 !Qa!Q!7;Q(1a.+a//0	
(8)(8 [["a!Q/$q'(1a.1H!LM!Qa!Q)?CD	
// [["##aT!WHQJ23!QaA67a!Q/$q'!Q?@!QaA67	
// [[KEaT!WHQJ*aDGAIq)d1gai$q'!Q/ !QaA.aXa^OQ/q'!Xa^a/3	
(4)(4< [[KEEFaT!WHQJ*q'!d1gXaZ+T!WQYQ	1- !QaA.aXa^OQ/q'!Xa^a/3 aDGAIq)aT!WHQJ*q'!T!WQY]A. EaT!WHQJ*BtBBEM**Aqb2b!e8m1D/DEtAwJrM1T"r"a%x-%8#89tAwJrM1T"r"a%x-%8#89tBBEM** tAw{OB&$rBr1uH}*=(=>d1gIbL!DbQh$7"785)	
,ZE[,ZE6=I!r%   r   )__doc__r8   sympyr   r   r   r   r   r   sympy.physics.mechanicsr	   r
   r   r   r   r   r   r   r   r   r   sympy.simplify.simplifyr   r   r   r   r   r   r%   r   <module>r      s[    B      -X9 X9veE eEPL! L!r%   