org.opensourcephysics.sip.ch02
Class FallingBall

java.lang.Object
  extended by org.opensourcephysics.sip.ch02.FallingBall

public class FallingBall
extends java.lang.Object

FallingBall models a falling ball using the Euler algorithm.


Constructor Summary
FallingBall()
          Constructs a FallingBall at x=0 with v=0;
 
Method Summary
 double analyticPosition(double y0, double v0)
          Computes the position of the ball using the analytic solution of the equation of motion.
 double analyticVelocity(double v0)
          Computes the velocity of the ball using the analytic solution of the equation of motion.
 void step()
          Steps (advances) the postion of the ball using the Euler algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FallingBall

public FallingBall()
Constructs a FallingBall at x=0 with v=0;

Method Detail

step

public void step()
Steps (advances) the postion of the ball using the Euler algorithm.


analyticPosition

public double analyticPosition(double y0,
                               double v0)
Computes the position of the ball using the analytic solution of the equation of motion.

Parameters:
y0 - double
v0 - double
Returns:
double

analyticVelocity

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

Parameters:
v0 - double
Returns:
double