org.opensourcephysics.sip.ch02
Class FallingParticle

java.lang.Object
  extended by org.opensourcephysics.sip.ch02.Particle
      extended by org.opensourcephysics.sip.ch02.FallingParticle

public class FallingParticle
extends Particle

FallingParticle models a falling ball by subclassing the Particle class.


Constructor Summary
FallingParticle(double y, double v)
          Constructs a Falling Particle with the given initial conditions.
 
Method Summary
 double analyticPosition()
          Computes the position of the ball at the current time using the analytic solution of the equation of motion.
 double analyticVelocity()
          Computes the velocity of the ball at the current time using the analytic solution of the equation of motion.
 void step()
          Steps (advances) the dynamical variables using the Euler method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FallingParticle

public FallingParticle(double y,
                       double v)
Constructs a Falling Particle with the given initial conditions.

Parameters:
y - double
v - double
Method Detail

step

public void step()
Steps (advances) the dynamical variables using the Euler method.

Specified by:
step in class Particle

analyticPosition

public double analyticPosition()
Computes the position of the ball at the current time using the analytic solution of the equation of motion.

Specified by:
analyticPosition in class Particle
Parameters:
y0 - double
v0 - double
Returns:
double

analyticVelocity

public double analyticVelocity()
Computes the velocity of the ball at the current time using the analytic solution of the equation of motion.

Specified by:
analyticVelocity in class Particle
Parameters:
y0 - double
v0 - double
Returns:
double