org.jscience.physics.kinematics
Class ClassicalParticleND

java.lang.Object
  extended by org.jscience.physics.Particle
      extended by org.jscience.physics.kinematics.AbstractClassicalParticle
          extended by org.jscience.physics.kinematics.ClassicalParticleND
All Implemented Interfaces:
java.io.Serializable, Positioned

public class ClassicalParticleND
extends AbstractClassicalParticle

The ClassicalParticle class provides an object for encapsulating classical point particles. This class is suitable for representing particles that live in an arbitrary number of dimensions.

See Also:
Serialized Form

Constructor Summary
ClassicalParticleND(int n)
          Constructs a classical particle.
ClassicalParticleND(int n, double m)
          Creates a new ClassicalParticleND object.
 
Method Summary
 AbstractClassicalParticle accelerate(double[] a, double dt)
          Accelerates this particle.
 AbstractClassicalParticle applyForce(Force f, double t, double dt)
          Applies a force to this particle.
 double energy()
          Returns the energy of this particle.
 double getCharge()
          Returns the charge of this particle.
 int getDimension()
          DOCUMENT ME!
 double getMass()
          Returns the mass of this particle.
 AbstractDoubleVector getMomentum()
          DOCUMENT ME!
 AbstractDoubleVector getPosition()
          DOCUMENT ME!
 AbstractDoubleVector getVelocity()
          DOCUMENT ME!
 AbstractClassicalParticle move(double dt)
          Evolves this particle forward according to its kinematics.
 void setCharge(double e)
          Sets the charge of this particle.
 void setMass(double m)
          Sets the mass of this particle.
 void setMomentum(double[] mom)
          DOCUMENT ME!
 void setPosition(double[] pos)
          DOCUMENT ME!
 void setVelocity(double[] vel)
          DOCUMENT ME!
 double speed()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.physics.kinematics.AbstractClassicalParticle
addForce, getForces, removeAllForces, removeForce, setForces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassicalParticleND

public ClassicalParticleND(int n)
Constructs a classical particle.

Parameters:
n - number of dimensions.

ClassicalParticleND

public ClassicalParticleND(int n,
                           double m)
Creates a new ClassicalParticleND object.

Parameters:
n - DOCUMENT ME!
m - DOCUMENT ME!
Method Detail

setMass

public void setMass(double m)
Sets the mass of this particle.

Parameters:
m - DOCUMENT ME!

getMass

public double getMass()
Returns the mass of this particle.

Specified by:
getMass in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

setCharge

public void setCharge(double e)
Sets the charge of this particle.

Parameters:
e - DOCUMENT ME!

getCharge

public double getCharge()
Returns the charge of this particle.

Specified by:
getCharge in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

setPosition

public void setPosition(double[] pos)
DOCUMENT ME!

Parameters:
pos - DOCUMENT ME!

getPosition

public AbstractDoubleVector getPosition()
DOCUMENT ME!

Specified by:
getPosition in interface Positioned
Specified by:
getPosition in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

setVelocity

public void setVelocity(double[] vel)
DOCUMENT ME!

Parameters:
vel - DOCUMENT ME!

getVelocity

public AbstractDoubleVector getVelocity()
DOCUMENT ME!

Specified by:
getVelocity in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

speed

public double speed()
DOCUMENT ME!

Overrides:
speed in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

setMomentum

public void setMomentum(double[] mom)
DOCUMENT ME!

Parameters:
mom - DOCUMENT ME!

getMomentum

public AbstractDoubleVector getMomentum()
DOCUMENT ME!

Overrides:
getMomentum in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

energy

public double energy()
Returns the energy of this particle.

Overrides:
energy in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

getDimension

public int getDimension()
DOCUMENT ME!

Specified by:
getDimension in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

move

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

Specified by:
move in class AbstractClassicalParticle
Parameters:
dt - DOCUMENT ME!
Returns:
this.

accelerate

public AbstractClassicalParticle accelerate(double[] a,
                                            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).

Parameters:
a - DOCUMENT ME!
dt - DOCUMENT ME!
Returns:
this.

applyForce

public AbstractClassicalParticle applyForce(Force f,
                                            double t,
                                            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).

Specified by:
applyForce in class AbstractClassicalParticle
Parameters:
f - DOCUMENT ME!
t - DOCUMENT ME!
dt - DOCUMENT ME!
Returns:
this.
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!