§
    OŠtj  ã            
       óÀ   — d dl mZ d dlmZ d dlmZ d dlmZmZm	Z	 g d¢Z
 G d„ de eddd	g¦  «        ¦  «        Z G d
„ de¦  «        Z G d„ de¦  «        Zd„ Zd„ ZdS )é    )ÚABC)Ú
namedtuple)ÚBodyBase)ÚVectorÚReferenceFrameÚPoint)ÚLoadBaseÚForceÚTorquec                   ó&   — e Zd ZdZd„ Zd„ ZeZeZdS )r	   z2Abstract base class for the various loading types.c                 óV   — t          d| j        j        › d|j        j        › d�¦  «        ‚)Nz$unsupported operand type(s) for +: 'ú' and 'ú'©Ú	TypeErrorÚ	__class__Ú__name__©ÚselfÚothers     ú[/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/physics/mechanics/loads.pyÚ__add__zLoadBase.__add__   óB   € Ýð 8Ø œNÔ3ð8ð 8à!œOÔ4ð8ð 8ð 8ñ 9ô 9ð 	9ó    c                 óV   — t          d| j        j        › d|j        j        › d�¦  «        ‚)Nz$unsupported operand type(s) for *: 'r   r   r   r   s     r   Ú__mul__zLoadBase.__mul__   r   r   N)r   Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__radd__Ú__rmul__© r   r   r	   r	   	   s>   € € € € € Ø<Ð<ð9ð 9ð 9ð
9ð 9ð 9ð
 €HØ€H€H€Hr   r	   ÚlocationÚvectorc                   óT   ‡ — e Zd ZdZˆ fd„Zd„ Zed„ ¦   «         Zed„ ¦   «         Zˆ xZ	S )r
   a+  Force acting upon a point.

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

    A force is a vector that is bound to a line of action. This class stores
    both a point, which lies on the line of action, and the vector. A tuple can
    also be used, with the location as the first entry and the vector as second
    entry.

    Examples
    ========

    A force of magnitude 2 along N.x acting on a point Po can be created as
    follows:

    >>> from sympy.physics.mechanics import Point, ReferenceFrame, Force
    >>> N = ReferenceFrame('N')
    >>> Po = Point('Po')
    >>> Force(Po, 2 * N.x)
    (Po, 2*N.x)

    If a body is supplied, then the center of mass of that body is used.

    >>> from sympy.physics.mechanics import Particle
    >>> P = Particle('P', point=Po)
    >>> Force(P, 2 * N.x)
    (Po, 2*N.x)

    c                 ó  •— t          |t          ¦  «        r|j        }t          |t          ¦  «        st	          d¦  «        ‚t          |t
          ¦  «        st	          d¦  «        ‚t          ¦   «                              | ||¦  «        S )Nz!Force location should be a Point.z Force vector should be a Vector.)Ú
isinstancer   Ú
masscenterr   r   r   ÚsuperÚ__new__)ÚclsÚpointÚforcer   s      €r   r*   zForce.__new__:   s{   ø€ Ý�e�XÑ&Ô&ð 	%ØÔ$ˆEÝ˜%¥Ñ'Ô'ð 	AÝÐ?Ñ@Ô@Ð@Ý˜%¥Ñ(Ô(ð 	@ÝÐ>Ñ?Ô?Ð?Ý‰wŒw�Š˜s E¨5Ñ1Ô1Ð1r   c                 ó@   — | j         j        › d| j        › d| j        › d�S )Nz(point=z, force=ú))r   r   r,   r-   ©r   s    r   Ú__repr__zForce.__repr__C   s;   € Ø”>Ô*ð 'ð '°4´:ð 'ð 'Øœð'ð 'ð 'ð 	(r   c                 ó   — | j         S ©N©r#   r0   s    r   r,   zForce.pointG   ó
   € àŒ}Ðr   c                 ó   — | j         S r3   ©r$   r0   s    r   r-   zForce.forceK   ó
   € àŒ{Ðr   )
