Documentation of 'jsci.physics.RigidBody2D' Java class
RigidBody2D
jsci.physics

Class RigidBody2D

  • All Implemented Interfaces:
    java.io.Serializable


    public class RigidBody2D
    extends ClassicalParticle2D
    The RigidBody2D class provides an object for encapsulating rigid bodies that live in 2D.
    See Also:
    Serialized Form
    • Constructor Detail

      • RigidBody2D

        public RigidBody2D()
        Constructs a rigid body.
    • Method Detail

      • setMomentOfInertia

        public void setMomentOfInertia(double MoI)
        Sets the moment of inertia.
      • getMomentOfInertia

        public double getMomentOfInertia()
        Returns the moment of inertia.
      • setAngle

        public void setAngle(double angle)
        Sets the angle (orientation) of this body.
        Parameters:
        angle - an angle in radians.
      • getAngle

        public double getAngle()
        Returns the angle (orientation) of this body.
        Returns:
        an angle in radians.
      • setAngularVelocity

        public void setAngularVelocity(double angleVel)
        Sets the angular velocity.
      • getAngularVelocity

        public double getAngularVelocity()
        Returns the angular velocity.
      • setAngularMomentum

        public void setAngularMomentum(double angleMom)
      • getAngularMomentum

        public double getAngularMomentum()
      • energy

        public double energy()
        Returns the kinetic and rotational energy.
        Overrides:
        energy in class ClassicalParticle2D
      • move

        public ClassicalParticle2D move(double dt)
        Evolves this particle forward according to its kinematics. This method changes the particle's position and orientation.
        Overrides:
        move in class ClassicalParticle2D
        Returns:
        this.
      • rotate

        public RigidBody2D rotate(double dt)
        Evolves this particle forward according to its rotational kinematics. This method changes the particle's orientation.
        Returns:
        this.
      • angularAccelerate

        public RigidBody2D angularAccelerate(double a,
                                             double dt)
        Accelerates this particle. This method changes the particle's angular velocity. It is additive, that is angularAccelerate(a1, dt).angularAccelerate(a2, dt) is equivalent to angularAccelerate(a1+a2, dt).
        Returns:
        this.
      • applyTorque

        public RigidBody2D applyTorque(double T,
                                       double dt)
        Applies a torque to this particle. This method changes the particle's angular velocity. It is additive, that is applyTorque(T1, dt).applyTorque(T2, dt) is equivalent to applyTorque(T1+T2, dt).
        Returns:
        this.
      • applyForce

        public RigidBody2D applyForce(double fx,
                                      double fy,
                                      double x,
                                      double y,
                                      double dt)
        Applies a force acting at a point away from the centre of mass. Any resultant torques are also applied. This method changes the particle's angular velocity.
        Parameters:
        x - x-coordinate from centre of mass.
        y - y-coordinate from centre of mass.
        Returns:
        this.
      • collide

        public RigidBody2D collide(RigidBody2D p,
                                   double theta,
                                   double e)
        Collides this particle with another. This method calculates the resultant velocities.
        Parameters:
        theta - centre of mass deflection angle.
        e - coefficient of restitution.
        Returns:
        this.
      • angularCollide

        public RigidBody2D angularCollide(RigidBody2D p,
                                          double e)
        Collides this particle with another. This method calculates the resultant angular velocities.
        Parameters:
        e - coefficient of restitution.
        Returns:
        this.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.