Ë
    täia  ã                   ó`   — d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 dgZ G d„ de«      Zy)	é    )ÚS)ÚcrossÚdot)ÚBodyBase)Úinertia_of_point_mass)Úsympy_deprecation_warningÚParticlec                   óZ   ‡ — e Zd ZdZej
                  Zdˆ fd„	Zd„ Zd„ Z	d„ Z
d„ Zd„ Zˆ xZS )	r	   an  A particle.

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

    Particles have a non-zero mass and lack spatial extension; they take up no
    space.

    Values need to be supplied on initialization, but can be changed later.

    Parameters
    ==========

    name : str
        Name of particle
    point : Point
        A physics/mechanics Point which represents the position, velocity, and
        acceleration of this Particle
    mass : Sympifyable
        A SymPy expression representing the Particle's mass
    potential_energy : Sympifyable
        The potential energy of the Particle.

    Examples
    ========

    >>> from sympy.physics.mechanics import Particle, Point
    >>> from sympy import Symbol
    >>> po = Point('po')
    >>> m = Symbol('m')
    >>> pa = Particle('pa', po, m)
    >>> # Or you could change these later
    >>> pa.mass = m
    >>> pa.point = po

    c                 ó(   •— t         ‰| �  |||«       y )N)ÚsuperÚ__init__)ÚselfÚnameÚpointÚmassÚ	__class__s       €úo/Volumes/fast/ai/experiments/MLX_z-image/.venv/lib/python3.12/site-packages/sympy/physics/mechanics/particle.pyr   zParticle.__init__1   s   ø€ Ü‰Ñ˜˜u dÕ+ó    c                 óR   — | j                   | j                  j                  |«      z  S )a¯  Linear momentum of the particle.

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

        The linear momentum L, of a particle P, with respect to frame N is
        given by:

        L = m * v

        where m is the mass of the particle, and v is the velocity of the
        particle in the frame N.

        Parameters
        ==========

        frame : ReferenceFrame
            The frame in which linear momentum is desired.

        Examples
        ========

        >>> from sympy.physics.mechanics import Particle, Point, ReferenceFrame
        >>> from sympy.physics.mechanics import dynamicsymbols
        >>> from sympy.physics.vector import init_vprinting
        >>> init_vprinting(pretty_print=False)
        >>> m, v = dynamicsymbols('m v')
        >>> N = ReferenceFrame('N')
        >>> P = Point('P')
        >>> A = Particle('A', P, m)
        >>> P.set_vel(N, v * N.x)
        >>> A.linear_momentum(N)
        m*v*N.x

        )r   r   Úvel©r   Úframes     r   Úlinear_momentumzParticle.linear_momentum4   s!   € ðJ �y‰y˜4Ÿ:™:Ÿ>™>¨%Ó0Ñ0Ð0r   c                 ó˜   — t        | j                  j                  |«      | j                  | j                  j	                  |«      z  «      S )a¸  Angular momentum of the particle about the point.

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

        The angular momentum H, about some point O of a particle, P, is given
        by:

        ``H = cross(r, m * v)``

        where r is the position vector from point O to the particle P, m is
        the mass of the particle, and v is the velocity of the particle in
        the inertial frame, N.

        Parameters
        ==========

        point : Point
            The point about which angular momentum of the particle is desired.

        frame : ReferenceFrame
            The frame in which angular momentum is desired.

        Examples
        ========

        >>> from sympy.physics.mechanics import Particle, Point, ReferenceFrame
        >>> from sympy.physics.mechanics import dynamicsymbols
        >>> from sympy.physics.vector import init_vprinting
        >>> init_vprinting(pretty_print=False)
        >>> m, v, r = dynamicsymbols('m v r')
        >>> N = ReferenceFrame('N')
        >>> O = Point('O')
        >>> A = O.locatenew('A', r * N.x)
        >>> P = Particle('P', A, m)
        >>> P.point.set_vel(N, v * N.y)
        >>> P.angular_momentum(O, N)
        m*r*v*N.z

        )r   r   Úpos_fromr   r   ©r   r   r   s      r   Úangular_momentumzParticle.angular_momentum[   s<   € ôT �T—Z‘Z×(Ñ(¨Ó/Ø—Y‘Y §¡§¡°Ó!6Ñ6ó8ð 	8r   c                 óº   — t         j                  | j                  z  t        | j                  j                  |«      | j                  j                  |«      «      z  S )a®  Kinetic energy of the particle.

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

        The kinetic energy, T, of a particle, P, is given by:

        ``T = 1/2 (dot(m * v, v))``

        where m is the mass of particle P, and v is the velocity of the
        particle in the supplied ReferenceFrame.

        Parameters
        ==========

        frame : ReferenceFrame
            The Particle's velocity is typically defined with respect to
            an inertial frame but any relevant frame in which the velocity is
            known can be supplied.

        Examples
        ========

        >>> from sympy.physics.mechanics import Particle, Point, ReferenceFrame
        >>> from sympy import symbols
        >>> m, v, r = symbols('m v r')
        >>> N = ReferenceFrame('N')
        >>> O = Point('O')
        >>> P = Particle('P', O, m)
        >>> P.point.set_vel(N, v * N.y)
        >>> P.kinetic_energy(N)
        m*v**2/2

        )r   ÚHalfr   r   r   r   r   s     r   Úkinetic_energyzParticle.kinetic_energyˆ   sE   € ôH �v‰v˜Ÿ	™	Ñ!¤C¨¯
©
¯©°uÓ(=Ø(,¯
©
¯©°uÓ(=ó%?ñ ?ð 	?r   c                 ó.   — t        ddd¬«       || _        y )NzŒ
The sympy.physics.mechanics.Particle.set_potential_energy()
method is deprecated. Instead use

    P.potential_energy = scalar
            z1.5zdeprecated-set-potential-energy)Údeprecated_since_versionÚactive_deprecations_target)r   Úpotential_energy)r   Úscalars     r   Úset_potential_energyzParticle.set_potential_energy¯   s!   € Ü!ðð "'Ø#Dõ		
ð !'ˆÕr   c                 ób   — t        | j                  | j                  j                  |«      |«      S )a  Returns an inertia dyadic of the particle with respect to another
        point and frame.

        Parameters
        ==========

        point : sympy.physics.vector.Point
            The point to express the inertia dyadic about.
        frame : sympy.physics.vector.ReferenceFrame
            The reference frame used to construct the dyadic.

        Returns
        =======

        inertia : sympy.physics.vector.Dyadic
            The inertia dyadic of the particle expressed about the provided
            point and frame.

        )r   r   r   r   r   s      r   Úparallel_axiszParticle.parallel_axis¼   s+   € ô( % T§Y¡Y°·
±
×0CÑ0CÀEÓ0JØ%*ó,ð 	,r   )NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú
masscenterr   r   r   r   r    r&   r(   Ú__classcell__)r   s   @r   r	   r	   
   s7   ø„ ñ#ðH ×Ñ€Eõ,ò%1òN+8òZ%?òN'ö,r   N)Úsympyr   Úsympy.physics.vectorr   r   Ú!sympy.physics.mechanics.body_baser   Úsympy.physics.mechanics.inertiar   Úsympy.utilities.exceptionsr   Ú__all__r	   © r   r   Ú<module>r6      s)   ðÝ ß +Ý 6Ý AÝ @àˆ,€ôG,ˆxõ G,r   