|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.geom.Point2D
java.awt.geom.Point2D.Double
org.haphazard.util.Point3D
org.haphazard.util.Vector3D
An ordinary mathematical Vector
| Nested Class Summary |
| Nested classes inherited from class java.awt.geom.Point2D |
java.awt.geom.Point2D.Double, java.awt.geom.Point2D.Float |
| Field Summary | |
static Vector3D |
NULLVECTOR
|
| Fields inherited from class org.haphazard.util.Point3D |
z |
| Fields inherited from class java.awt.geom.Point2D.Double |
x, y |
| Constructor Summary | |
Vector3D()
Creates a new instance of Vector3D |
|
Vector3D(double x,
double y,
double z)
Creates a new Vector3D with specified coordinates |
|
Vector3D(Point3D point)
Creates a vector from a point |
|
Vector3D(Point3D origin,
Point3D destination)
Creates a vector from origin to destination |
|
| Method Summary | |
Vector3D |
cross(Vector3D vector)
Takes the cross product of two vectors |
double |
dot(Vector3D vector)
Calculates the dot product of two vectors |
double |
getLength()
Gets the length of this vector |
Vector3D |
projectOn(Vector3D vector)
Projects this vector onto another vector |
void |
setLength(double length)
Sets the length of this vector |
void |
setVector(Point3D origin,
Point3D destination)
Creates a vector from origin to destination |
void |
setVector(Vector3D vector)
Sets this vector to be equal to another vector |
| Methods inherited from class org.haphazard.util.Point3D |
add, add, clone, distance, equals, equals, getZ, setLocation, toString |
| Methods inherited from class java.awt.geom.Point2D.Double |
getX, getY, setLocation |
| Methods inherited from class java.awt.geom.Point2D |
distance, distance, distance, distanceSq, distanceSq, distanceSq, equals, hashCode, setLocation |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final Vector3D NULLVECTOR
| Constructor Detail |
public Vector3D()
public Vector3D(Point3D point)
point - The point to create from
public Vector3D(Point3D origin,
Point3D destination)
origin - The origin of the vectordestination - The destination of the vector
public Vector3D(double x,
double y,
double z)
x - The x-coordinatey - The y-coordinatez - The z-coordinate| Method Detail |
public void setVector(Point3D origin,
Point3D destination)
origin - The origin of the vectordestination - The destination of the vectorpublic void setVector(Vector3D vector)
vector - The vector to set this vector topublic double getLength()
public void setLength(double length)
length - The length to setpublic Vector3D projectOn(Vector3D vector)
vector - The vector to project this vector on
public double dot(Vector3D vector)
vector - The vector to dot with
public Vector3D cross(Vector3D vector)
vector - The vector to cross with
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||