§
    OŠtj  ã            	       ó€   — 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dS )é    )Úsympify)ÚPointÚDyadicÚReferenceFrameÚouter)Ú
namedtuple)ÚinertiaÚinertia_of_point_massÚInertiac                 ó  — 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          ú]/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/physics/mechanics/inertia.pyr	   r	      s^  € õJ �e�^Ñ,Ô,ð AÝÐ?Ñ@Ô@Ð@Ý˜C‘L”L¥'¨#¡,¤,µ¸±´ˆcˆ€CÝ˜C‘L”L¥'¨#¡,¤,µ¸±´ˆcˆ€CØ•�e”g˜uœwÑ'Ô'Ñ'¨#­e°E´G¸U¼WÑ.EÔ.EÑ*EÑEØ•�e”g˜uœwÑ'Ô'Ñ'ñ(Ø*-­e°E´G¸U¼WÑ.EÔ.EÑ*EñFà•�e”g˜uœwÑ'Ô'Ñ'ñ(à*-­e°E´G¸U¼WÑ.EÔ.EÑ*EñFð •�e”g˜uœwÑ'Ô'Ñ'ñ(ð +.­e°E´G¸U¼WÑ.EÔ.EÑ*EñFð •�e”g˜uœwÑ'Ô'Ñ'ñ	(ð )ó    c                 óö   — | t          |j        |j        ¦  «        t          |j        |j        ¦  «        z   t          |j        |j        ¦  «        z   |                     |¦  «        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   sx   € ð4 Ý	ˆuŒw˜œÑ	 Ô	 Ý	ˆuŒw˜œÑ	 Ô	 ñ
!å	ˆuŒw˜œÑ	 Ô	 ñ
!ð 
�Š�WÑ	Ô	ñ	õ "' w°Ñ!8Ô!8ñ	9ñ:ð :r   c                   óV   ‡ — 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                 ó6  •— 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Ô)Bð 	*Ø" E�6ˆEÝ˜%¥Ñ'Ô'ð 	GÝÐEÑFÔFÐFÝ˜&¥&Ñ)Ô)ð 	MÝÐKÑLÔLÐLÝ‰wŒw�Š˜s F¨EÑ2Ô2Ð2r   r   c	                 ó@   —  | 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 ˆs•7˜5 # s¨C°°c¸3Ñ?Ô?ÀÑGÔ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__¼   óB   € Ýð 8Ø œNÔ3ð8ð 8à!œOÔ4ð8ð 8ð 8ñ 9ô 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   s“   ø€ € € € € ð ð  ðB €Ið3ð 3ð 3ð 3ð 3ð ØJKØ!"ð2Hð 2Hð 2Hñ „[ð2Hðh9ð 9ð 9ð
9ð 9ð 9ð
 €HØ€H€H€H€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Ð EÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EÐ EØ "Ð "Ð "Ð "Ð "Ð "à
9Ð
9Ð
9€ð-)ð -)ð -)ð -)ð`:ð :ð :ðBnð nð nð nð nˆjˆj˜ X¨wÐ$7Ñ8Ô8ñ nô nð nð nð nr   