|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.physics.Particle JSci.physics.AbstractClassicalParticle JSci.physics.ClassicalParticle2D
public class ClassicalParticle2D
The ClassicalParticle2D class provides an object for encapsulating classical point particles that live in 2D.
Field Summary | |
---|---|
protected double |
mass
Mass. |
protected double |
vx
Velocity coordinates. |
protected double |
vy
Velocity coordinates. |
protected double |
x
Position coordinates. |
protected double |
y
Position coordinates. |
Constructor Summary | |
---|---|
ClassicalParticle2D()
Constructs a classical particle. |
Method Summary | |
---|---|
ClassicalParticle2D |
accelerate(double ax,
double ay,
double dt)
Accelerates this particle. |
ClassicalParticle2D |
applyForce(double Fx,
double Fy,
double dt)
Applies a force to this particle. |
ClassicalParticle2D |
collide(ClassicalParticle2D p,
double theta)
Collides this particle with another (elastic collision). |
double |
energy()
Returns the kinetic energy. |
double |
getMass()
Returns the mass of this particle. |
AbstractDoubleVector |
getMomentum()
|
AbstractDoubleVector |
getPosition()
|
AbstractDoubleVector |
getVelocity()
|
double |
getXMomentum()
|
double |
getXPosition()
|
double |
getXVelocity()
|
double |
getYMomentum()
|
double |
getYPosition()
|
double |
getYVelocity()
|
ClassicalParticle2D |
gravitate(ClassicalParticle2D p,
double dt)
Evolves two particles under their mutual gravitational attraction. |
ClassicalParticle2D |
move(double dt)
Evolves this particle forward according to its kinematics. |
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)
|
void |
setYPosition(double yPos)
|
double |
speed()
Returns the speed of this particle. |
ClassicalParticle2D |
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 |
---|
protected double mass
protected double x
protected double y
protected double vx
protected double vy
Constructor Detail |
---|
public ClassicalParticle2D()
Method Detail |
---|
public void setMass(double m)
public double getMass()
getMass
in class AbstractClassicalParticle
public void setPosition(double xPos, double yPos)
public AbstractDoubleVector getPosition()
getPosition
in class AbstractClassicalParticle
public void setXPosition(double xPos)
public double getXPosition()
public void setYPosition(double yPos)
public double getYPosition()
public void setVelocity(double xVel, double yVel)
public AbstractDoubleVector getVelocity()
getVelocity
in class AbstractClassicalParticle
public double getXVelocity()
public double getYVelocity()
public double speed()
speed
in class AbstractClassicalParticle
public void setMomentum(double xMom, double yMom)
public AbstractDoubleVector getMomentum()
getMomentum
in class AbstractClassicalParticle
public double getXMomentum()
public double getYMomentum()
public double energy()
energy
in class AbstractClassicalParticle
public ClassicalParticle2D move(double dt)
public ClassicalParticle2D translate(double dt)
public ClassicalParticle2D accelerate(double ax, double ay, double dt)
accelerate(a1, dt).accelerate(a2, dt)
is equivalent to accelerate(a1+a2, dt)
.
public ClassicalParticle2D applyForce(double Fx, double Fy, double dt)
applyForce(F1, dt).applyForce(F2, dt)
is equivalent to applyForce(F1+F2, dt)
.
public ClassicalParticle2D gravitate(ClassicalParticle2D p, double dt)
public ClassicalParticle2D collide(ClassicalParticle2D p, double theta)
theta
- centre of mass deflection angle.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |