|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensourcephysics.sip.ch05.Planet2
public class Planet2
Planet2 models two interacting planets in the presence of a central inverse square law force.
Constructor Summary | |
---|---|
Planet2()
|
Method Summary | |
---|---|
void |
doStep()
Steps the time using an ode solver. |
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws the three bodies. |
void |
getRate(double[] state,
double[] rate)
Gets the rate using the given state. |
double[] |
getState()
Gets the state: x1, vx1, y1, vy1, x2, vx2, y2, vy2, t. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Planet2()
Method Detail |
---|
public void doStep()
public void draw(DrawingPanel panel, java.awt.Graphics g)
draw
in interface Drawable
panel
- g
- public void getRate(double[] state, double[] rate)
getRate
in interface ODE
state
- the staterate
- the resulting ratepublic double[] getState()
getState
in interface ODE
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |