Ë
    ´2Úi  ã                   óü  — d Z ddlZddlmZ 	 dd„Z ej                  d«      d„ «       Zd„ Zd„ Z	d	„ Z
 ej                  d«      d
„ «       Z ej                  d«      d„ «       Zd„ Z ej                  d«      d„ «       Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z  ej                  dddd¬«      e«      Zd„ Z ej                  d«      d„ «       Zd„ Z ej                  d«      d„ «       Zd„ Z ej                  d«      d„ «       Zy)z,
Various transforms used for by the 3D code
é    N)Ú_apic           	      óÆ   — || z
  }||z
  }||z
  }	|�|\  }
}}||
z  }||z  }|	|z  }	t        j                  d|z  dd|  |z  gdd|z  d| |z  gddd|	z  | |	z  gg d¢g«      S )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   r   r   r   ©ÚnpÚarray)ÚxminÚxmaxÚyminÚymaxÚzminÚzmaxÚ	pb_aspectÚdxÚdyÚdzÚaxÚayÚazs                úR/var/www/html/acx/venv/lib/python3.12/site-packages/mpl_toolkits/mplot3d/proj3d.pyÚworld_transformationr   
   s¥   € ð 
�‰€BØ	�‰€BØ	�‰€BØÐØ‰
ˆˆB�Ø
ˆb‰ˆØ
ˆb‰ˆØ
ˆb‰ˆä�8‰8�a˜‘d˜A !¨¨¨b©Ð1Ø˜A˜b™D !¨¨¨b©Ð1Ø˜A ! B¡$¨¨¨b©Ð1Ú*ð,ó -ð -ó    z3.8c                 ó   — t        | |«      S )úK
    Produce a rotation matrix for an angle in radians about a vector.
    )Ú_rotation_about_vector)ÚvÚangles     r   Úrotation_about_vectorr       s   € ô
 " ! UÓ+Ð+r   c                 óê  — | t         j                  j                  | «      z  \  }}}t        j                  |«      }t        j                  |«      }dt        j                  |dz  «      dz  z  }t        j
                  ||z  |z  |z   ||z  |z  ||z  z
  ||z  |z  ||z  z   g||z  |z  ||z  z   ||z  |z  |z   ||z  |z  ||z  z
  g||z  |z  ||z  z
  ||z  |z  ||z  z   ||z  |z  |z   gg«      }|S )r   é   )r   ÚlinalgÚnormÚsinÚcosr	   )	r   r   ÚvxÚvyÚvzÚsÚcÚtÚRs	            r   r   r   (   s  € ð ”R—Y‘Y—^‘^ AÓ&Ñ&�J€BˆˆBÜ
�‰ˆu‹€AÜ
�‰ˆu‹€AØ	Œ"�&‰&��q‘‹/˜1Ñ
Ñ€Aä
�‰Ø	
ˆ2‰ˆb‰�1‰˜˜2™˜b™ 2 a¡4™¨¨2©¨b©°2°a±4©Ð8Ø	
ˆ2‰ˆb‰�2�a‘4‰˜˜2™˜b™ 1™¨¨2©¨b©°2°a±4©Ð8Ø	
ˆ2‰ˆb‰�2�a‘4‰˜˜2™˜b™ 2 a¡4™¨¨2©¨b©°1©Ð5ð7ó 	8€Að
 €Hr   c                 ór  — | |z
  }|t         j                  j                  |«      z  }t        j                  ||«      }|t         j                  j                  |«      z  }t        j                  ||«      }|dk7  r9t	        || «      }t        j
                  ||«      }t        j
                  ||«      }|||fS )aŸ  
    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"   r#   Úcrossr   Údot)ÚEr,   ÚVÚrollÚwÚur   ÚRrolls           r   Ú
_view_axesr6   9   s›   € ð0 
ˆQ‰€AØ	Œ"�)‰)�.‰.˜Ó
Ñ€AÜ
�‰��A‹€AØ	Œ"�)‰)�.‰.˜Ó
Ñ€AÜ
�‰��A‹€Að ˆq‚yä& q¨4¨%Ó0ˆÜ�F‰F�5˜!ÓˆÜ�F‰F�5˜!ÓˆØˆa�ˆ7€Nr   c                 ó¶   — t        j                  d«      }t        j                  d«      }| ||g|dd…dd…f<   | |dd…df<   t        j                  ||«      }|S )aœ  
    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é   éÿÿÿÿ)r   Úeyer/   )r4   r   r3   r0   ÚMrÚMtÚMs          r   Ú_view_transformation_uvwr?   `   s`   € ô 
�‰�‹€BÜ	�‰�‹€BØ�Q˜�€B€rˆ€rˆ2ˆAˆ2€v�JØ�€B€rˆ€rˆ2€v�JÜ
�‰ˆr�2‹€AØ€Hr   c                 óF   — t        | |||«      \  }}}t        |||| «      }|S )az  
    Return the view transformation matrix.

    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.
    )r6   r?   )r0   r,   r1   r2   r4   r   r3   r>   s           r   Úview_transformationrA   w   s/   € ô  ˜˜A˜q $Ó'�G€A€qˆ!Ü   A q¨!Ó,€AØ€Hr   c                 ó   — t        | ||«      S ©N)Ú_persp_transformation)ÚzfrontÚzbackÚfocal_lengths      r   Úpersp_transformationrH   Œ   s   € ä  ¨°Ó=Ð=r   c                 ó”   — |}d}| |z   | |z
  z  }d| |z  z  | |z
  z  }t        j                  |dddgd||z  ddgdd||gg d¢g«      }|S )Nr   éþÿÿÿr   )r   r   r:   r   r   )rE   rF   rG   ÚeÚaÚbr*   Úproj_matrixs           r   rD   rD   ‘   sw   € Ø€AØ	€AØ	�‰˜˜u™Ñ%€AØ
ˆF�5‰LÑ˜6 %™<Ñ(€AÜ—(‘(˜Q ! a¨˜OØ  !¡ a¨˜OØ ! a¨˜OÚ+ð-ó .€Kð Ðr   c                 ó   — t        | |«      S rC   )Ú_ortho_transformation)rE   rF   s     r   Úortho_transformationrQ   �   s   € ä  ¨Ó/Ð/r   c           	      ód   — | |z    }| |z
   }t        j                  g d¢g d¢g d¢dd||gg«      }|S )N)r!   r   r   r   )r   r!   r   r   )r   r   rJ   r   r   r   )rE   rF   rL   rM   rN   s        r   rP   rP   ¢   sH   € à
�5‰.Ð€AØ
�5‰.Ð€AÜ—(‘(šMÚ)Ú)Ø  A q˜Mð+ó ,€Kð Ðr   c                 ór   — t        j                  || «      }|d   }|d   |z  |d   |z  |d   |z  }}}|||fS ©Nr9   r   r   r!   )r   r/   )Úvecr>   Úvecwr3   ÚtxsÚtysÚtzss          r   Ú_proj_transform_vecrZ   ­   sK   € Ü�6‰6�!�S‹>€DØˆQ‰€Aà˜‘G˜A‘I˜t A™w q™y¨$¨q©'°!©)ˆcˆ€CØ��Sˆ=Ðr   c                 óô   — t        j                  || «      }|d   }|d   |z  |d   |z  |d   |z  }}}d|d   k  |d   dk  z  d|d   k  z  |d   dk  z  }t        j                  |«      r|d   dk  }||||fS rT   )r   r/   Úany)rU   r>   rV   r3   rW   rX   rY   Útiss           r   Ú_proj_transform_vec_clipr^   µ   sš   € Ü�6‰6�!�S‹>€DØˆQ‰€Aà˜‘G˜a‘K  a¡¨1¡¨d°1©g¸©kˆcˆ€CØ��Q‘‰<˜D ™G q™LÑ
)¨Q°$°q±'©\Ñ
:¸dÀ1¹gÈ¹lÑ
K€CÜ	‡v�vˆc„{Ø�1‰g˜‰kˆØ��S˜#ÐÐr   c                 ó(  — t        | ||«      }t        j                  ||«      }|j                  dk(  r|j	                  d«      }t        |j                  d   «      D ]'  }|d   |   dk7  sŒ|dd…|f   |d   |   z  |dd…|f<   Œ) |d   |d   |d   fS )zO
    Transform the points by the inverse of the projection matrix, *invM*.
    )r8   )r8   r   r   r9   r   Nr!   )Ú_vec_pad_onesr   r/   ÚshapeÚreshapeÚrange)ÚxsÚysÚzsÚinvMrU   ÚvecrÚis          r   Úinv_transformrj   À   s¤   € ô ˜˜B Ó
#€CÜ�6‰6�$˜Ó€DØ‡z�z�TÒØ�|‰|˜FÓ#ˆÜ�4—:‘:˜a‘=Ó!ò 1ˆØ�‰7�1‰:˜‹?Øša ˜d™ d¨1¡g¨a¡jÑ0ˆD’�A�ŠJð1ð �‰7�D˜‘G˜T !™WÐ$Ð$r   c                 óZ   — t        j                  | ||t        j                  | «      g«      S rC   )r   r	   Ú	ones_like)rd   re   rf   s      r   r`   r`   Î   s#   € Ü�8‰8�R˜˜R¤§¡¨bÓ!1Ð2Ó3Ð3r   c                 ó4   — t        | ||«      }t        ||«      S )z<
    Transform the points by the projection matrix *M*.
    )r`   rZ   ©rd   re   rf   r>   rU   s        r   Úproj_transformro   Ò   s   € ô ˜˜B Ó
#€CÜ˜s AÓ&Ð&r   ÚfunctionÚ	transformro   )Úobj_typeÚnameÚalternativec                 ó4   — t        | ||«      }t        ||«      S )zy
    Transform the points by the projection matrix
    and return the clipping result
    returns txs, tys, tzs, tis
    )r`   r^   rn   s        r   Úproj_transform_cliprv   ß   s   € ô ˜˜B Ó
#€CÜ# C¨Ó+Ð+r   c                 ó   — t        | |«      S rC   )Ú_proj_points©Úpointsr>   s     r   Úproj_pointsr{   é   s   € ä˜ Ó"Ð"r   c                 ó@   — t        j                  t        | |«      «      S rC   )r   Úcolumn_stackÚ_proj_trans_pointsry   s     r   rx   rx   î   s   € Ü�?‰?Ô-¨f°aÓ8Ó9Ð9r   c                 ó   — t        | |«      S rC   )r~   ry   s     r   Úproj_trans_pointsr€   ò   s   € ä˜f aÓ(Ð(r   c                 ó6   — t        | Ž \  }}}t        ||||«      S rC   )Úzipro   )rz   r>   rd   re   rf   s        r   r~   r~   ÷   s"   € Ü�f��J€BˆˆBÜ˜"˜b " aÓ(Ð(r   c                 óÎ   — t        j                  |«      t        j                  |«      }}t        j                  g d¢d|| dgd||dgg d¢g«      }t        j                  || «      S )N)r   r   r   r   r   r   )r   r%   r$   r	   r/   )r1   ÚalphaÚcosaÚsinaÚM1s        r   Úrot_xrˆ   ü   s_   € ä—‘˜“¤§¡ u£ˆ$€DÜ	�‰’<Ø�t˜d˜U AÐ&Ø�t˜T 1Ð%Úð!ó 
"€Bô �6‰6�"�a‹=Ðr   rC   )Ú__doc__Únumpyr   Ú
matplotlibr   r   Ú
deprecatedr   r   r6   r?   rA   rH   rD   rQ   rP   rZ   r^   rj   r`   ro   rq   rv   r{   rx   r€   r~   rˆ   © r   r   ú<module>rŽ      s]  ðñó å ð
 04ó-ð, €‡��Óñ,ó ð,òò"$òNð. €‡��Óñó ðð( €‡��Óñ>ó ð>ò	ð €‡��Óñ0ó ð0òòòò%ò4ò'ð"ˆOˆD�O‰OØ	�J [Ø ô"à"0ó2€	ò
,ð €‡��Óñ#ó ð#ò:ð €‡��Óñ)ó ð)ò)ð
 €‡��Óñó ñr   