|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectVector
public class Vector
Represents a three-dimensional vector.
Method Summary | |
---|---|
Vector |
add(Vector other)
Returns the result of adding this vector to another. |
static Vector |
create(double x,
double y,
double z)
Creates a vector with the given x-, y-, and z-coordinates. |
Vector |
cross(Vector other)
Returns the result of a cross product between this vector and another. |
double |
dot(Vector other)
Returns the result of a dot product between this vector and another. |
double |
getLength()
Returns the length, or magnitude, of this vector. |
double |
getX()
Returns the change in x represented by this vector. |
double |
getY()
Returns the change in y represented by this vector. |
double |
getZ()
Returns the change in z represented by this vector. |
Vector |
normalize()
Returns a vector that is the normalization of this vector. |
Vector |
projectOnto(Vector other)
Returns the result of projecting this vector onto the direction of another. |
Vector |
scale(double scalar)
Returns a vector that is in the same direction as this vector, but whose magnitude has been scaled by the given scalar. |
Vector |
subtract(Vector other)
Returns the result of subtracting another vector from this one. |
java.lang.String |
toString()
Returns a traditional representation of this vector. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public double getX()
public double getY()
public double getZ()
public double getLength()
public Vector normalize()
public double dot(Vector other)
public Vector cross(Vector other)
public Vector add(Vector other)
public Vector subtract(Vector other)
public Vector projectOnto(Vector other)
public Vector scale(double scalar)
public java.lang.String toString()
toString
in class java.lang.Object
public static Vector create(double x, double y, double z)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |