Ë
    täi  ã            	       ór   — d dl mZ d dlmZmZmZmZ d dlmZ g d¢Z	dd„Z
d„ Z G d„ d edd	d
g«      «      Zy)é    )Úsympify)ÚPointÚDyadicÚReferenceFrameÚouter)Ú
namedtuple)ÚinertiaÚinertia_of_point_massÚInertiac                 óB  — t        | t        «      st        d«      ‚t        |«      t        |«      t        |«      }}}t        |«      t        |«      t        |«      }}}|t	        | j
                  | j
                  «      z  |t	        | j
                  | j                  «      z  z   |t	        | j
                  | j                  «      z  z   |t	        | j                  | j
                  «      z  z   |t	        | j                  | j                  «      z  z   |t	        | j                  | j                  «      z  z   |t	        | j                  | j
                  «      z  z   |t	        | j                  | j                  «      z  z   |t	        | j                  | j                  «      z  z   S )a~  Simple way to create inertia Dyadic object.

    Explanation
    ===========

    Creates an inertia Dyadic based on the given tensor values and a body-fixed
    reference frame.

    Parameters
    ==========

    frame : ReferenceFrame
        The frame the inertia is defined in.
    ixx : Sympifyable
        The xx element in the inertia dyadic.
    iyy : Sympifyable
        The yy element in the inertia dyadic.
    izz : Sympifyable
        The zz element in the inertia dyadic.
    ixy : Sympifyable
        The xy element in the inertia dyadic.
    iyz : Sympifyable
        The yz element in the inertia dyadic.
    izx : Sympifyable
        The zx element in the inertia dyadic.

    Examples
    ========

    >>> from sympy.physics.mechanics import ReferenceFrame, inertia
    >>> N = ReferenceFrame('N')
    >>> inertia(N, 1, 2, 3)
    (N.x|N.x) + 2*(N.y|N.y) + 3*(N.z|N.z)

    z%Need to define the inertia in a frame)Ú
isinstancer   Ú	TypeErrorr   r   ÚxÚyÚz)ÚframeÚixxÚiyyÚizzÚixyÚiyzÚizxs          ún/Volumes/fast/ai/experiments/MLX_z-image/.venv/lib/python3.12/site-packages/sympy/physics/mechanics/inertia.pyr	   r	      sO  € ôJ �eœ^Ô,ÜÐ?Ó@Ð@Ü˜C“L¤'¨#£,´¸³ˆcˆ€CÜ˜C“L¤'¨#£,´¸³ˆcˆ€CØ”�e—g‘g˜uŸw™wÓ'Ñ'¨#¬e°E·G±G¸U¿W¹WÓ.EÑ*EÑEØ”�e—g‘g˜uŸw™wÓ'Ñ'ñ(Ø*-¬e°E·G±G¸U¿W¹WÓ.EÑ*EñFà”�e—g‘g˜uŸw™wÓ'Ñ'ñ(à*-¬e°E·G±G¸U¿W¹WÓ.EÑ*EñFð ”�e—g‘g˜uŸw™wÓ'Ñ'ñ(ð +.¬e°E·G±G¸U¿W¹WÓ.EÑ*EñFð ”�e—g‘g˜uŸw™wÓ'Ñ'ñ	(ð )ó    c                 ó
  — | t        |j                  |j                  «      t        |j                  |j                  «      z   t        |j                  |j                  «      z   |j	                  |«      z  t        ||«      z
  z  S )aO  Inertia dyadic of a point mass relative to point O.

    Parameters
    ==========

    mass : Sympifyable
        Mass of the point mass
    pos_vec : Vector
        Position from point O to point mass
    frame : ReferenceFrame
        Reference frame to express the dyadic in

    Examples
    ========

    >>> from sympy import symbols
    >>> from sympy.physics.mechanics import ReferenceFrame, inertia_of_point_mass
    >>> N = ReferenceFrame('N')
    >>> r, m = symbols('r m')
    >>> px = r * N.x
    >>> inertia_of_point_mass(m, px, N)
    m*r**2*(N.y|N.y) + m*r**2*(N.z|N.z)

    )r   r   r   r   Údot)ÚmassÚpos_vecr   s      r   r
   r
   8   su   € ð4 Ü	ˆu�w‰w˜Ÿ™Ó	 Ü	ˆu�w‰w˜Ÿ™Ó	 ñ
!ä	ˆu�w‰w˜Ÿ™Ó	 ñ
!ð 
�‰�WÓ	ñ	ô "' w°Ó!8ñ	9ñ:ð :r   c                   óP   ‡ — e Zd ZdZdZˆ fd„Ze	 	 dd„«       Zd„ Zd„ Z	eZ
e	Zˆ xZS )r   ay  Inertia object consisting of a Dyadic and a Point of reference.

    Explanation
    ===========

    This is a simple class to store the Point and Dyadic, belonging to an
    inertia.

    Attributes
    ==========

    dyadic : Dyadic
        The dyadic of the inertia.
    point : Point
        The reference point of the inertia.

    Examples
    ========

    >>> from sympy.physics.mechanics import ReferenceFrame, Point, Inertia
    >>> N = ReferenceFrame('N')
    >>> Po = Point('Po')
    >>> Inertia(N.x.outer(N.x) + N.y.outer(N.y) + N.z.outer(N.z), Po)
    ((N.x|N.x) + (N.y|N.y) + (N.z|N.z), Po)

    In the example above the Dyadic was created manually, one can however also
    use the ``inertia`` function for this or the class method ``from_tensor`` as
    shown below.

    >>> Inertia.from_inertia_scalars(Po, N, 1, 1, 1)
    ((N.x|N.x) + (N.y|N.y) + (N.z|N.z), Po)

    © c                 óÚ   •— t        |t        «      rt        |t        «      r||}}t        |t        «      st        d«      ‚t        |t        «      st        d«      ‚t        ‰| �  | ||«      S )Nz'Reference point should be of type Pointz-Inertia value should be expressed as a Dyadic)r   r   r   r   ÚsuperÚ__new__)ÚclsÚdyadicÚpointÚ	__class__s      €r   r#   zInertia.__new__}   s^   ø€ ä�fœeÔ$¬°E¼6Ô)BØ" E�6ˆEÜ˜%¤Ô'ÜÐEÓFÐFÜ˜&¤&Ô)ÜÐKÓLÐLÜ‰w‰˜s F¨EÓ2Ð2r   c	                 ó2   —  | t        |||||||«      |«      S )a¾  Simple way to create an Inertia object based on the tensor values.

        Explanation
        ===========

        This class method uses the :func`~.inertia` to create the Dyadic based
        on the tensor values.

        Parameters
        ==========

        point : Point
            The reference point of the inertia.
        frame : ReferenceFrame
            The frame the inertia is defined in.
        ixx : Sympifyable
            The xx element in the inertia dyadic.
        iyy : Sympifyable
            The yy element in the inertia dyadic.
        izz : Sympifyable
            The zz element in the inertia dyadic.
        ixy : Sympifyable
            The xy element in the inertia dyadic.
        iyz : Sympifyable
            The yz element in the inertia dyadic.
        izx : Sympifyable
            The zx element in the inertia dyadic.

        Examples
        ========

        >>> from sympy import symbols
        >>> from sympy.physics.mechanics import ReferenceFrame, Point, Inertia
        >>> ixx, iyy, izz, ixy, iyz, izx = symbols('ixx iyy izz ixy iyz izx')
        >>> N = ReferenceFrame('N')
        >>> P = Point('P')
        >>> I = Inertia.from_inertia_scalars(P, N, ixx, iyy, izz, ixy, iyz, izx)

        The tensor values can easily be seen when converting the dyadic to a
        matrix.

        >>> I.dyadic.to_matrix(N)
        Matrix([
        [ixx, ixy, izx],
        [ixy, iyy, iyz],
        [izx, iyz, izz]])

        )r	   )	r$   r&   r   r   r   r   r   r   r   s	            r   Úfrom_inertia_scalarszInertia.from_inertia_scalars‡   s#   € ñf ”7˜5 # s¨C°°c¸3Ó?ÀÓGÐGr   c                 óv   — t        d| j                  j                  › d|j                  j                  › d�«      ‚)Nz$unsupported operand type(s) for +: 'ú' and 'Ú'©r   r'   Ú__name__©ÚselfÚothers     r   Ú__add__zInertia.__add__¼   ó@   € Üð Ø ŸN™N×3Ñ3Ð4ð 5Ø!ŸO™O×4Ñ4Ð5°Qð8ó 9ð 	9r   c                 óv   — t        d| j                  j                  › d|j                  j                  › d�«      ‚)Nz$unsupported operand type(s) for *: 'r+   r,   r-   r/   s     r   Ú__mul__zInertia.__mul__Á   r3   r   ©r   r   r   )r.   Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r#   Úclassmethodr)   r2   r5   Ú__radd__Ú__rmul__Ú__classcell__)r'   s   @r   r   r   Y   sH   ø„ ñ ðB €Iô3ð ØJKØ!"ò2Hó ð2Hòh9ò
9ð
 €HØ„Hr   r   r%   r&   Nr6   )Úsympyr   Úsympy.physics.vectorr   r   r   r   Úcollectionsr   Ú__all__r	   r
   r   r    r   r   Ú<module>rC      s<   ðÝ ß EÓ EÝ "â
9€ó-)ò`:ôBn‰j˜ X¨wÐ$7Ó8õ nr   