|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.sip.ch03.Projectile
public class Projectile
Projectile models the dynamics of a projectile and forms a template for other simulations.
| Constructor Summary | |
|---|---|
Projectile()
|
|
| Method Summary | |
|---|---|
void |
draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
Draws the projectile. |
void |
getRate(double[] state,
double[] rate)
Gets the rate. |
double[] |
getState()
Gets the state. |
void |
setState(double x,
double vx,
double y,
double vy)
Sets the state. |
void |
setStepSize(double dt)
|
void |
step()
Steps (advances) the time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Projectile()
| Method Detail |
|---|
public void setStepSize(double dt)
public void step()
dt - the time step.
public void setState(double x,
double vx,
double y,
double vy)
x - vx - y - vy - public double[] getState()
getState in interface ODE
public void getRate(double[] state,
double[] rate)
getRate in interface ODEstate - double[] the staterate - double[] the computed rate
public void draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
draw in interface DrawabledrawingPanel - g -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||