r   r   r   r   r*   r1   Úpropertyr,   r-   Ú__classcell__©r   s   @r   r
   r
      s‡   ø€ € € € € ðð ð>2ð 2ð 2ð 2ð 2ð(ð (ð (ð ðð ñ „Xðð ðð ñ „Xðð ð ð ð r   r
   c                   óT   ‡ — e Zd ZdZˆ fd„Zd„ Zed„ ¦   «         Zed„ ¦   «         Zˆ xZ	S )r   a  Torque acting upon a frame.

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

    A torque is a free vector that is acting on a reference frame, which is
    associated with a rigid body. This class stores both the frame and the
    vector. A tuple can also be used, with the location as the first item and
    the vector as second item.

    Examples
    ========

    A torque of magnitude 2 about N.x acting on a frame N can be created as
    follows:

    >>> from sympy.physics.mechanics import ReferenceFrame, Torque
    >>> N = ReferenceFrame('N')
    >>> Torque(N, 2 * N.x)
    (N, 2*N.x)

    If a body is supplied, then the frame fixed to that body is used.

    >>> from sympy.physics.mechanics import RigidBody
    >>> rb = RigidBody('rb', frame=N)
    >>> Torque(rb, 2 * N.x)
    (N, 2*N.x)

    c                 ó  •— t          |t          ¦  «        r|j        }t          |t          ¦  «        st	          d¦  «        ‚t          |t
          ¦  «        st	          d¦  «        ‚t          ¦   «                              | ||¦  «        S )Nz+Torque location should be a ReferenceFrame.z!Torque vector should be a Vector.)r'   r   Úframer   r   r   r)   r*   )r+   r>   Útorquer   s      €r   r*   zTorque.__new__o   sz   ø€ Ý�e�XÑ&Ô&ð 	 Ø”KˆEÝ˜%¥Ñ0Ô0ð 	KÝÐIÑJÔJÐJÝ˜&¥&Ñ)Ô)ð 	AÝÐ?Ñ@Ô@Ð@Ý‰wŒw�Š˜s E¨6Ñ2Ô2Ð2r   c                 ó@   — | j         j        › d| j        › d| j        › d�S )Nz(frame=z	, torque=r/   )r   r   r>   r?   r0   s    r   r1   zTorque.__repr__x   s;   € Ø”>Ô*ð )ð )°4´:ð )ð )Øœ+ð)ð )ð )ð 	*r   c                 ó   — | j         S r3   r4   r0   s    r   r>   zTorque.frame|   r5   r   c                 ó   — | j         S r3   r7   r0   s    r   r?   zTorque.torque€   r8   r   )
r   r   r   r   r*   r1   r9   r>   r?   r:   r;   s   @r   r   r   P   s‡   ø€ € € € € ðð ð<3ð 3ð 3ð 3ð 3ð*ð *ð *ð ðð ñ „Xðð ðð ñ „Xðð ð ð ð r   r   c                 óÜ   — g }|D ]f}t          |t          ¦  «        st          t          |¦  «        › d�¦  «        ‚|                     t          |j        |j        | z  ¦  «        ¦  «         Œg|S )a  
    Returns a list of gravity forces given the acceleration
    due to gravity and any number of particles or rigidbodies.

    Example
    =======

    >>> from sympy.physics.mechanics import ReferenceFrame, Particle, RigidBody
    >>> from sympy.physics.mechanics.loads import gravity
    >>> from sympy import symbols
    >>> N = ReferenceFrame('N')
    >>> g = symbols('g')
    >>> P = Particle('P')
    >>> B = RigidBody('B')
    >>> gravity(g*N.y, P, B)
    [(P_masscenter, P_mass*g*N.y),
     (B_masscenter, B_mass*g*N.y)]

    z is not a body type)r'   r   r   ÚtypeÚappendr
   r(   Úmass)ÚaccelerationÚbodiesÚgravity_forceÚbodys       r   ÚgravityrK   …   sz   € ð* €MØð Oð OˆÝ˜$¥Ñ)Ô)ð 	@Ý�t D™zœzÐ>Ð>Ð>Ñ?Ô?Ð?Ø×Ò�U 4¤?°D´IÀÑ4LÑMÔMÑNÔNÐNÐNØÐr   c                 óô  — t          | t          ¦  «        r| S t          | t          ¦  «        r­t          | ¦  «        dk    rt	          d| › d�¦  «        ‚t          | d         t
          ¦  «        rt          | d         | d         ¦  «        S t          | d         t          ¦  «        rt          | d         | d         ¦  «        S t	          d| d         › d�¦  «        ‚t          dt          | ¦  «        › d	�¦  «        ‚)
zBHelper function to parse loads and convert tuples to load objects.é   zLoad z should have a length of 2.r   é   z'Load not recognized. The load location z. should either be a Point or a ReferenceFrame.z
Load type zA not recognized as a load. It should be a Force, Torque or tuple.)r'   r	   ÚtupleÚlenÚ
ValueErrorr   r
   r   r   r   rD   )Úloads    r   Ú_parse_loadrS   ¢   s  € å�$�Ñ!Ô!ð PØˆÝ	�D�%Ñ	 Ô	 ð 	PÝˆt‰9Œ9˜Š>ˆ>ÝÐF TÐFÐFÐFÑGÔGÐGÝ�d˜1”g�uÑ%Ô%ð 	PÝ˜˜aœ $ q¤'Ñ*Ô*Ð*Ý˜˜Qœ¥Ñ0Ô0ð 	PÝ˜$˜qœ' 4¨¤7Ñ+Ô+Ð+åð OÀtÈAÄwð Oð Oð Oñ Pô Pð På
ð ;¥ d¡¤ð ;ð ;ð ;ñ <ô <ð <r   N)Úabcr   Úcollectionsr   Ú!sympy.physics.mechanics.body_baser   Úsympy.physics.vectorr   r   r   Ú__all__r	   r
   r   rK   rS   r"   r   r   ú<module>rY      s  ðØ Ð Ð Ð Ð Ð Ø "Ð "Ð "Ð "Ð "Ð "Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >à
)Ð
)Ð
)€ðð ð ð ð ˆs�J�J˜z¨J¸Ð+AÑBÔBñ ô ð ð"3ð 3ð 3ð 3ð 3ˆHñ 3ô 3ð 3ðl2ð 2ð 2ð 2ð 2ˆXñ 2ô 2ð 2ðjð ð ð:<ð <ð <ð <ð <r   