+
    i                         R t ^ RI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 tR t]P                   ! R4      R 4       tR tR tR tR# )z,
Various transforms used for by the 3D code
N)_apic           	        W,
          pW2,
          pWT,
          p	Ve   Vw  rpWz,          pW,          pW,          p	\         P                  ! ^V,          ^ ^ V ) V,          .^ ^V,          ^ V) V,          .^ ^ ^V	,          V) V	,          .. RO.4      # )z
Produce a matrix that scales homogeneous coords in the specified ranges
to [0, 1], or [0, pb_aspect[i]] if the plotbox aspect ratio is specified.
)    r   r      nparray)xminxmaxyminymaxzminzmax	pb_aspectdxdydzaxayazs   &&&&&&&      {/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/mpl_toolkits/mplot3d/proj3d.pyworld_transformationr   
   s     
B	B	B



88adqQb1AbDQb1q!B$b113 4 4    c                   V \         P                  P                  V 4      ,          w  r#p\         P                  ! V4      p\         P                  ! V4      p^\         P                  ! V^,          4      ^,          ,          p\         P
                  ! Wr,          V,          V,           Wr,          V,          WE,          ,
          Wr,          V,          W5,          ,           .Ws,          V,          WE,          ,           Ws,          V,          V,           Ws,          V,          W%,          ,
          .Wt,          V,          W5,          ,
          Wt,          V,          W%,          ,           Wt,          V,          V,           ..4      pV# )zC
Produce a rotation matrix for an angle in radians about a vector.
)r   linalgnormsincosr   )	vanglevxvyvzsctRs	   &&       r   _rotation_about_vectorr'       s     RYY^^A&&JBB
uA
uA	"&&q/1
A
	
b1b24b248	
b24b1b248	
b24b24b157 	8A
 Hr   c                   W,
          pV\         P                  P                  V4      ,          p\         P                  ! W$4      pV\         P                  P                  V4      ,          p\         P                  ! WE4      pV^ 8w  d9   \	        WC) 4      p\         P
                  ! Wu4      p\         P
                  ! Wv4      pWVV3# )aO  
Get the unit viewing axes in data coordinates.

Parameters
----------
E : 3-element numpy array
    The coordinates of the eye/camera.
R : 3-element numpy array
    The coordinates of the center of the view box.
V : 3-element numpy array
    Unit vector in the direction of the vertical axis.
roll : float
    The roll angle in radians.

Returns
-------
u : 3-element numpy array
    Unit vector pointing towards the right of the screen.
v : 3-element numpy array
    Unit vector pointing towards the top of the screen.
w : 3-element numpy array
    Unit vector pointing out of the screen.
)r   r   r   crossr'   dot)Er&   Vrollwur   Rrolls   &&&&    r   
_view_axesr1   1   s    0 
A	"))..
A
A	"))..
A
A qy&q%0FF5FF57Nr   c                    \         P                  ! ^4      p\         P                  ! ^4      pWV.VR&   V) VR&   \         P                  ! WE4      pV# )al  
Return the view transformation matrix.

Parameters
----------
u : 3-element numpy array
    Unit vector pointing towards the right of the screen.
v : 3-element numpy array
    Unit vector pointing towards the top of the screen.
w : 3-element numpy array
    Unit vector pointing out of the screen.
E : 3-element numpy array
    The coordinates of the eye/camera.
)N   Nr3   )r3   )r   eyer*   )r/   r   r.   r+   MrMtMs   &&&&   r   _view_transformation_uvwr:   X   sH     
B	BBvJBvJ
rAHr   c                     Tp^pW,           W,
          ,          pRW,          ,          W,
          ,          p\         P                  ! V^ ^ ^ .^ W4,          ^ ^ .^ ^ WV.. RO.4      pV# )r   )r   r   r5   r   r   )zfrontzbackfocal_lengtheabr$   proj_matrixs   &&&     r   _persp_transformationrD   o   sk    A	A	%A
FL6<(A((Q!aOaO!aO+- .K r   c           	      p    W,           ) pW,
          ) p\         P                  ! . RO. RO. RO^ ^ W#..4      pV# )   )rF   r   r   r   )r   rF   r   r   )r   r   r<   r   r   )r=   r>   rA   rB   rC   s   &&   r   _ortho_transformationrG   {   sB    
.A
.A((M))AM+ ,K r   c                    \         P                  ! WP                  4      pV^,          pV^ ,          V,          V^,          V,          V^,          V,          rep\         P                  P	                  V ^ ,          4      '       d2   \         P                  P                  W@^ ,          P                  R7      p\         P                  P	                  V ^,          4      '       d2   \         P                  P                  WP^,          P                  R7      p\         P                  P	                  V ^,          4      '       d2   \         P                  P                  W`^,          P                  R7      pWEV3# )r4   )mask)r   r*   datamaisMAr   rI   )vecr9   vecwr.   txstystzss   &&     r   _proj_transform_vecrR      s    66!XXDQAGAItAwqy$q'!)cC	uuzz#a&eekk#FKKk0	uuzz#a&eekk#FKKk0	uuzz#a&eekk#FKKk0S=r   c                    \         P                  ! WP                  4      pV^,          pV^ ,          V,          V^,          V,          V^,          V,          rvp\         P                  ! V4      '       d(   \         P                  ! VP
                  \        R7      pM-RV8*  V^8*  ,          RV8*  ,          V^8*  ,          V^ 8*  ,          p\         P                  P                  V ^ ,          4      '       d   W^ ,          P                  ( ,          p\         P                  P                  V ^,          4      '       d   W^,          P                  ( ,          p\         P                  P                  V ^,          4      '       d   W^,          P                  ( ,          p\         P                  P                  WX( 4      p\         P                  P                  Wh( 4      p\         P                  P                  Wx( 4      pWVWx3# )r4   )dtyper5   )r   r*   rJ   isinfonesshapeboolrK   rL   rI   masked_array)	rM   r9   r?   rN   r.   rO   rP   rQ   tiss	   &&&      r   _proj_transform_vec_clipr[      sX   66!XXDQAGaKa1d1gkcC	xxggciit,SySAX&")4qASAXN	uuzz#a&V[[L 	uuzz#a&V[[L 	uuzz#a&V[[L 
%%

S$
'C
%%

S$
'C
%%

S$
'CSr   c                |   \        WV4      p\        P                  ! W44      pVP                  R8X  d   VP	                  R4      p\        VP                  ^,          4       F?  pV^,          V,          ^ 8w  g   K  VRV3,          V^,          V,          ,          VRV3&   KA  	  V^ ,          V^,          V^,          3# )zG
Transform the points by the inverse of the projection matrix, *invM*.
NNN)   )r^   r   )_vec_pad_onesr   r*   rW   reshaperange)xsyszsinvMrM   vecris   &&&&   r   inv_transformrh      s     
#C66$DzzT||F#4::a=!71:?add1gaj0DAJ " 7DGT!W$$r   c                    \         P                  P                  V 4      '       gK   \         P                  P                  V4      '       g&   \         P                  P                  V4      '       d7   \         P                  P                  WV\         P                  ! V 4      .4      # \         P                  ! WV\         P                  ! V 4      .4      # N)r   rK   rL   r   	ones_like)rb   rc   rd   s   &&&r   r_   r_      su    	uuzz"~~B255::b>>uu{{BBR(89::xxR\\"%5677r   c                0    \        WV4      p\        WC4      # )z4
Transform the points by the projection matrix *M*.
)r_   rR   )rb   rc   rd   r9   rM   s   &&&& r   proj_transformrm      s     
#Cs&&r   z3.10c                 :    \        WW#\        P                  R 7      # ))r?   )_proj_transform_clipr   inf)rb   rc   rd   r9   s   &&&&r   proj_transform_cliprq      s    BFFCCr   c                2    \        WV4      p\        WSV4      # )zi
Transform the points by the projection matrix
and return the clipping result
returns txs, tys, tzs, tis
)r_   r[   )rb   rc   rd   r9   r?   rM   s   &&&&& r   ro   ro      s     
#C#CL99r   c                 @    \         P                  ! \        W4      4      # rj   )r   column_stack_proj_trans_points)pointsr9   s   &&r   _proj_pointsrw      s    ??-f899r   c                 z    \         P                  ! V 4      p V R,          V R,          V R,          rCp\        W#WA4      # )r]   )r]   r   )r]   r   )r]   rF   )r   
asanyarrayrm   )rv   r9   rb   rc   rd   s   &&   r   ru   ru      s4    ]]6"Fvd|VD\BB""((r   rj   )__doc__numpyr   
matplotlibr   r   r'   r1   r:   rD   rG   rR   r[   rh   r_   rm   
deprecatedrq   ro   rw   ru    r   r   <module>r      sx     4,"$N.	
*%8' D D::)r   