|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--noope.core.Vector3D
Manipulate a 3D cartesian vector. Note that objects of this class are immutable; i.e. they cannot be changed. To create mutable (i.e. changable) vectors, use the MutableVector3D class instead.
Field Summary | |
static Vector3D |
ex
Unit vector in x direction |
static Vector3D |
ey
Unit vector in y direction |
static Vector3D |
ez
Unit vector in z direction |
protected double |
x
x component |
protected double |
y
y component |
protected double |
z
z component |
Constructor Summary | |
Vector3D()
Construct a Vector3D and initialise it to (0, 0, 0). |
|
Vector3D(double new_x,
double new_y,
double new_z)
Construct a Vector3D and initialise it to (new_x, new_y, new_z). |
|
Vector3D(java.lang.String s)
Construct a new Vector3D by parsing a string. |
|
Vector3D(Vector3D v)
Construct a Vector3D equal to v. |
Method Summary | |
Vector3D |
add(Vector3D v)
Return a new Vector3D representing the vector sum of this Vector3D and the Vector3D v. |
Vector3D |
crossProduct(Vector3D v)
Return the cross product of this Vector3D and the Vector3D v. |
double |
dotProduct(Vector3D v)
Return the scalar product of this Vector3D and the Vector3D v. |
boolean |
equals(java.lang.Object o)
Compare a Vector3D and an Object. |
boolean |
equals(Vector3D v)
Compare two Vector3D objects. |
double |
getModulus()
Return the modulus of this Vector3D. |
double |
getModulusSquared()
Return the square modulus of this Vector3D. |
Vector3D |
getUnitVector()
Return a new Vector3D representing a unit vector in the direction of this Vector3D. |
double |
getX()
Return the x component of this Vector3D |
double |
getY()
Return the y component of this Vector3D |
double |
getZ()
Return the z component of this Vector3D |
int |
hashCode()
Hash this Vector3D to an integer. |
Vector3D |
multScalar(double d)
Return a new Vector3D which is result of multiplying each component of this Vector3D by the scalar d. |
Vector3D |
negative()
Return a new Vector3D in the opposite direction to this Vector3D. |
Vector3D |
subtract(Vector3D v)
Return a new Vector3D representing the vector difference between this Vector3D and the Vector3D v. |
java.lang.String |
toString()
Return a string representation of this Vector3D formatted as (x y z) |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected double x
protected double y
protected double z
public static final Vector3D ex
public static final Vector3D ey
public static final Vector3D ez
Constructor Detail |
public Vector3D()
public Vector3D(double new_x, double new_y, double new_z)
new_x
- x componentnew_y
- y componentnew_z
- z componentpublic Vector3D(Vector3D v)
v
- the vector to copy frompublic Vector3D(java.lang.String s) throws java.text.ParseException
s
- the string to parsejava.text.ParseException
- if there was an error parsing the stringMethod Detail |
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
equals(Vector3D)
public boolean equals(Vector3D v)
public double getX()
public double getY()
public double getZ()
public double getModulusSquared()
public double getModulus()
public Vector3D getUnitVector()
public Vector3D negative()
public Vector3D multScalar(double d)
public Vector3D add(Vector3D v)
public Vector3D subtract(Vector3D v)
public double dotProduct(Vector3D v)
public Vector3D crossProduct(Vector3D v)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |