JSci.physics
Class ClassicalParticle3D

java.lang.Object
  extended by JSci.physics.Particle
      extended by JSci.physics.AbstractClassicalParticle
          extended by JSci.physics.ClassicalParticle3D
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
RigidBody3D

public class ClassicalParticle3D
extends AbstractClassicalParticle

The ClassicalParticle3D class provides an object for encapsulating classical point particles that live in 3D.

See Also:
Serialized Form

Field Summary
protected  double mass
          Mass.
protected  double vx
          Velocity coordinates.
protected  double vy
          Velocity coordinates.
protected  double vz
          Velocity coordinates.
protected  double x
          Position coordinates.
protected  double y
          Position coordinates.
protected  double z
          Position coordinates.
 
Constructor Summary
ClassicalParticle3D()
          Constructs a classical particle.
 
Method Summary
 ClassicalParticle3D accelerate(double ax, double ay, double az, double dt)
          Accelerates this particle.
 ClassicalParticle3D applyForce(double Fx, double Fy, double Fz, double dt)
          Applies a force to this particle.
 double energy()
          Returns the kinetic energy.
 double getMass()
           
 AbstractDoubleVector getMomentum()
           
 AbstractDoubleVector getPosition()
           
 AbstractDoubleVector getVelocity()
           
 double getXMomentum()
           
 double getXPosition()
           
 double getXVelocity()
           
 double getYMomentum()
           
 double getYPosition()
           
 double getYVelocity()
           
 double getZMomentum()
           
 double getZPosition()
           
 double getZVelocity()
           
 ClassicalParticle3D gravitate(ClassicalParticle3D p, double dt)
          Evolves two particles under their mutual gravitational attraction.
 ClassicalParticle3D move(double dt)
          Evolves this particle forward according to its kinematics.
 void setMass(double m)
           
 void setMomentum(double xMom, double yMom, double zMom)
           
 void setPosition(double xPos, double yPos, double zPos)
           
 void setVelocity(double xVel, double yVel, double zVel)
           
 void setXPosition(double xPos)
           
 void setYPosition(double yPos)
           
 void setZPosition(double zPos)
           
 double speed()
           
 ClassicalParticle3D translate(double dt)
          Evolves this particle forward according to its linear kinematics.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mass

protected double mass
Mass.


x

protected double x
Position coordinates.


y

protected double y
Position coordinates.


z

protected double z
Position coordinates.


vx

protected double vx
Velocity coordinates.


vy

protected double vy
Velocity coordinates.


vz

protected double vz
Velocity coordinates.

Constructor Detail

ClassicalParticle3D

public ClassicalParticle3D()
Constructs a classical particle.

Method Detail

setMass

public void setMass(double m)

getMass

public double getMass()
Specified by:
getMass in class AbstractClassicalParticle

setPosition

public void setPosition(double xPos,
                        double yPos,
                        double zPos)

getPosition

public AbstractDoubleVector getPosition()
Specified by:
getPosition in class AbstractClassicalParticle

setXPosition

public void setXPosition(double xPos)

getXPosition

public double getXPosition()

setYPosition

public void setYPosition(double yPos)

getYPosition

public double getYPosition()

setZPosition

public void setZPosition(double zPos)

getZPosition

public double getZPosition()

setVelocity

public void setVelocity(double xVel,
                        double yVel,
                        double zVel)

getVelocity

public AbstractDoubleVector getVelocity()
Specified by:
getVelocity in class AbstractClassicalParticle

getXVelocity

public double getXVelocity()

getYVelocity

public double getYVelocity()

getZVelocity

public double getZVelocity()

speed

public double speed()
Overrides:
speed in class AbstractClassicalParticle

setMomentum

public void setMomentum(double xMom,
                        double yMom,
                        double zMom)

getMomentum

public AbstractDoubleVector getMomentum()
Overrides:
getMomentum in class AbstractClassicalParticle

getXMomentum

public double getXMomentum()

getYMomentum

public double getYMomentum()

getZMomentum

public double getZMomentum()

energy

public double energy()
Returns the kinetic energy.

Overrides:
energy in class AbstractClassicalParticle

move

public ClassicalParticle3D move(double dt)
Evolves this particle forward according to its kinematics. This method changes the particle's position.

Returns:
this.

translate

public ClassicalParticle3D translate(double dt)
Evolves this particle forward according to its linear kinematics. This method changes the particle's position.

Returns:
this.

accelerate

public ClassicalParticle3D accelerate(double ax,
                                      double ay,
                                      double az,
                                      double dt)
Accelerates this particle. This method changes the particle's velocity. It is additive, that is accelerate(a1, dt).accelerate(a2, dt) is equivalent to accelerate(a1+a2, dt).

Returns:
this.

applyForce

public ClassicalParticle3D applyForce(double Fx,
                                      double Fy,
                                      double Fz,
                                      double dt)
Applies a force to this particle. This method changes the particle's velocity. It is additive, that is applyForce(F1, dt).applyForce(F2, dt) is equivalent to applyForce(F1+F2, dt).

Returns:
this.

gravitate

public ClassicalParticle3D gravitate(ClassicalParticle3D p,
                                     double dt)
Evolves two particles under their mutual gravitational attraction. This method changes the velocity of both particles.

Returns:
this.