KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > JSci > physics > Force2D


1 package JSci.physics;
2
3 import JSci.maths.vectors.AbstractDoubleVector;
4 import JSci.maths.vectors.Double2Vector;
5
6 /**
7 * The Force2D class provides an object for encapsulating forces in 2D.
8 * @version 1.1
9 * @author Mark Hale
10 */

11 public abstract class Force2D extends Force {
12         public abstract double getXComponent(double t);
13         public abstract double getYComponent(double t);
14         public AbstractDoubleVector getVector(double t) {
15                 return new Double2Vector(getXComponent(t), getYComponent(t));
16         }
17 }
18
Popular Tags