o
    oh	                     @   sF   d dl mZmZ d dlmZmZ d dlmZ dgZG dd deZ	dS )    )ABCabstractmethod)Symbolsympify)PointBodyBasec                   @   s   e Zd ZdZdddZdd Zdd Zed	d
 Zedd Z	e	j
dd Z	edd Zej
dd Zedd Zej
dd Zedd Zedd Zedd Zedd ZdS )r   z%Abstract class for body type objects.Nc                 C   s`   t |ts	td|| _|d u rt| d}|d u r"t| d}|| _|| _d| _g | _	d S )NzSupply a valid name._mass_masscenterr   )

isinstancestr	TypeError_namer   r   mass
masscenterpotential_energypoints)selfnamer   r    r   u/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/sympy/physics/mechanics/body_base.py__init__
   s   

zBodyBase.__init__c                 C      | j S N)r   r   r   r   r   __str__   s   zBodyBase.__str__c                 C   s2   | j j dt| j dt| j dt| j dS )N(z, masscenter=z, mass=))	__class____name__reprr   r   r   r   r   r   r   __repr__   s
   zBodyBase.__repr__c                 C   r   )zThe name of the body.)r   r   r   r   r   r          zBodyBase.namec                 C   r   )zThe body's center of mass.)r	   r   r   r   r   r   %   r!   zBodyBase.masscenterc                 C   s   t |ts	td|| _d S )Nz1The body's center of mass must be a Point object.)r
   r   r   r	   )r   pointr   r   r   r   *   s   

c                 C   r   )zThe body's mass.)r   r   r   r   r   r   0   r!   zBodyBase.massc                 C      t || _d S r   )r   r   )r   r   r   r   r   r   5      c                 C   r   )as  The potential energy of the body.

        Examples
        ========

        >>> from sympy.physics.mechanics import Particle, Point
        >>> from sympy import symbols
        >>> m, g, h = symbols('m g h')
        >>> O = Point('O')
        >>> P = Particle('P', O, m)
        >>> P.potential_energy = m * g * h
        >>> P.potential_energy
        g*h*m

        )_potential_energyr   r   r   r   r   9   s   zBodyBase.potential_energyc                 C   r#   r   )r   r%   )r   scalarr   r   r   r   L   r$   c                 C      d S r   r   r   framer   r   r   kinetic_energyP      zBodyBase.kinetic_energyc                 C   r'   r   r   r(   r   r   r   linear_momentumT   r+   zBodyBase.linear_momentumc                 C   r'   r   r   r   r"   r)   r   r   r   angular_momentumX   r+   zBodyBase.angular_momentumc                 C   r'   r   r   r-   r   r   r   parallel_axis\   r+   zBodyBase.parallel_axis)NN)r   
__module____qualname____doc__r   r   r    propertyr   r   setterr   r   r   r*   r,   r.   r/   r   r   r   r   r      s6    










N)
abcr   r   sympyr   r   sympy.physics.vectorr   __all__r   r   r   r   r   <module>   s
    