org.jscience.physics.kinematics
Class ClassicalParticle2D

java.lang.Object
  extended by org.jscience.physics.Particle
      extended by org.jscience.physics.kinematics.AbstractClassicalParticle
          extended by org.jscience.physics.kinematics.ClassicalParticle2D
All Implemented Interfaces:
java.io.Serializable, Positioned
Direct Known Subclasses:
RigidBody2D

public class ClassicalParticle2D
extends AbstractClassicalParticle

The ClassicalParticle2D class provides an object for encapsulating classical point particles that live in 2D.

See Also:
Serialized Form

Constructor Summary
ClassicalParticle2D()
          Constructs a classical particle.
ClassicalParticle2D(double m)
          Creates a new ClassicalParticle2D object.
 
Method Summary
 AbstractClassicalParticle accelerate(double ax, double ay, double dt)
          Accelerates this particle.
 AbstractClassicalParticle applyForce(double Fx, double Fy, double dt)
          Applies a force to this particle.
 AbstractClassicalParticle applyForce(Force f, double t, double dt)
          Applies a force to this particle.
 AbstractClassicalParticle collide(ClassicalParticle2D p, double theta)
          Collides this particle with another (elastic collision).
 double energy()
          Returns the kinetic energy.
 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!
 double getXMomentum()
          DOCUMENT ME!
 double getXPosition()
          DOCUMENT ME!
 double getXVelocity()
          DOCUMENT ME!
 double getYMomentum()
          DOCUMENT ME!
 double getYPosition()
          DOCUMENT ME!
 double getYVelocity()
          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 xMom, double yMom)
          Sets the momentum of this particle.
 void setPosition(double xPos, double yPos)
          Sets the position of this particle.
 void setVelocity(double xVel, double yVel)
          Sets the velocity of this particle.
 void setXPosition(double xPos)
          DOCUMENT ME!
 void setXVelocity(double xVel)
          DOCUMENT ME!
 void setYPosition(double yPos)
          DOCUMENT ME!
 void setYVelocity(double yVel)
          DOCUMENT ME!
 double speed()
          Returns the speed of this particle.
 AbstractClassicalParticle translate(double dt)
          Evolves this particle forward according to its linear kinematics.
 
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

ClassicalParticle2D

public ClassicalParticle2D()
Constructs a classical particle.


ClassicalParticle2D

public ClassicalParticle2D(double m)
Creates a new ClassicalParticle2D object.

Parameters:
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 xPos,
                        double yPos)
Sets the position of this particle.

Parameters:
xPos - DOCUMENT ME!
yPos - DOCUMENT ME!

getPosition

public AbstractDoubleVector getPosition()
DOCUMENT ME!

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

setXPosition

public void setXPosition(double xPos)
DOCUMENT ME!

Parameters:
xPos - DOCUMENT ME!

getXPosition

public double getXPosition()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setYPosition

public void setYPosition(double yPos)
DOCUMENT ME!

Parameters:
yPos - DOCUMENT ME!

getYPosition

public double getYPosition()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setVelocity

public void setVelocity(double xVel,
                        double yVel)
Sets the velocity of this particle.

Parameters:
xVel - DOCUMENT ME!
yVel - DOCUMENT ME!

getVelocity

public AbstractDoubleVector getVelocity()
DOCUMENT ME!

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

getXVelocity

public double getXVelocity()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setXVelocity

public void setXVelocity(double xVel)
DOCUMENT ME!

Parameters:
xVel - DOCUMENT ME!

getYVelocity

public double getYVelocity()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setYVelocity

public void setYVelocity(double yVel)
DOCUMENT ME!

Parameters:
yVel - DOCUMENT ME!

speed

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

Overrides:
speed in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

setMomentum

public void setMomentum(double xMom,
                        double yMom)
Sets the momentum of this particle.

Parameters:
xMom - DOCUMENT ME!
yMom - DOCUMENT ME!

getMomentum

public AbstractDoubleVector getMomentum()
DOCUMENT ME!

Overrides:
getMomentum in class AbstractClassicalParticle
Returns:
DOCUMENT ME!

getXMomentum

public double getXMomentum()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getYMomentum

public double getYMomentum()
DOCUMENT ME!

Returns:
DOCUMENT ME!

energy

public double energy()
Returns the kinetic energy.

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.

translate

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

Parameters:
dt - DOCUMENT ME!
Returns:
this.

accelerate

public AbstractClassicalParticle accelerate(double ax,
                                            double ay,
                                            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:
ax - DOCUMENT ME!
ay - DOCUMENT ME!
dt - DOCUMENT ME!
Returns:
this.

applyForce

public AbstractClassicalParticle applyForce(double Fx,
                                            double Fy,
                                            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).

Parameters:
Fx - DOCUMENT ME!
Fy - 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:
IllegalDimensionException - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!

collide

public AbstractClassicalParticle collide(ClassicalParticle2D p,
                                         double theta)
Collides this particle with another (elastic collision). This method calculates the resultant velocities.

Parameters:
p - DOCUMENT ME!
theta - centre of mass deflection angle.
Returns:
this.