org.opensourcephysics.sip.ch10
Class FieldLine

java.lang.Object
  extended by org.opensourcephysics.sip.ch10.FieldLine
All Implemented Interfaces:
java.lang.Runnable, Drawable, ODE

public class FieldLine
extends java.lang.Object
implements Drawable, ODE, java.lang.Runnable

FieldLine computes a electric field line in the vicinity of one or more point charges.


Constructor Summary
FieldLine(DrawingFrame frame, double x0, double y0, double stepSize)
          Constructs a FieldLine for use in the given drawing frame.
 
Method Summary
 void draw(DrawingPanel panel, java.awt.Graphics g)
          Draws the field line.
 void getRate(double[] state, double[] rate)
          Gets the rate for the field line using the given state.
 double[] getState()
          Gets the state vector of the field line.
 void run()
          Runs the field line calculation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldLine

public FieldLine(DrawingFrame frame,
                 double x0,
                 double y0,
                 double stepSize)
Constructs a FieldLine for use in the given drawing frame.

Parameters:
frame -
x0 -
y0 -
stepSize -
Method Detail

getState

public double[] getState()
Gets the state vector of the field line.

Specified by:
getState in interface ODE
Returns:
the state

getRate

public void getRate(double[] state,
                    double[] rate)
Gets the rate for the field line using the given state.

Specified by:
getRate in interface ODE
Parameters:
state - the given state
rate - the rate

run

public void run()
Runs the field line calculation.

Specified by:
run in interface java.lang.Runnable

draw

public void draw(DrawingPanel panel,
                 java.awt.Graphics g)
Draws the field line.

Specified by:
draw in interface Drawable
Parameters:
panel -
g -