|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.geometry.Tuple2D<Vector2D>
org.starhope.appius.geometry.Vector2D
public final class Vector2D
WRITEME: Document this type.
| Field Summary | |
|---|---|
private static long |
serialVersionUID
WRITEME: Document this brpocock@star-hope.org |
| Fields inherited from class org.starhope.appius.geometry.Tuple2D |
|---|
x, y |
| Constructor Summary | |
|---|---|
Vector2D(double x0,
double y0)
Create a coordinate pair from an x and y value |
|
Vector2D(Vector2D v)
Creates a vector from an existing vector pair |
|
| Method Summary | |
|---|---|
double |
dot(Vector2D v2d)
Gets the dot product of the two vectors |
boolean |
isZero()
|
double |
length()
Gets the length/magnitude of the vector |
protected Vector2D |
newInstance(double x0,
double y0)
Creates a new instance of the coordinate pair for use by the abstract generic parent class to get around downcasting problems |
Vector2D |
normalize()
Returns a normalised version of the vector |
Vector2D |
scale(double magnitude)
Returns a new vector scaled by the magnitude given |
| Methods inherited from class org.starhope.appius.geometry.Tuple2D |
|---|
add, add, clone, divide, equals, getX, getY, hashCode, multiply, subtract, subtract, toJSON, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
| Constructor Detail |
|---|
public Vector2D(double x0,
double y0)
x0 - xy0 - ypublic Vector2D(Vector2D v)
v - WRITEME| Method Detail |
|---|
public double dot(Vector2D v2d)
v2d - WRITEME
public boolean isZero()
public double length()
protected Vector2D newInstance(double x0,
double y0)
newInstance in class Tuple2D<Vector2D>x0 - xy0 - y
Tuple2D.newInstance(double,
double)public Vector2D normalize()
public Vector2D scale(double magnitude)
magnitude - WRITEME
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||