jsci.physics
Class RigidBody3D
- java.lang.Object
-
- jsci.physics.Particle
-
- jsci.physics.AbstractClassicalParticle
-
- jsci.physics.ClassicalParticle3D
-
- jsci.physics.RigidBody3D
-
- All Implemented Interfaces:
- java.io.Serializable
public class RigidBody3D extends ClassicalParticle3D
The RigidBody3D class provides an object for encapsulating rigid bodies that live in 3D.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description RigidBody3D()Constructs a rigid body.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description RigidBody3DangularAccelerate(double ax, double ay, double az, double dt)Accelerates this particle.RigidBody3DapplyForce(double fx, double fy, double fz, double x, double y, double z, double dt)Applies a force acting at a point away from the centre of mass.RigidBody3DapplyTorque(double tx, double ty, double tz, double dt)Applies a torque to this particle.doubleenergy()Returns the kinetic and rotational energy.doublegetMomentOfInertia()Returns the moment of inertia.doublegetXAngle()Returns the x-axis angle of this body.doublegetXAngularMomentum()doublegetXAngularVelocity()doublegetYAngle()Returns the y-axis angle of this body.doublegetYAngularMomentum()doublegetYAngularVelocity()doublegetZAngle()Returns the z-axis angle of this body.doublegetZAngularMomentum()doublegetZAngularVelocity()ClassicalParticle3Dmove(double dt)Evolves this particle forward according to its kinematics.RigidBody3Drotate(double dt)Evolves this particle forward according to its rotational kinematics.voidsetAngles(double angleX, double angleY, double angleZ)Sets the angles (orientation) of this body.voidsetAngularMomentum(double angleXMom, double angleYMom, double angleZMom)voidsetAngularVelocity(double angleXVel, double angleYVel, double angleZVel)voidsetMomentOfInertia(double MoI)Sets the moment of inertia.-
Methods inherited from class jsci.physics.ClassicalParticle3D
accelerate, applyForce, getMass, getMomentum, getPosition, getVelocity, getXMomentum, getXPosition, getXVelocity, getYMomentum, getYPosition, getYVelocity, getZMomentum, getZPosition, getZVelocity, gravitate, setMass, setMomentum, setPosition, setVelocity, setXPosition, setYPosition, setZPosition, speed, translate
-
-
-
-
Method Detail
-
setMomentOfInertia
public void setMomentOfInertia(double MoI)
Sets the moment of inertia.
-
getMomentOfInertia
public double getMomentOfInertia()
Returns the moment of inertia.
-
setAngles
public void setAngles(double angleX, double angleY, double angleZ)Sets the angles (orientation) of this body.- Parameters:
angleX- an angle in radians.angleY- an angle in radians.angleZ- an angle in radians.
-
getXAngle
public double getXAngle()
Returns the x-axis angle of this body.- Returns:
- an angle in radians.
-
getYAngle
public double getYAngle()
Returns the y-axis angle of this body.- Returns:
- an angle in radians.
-
getZAngle
public double getZAngle()
Returns the z-axis angle of this body.- Returns:
- an angle in radians.
-
setAngularVelocity
public void setAngularVelocity(double angleXVel, double angleYVel, double angleZVel)
-
getXAngularVelocity
public double getXAngularVelocity()
-
getYAngularVelocity
public double getYAngularVelocity()
-
getZAngularVelocity
public double getZAngularVelocity()
-
setAngularMomentum
public void setAngularMomentum(double angleXMom, double angleYMom, double angleZMom)
-
getXAngularMomentum
public double getXAngularMomentum()
-
getYAngularMomentum
public double getYAngularMomentum()
-
getZAngularMomentum
public double getZAngularMomentum()
-
energy
public double energy()
Returns the kinetic and rotational energy.- Overrides:
energyin classClassicalParticle3D
-
move
public ClassicalParticle3D move(double dt)
Evolves this particle forward according to its kinematics. This method changes the particle's position and orientation.- Overrides:
movein classClassicalParticle3D- Returns:
- this.
-
rotate
public RigidBody3D rotate(double dt)
Evolves this particle forward according to its rotational kinematics. This method changes the particle's orientation.- Returns:
- this.
-
angularAccelerate
public RigidBody3D angularAccelerate(double ax, double ay, double az, double dt)
Accelerates this particle. This method changes the particle's angular velocity. It is additive, that isangularAccelerate(a1, dt).angularAccelerate(a2, dt)is equivalent toangularAccelerate(a1+a2, dt).- Returns:
- this.
-
applyTorque
public RigidBody3D applyTorque(double tx, double ty, double tz, double dt)
Applies a torque to this particle. This method changes the particle's angular velocity. It is additive, that isapplyTorque(T1, dt).applyTorque(T2, dt)is equivalent toapplyTorque(T1+T2, dt).- Returns:
- this.
-
applyForce
public RigidBody3D applyForce(double fx, double fy, double fz, double x, double y, double z, 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.z- z-coordinate from centre of mass.- Returns:
- this.
-
-
DMelt 3.0 © DataMelt by jWork.ORG