|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.math.Vector4
This class represents a vector in 4d space.
| Field Summary | |
double |
w
w component |
double |
x
x component |
double |
y
y component |
double |
z
z component |
| Constructor Summary | |
Vector4()
Constructor for Vector4. |
|
Vector4(double x,
double y,
double z,
double w)
Constructor for Vector4. |
|
Vector4(Vector4 vector)
Copy Constructor for Vector4. |
|
| Method Summary | |
void |
add(double x,
double y,
double z,
double w)
Adds the specified values to this vector. |
double |
dot(Vector4 vector)
Computes the vector dot-product of this vector times the specified vector. |
double |
length()
Computes the length (magnitude) of this vector. |
void |
normalize()
Normalize this vector to unit-length 1 if its magnitude is not equal 0. |
void |
scale(double scale)
Scales this vector by the given factor. |
void |
set(double x,
double y,
double z,
double w)
Sets this vector to the specified values. |
void |
sub(double x,
double y,
double z,
double w)
Subtracts the specified values from this vector. |
java.lang.String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public double x
public double y
public double z
public double w
| Constructor Detail |
public Vector4()
0.0.
public Vector4(Vector4 vector)
vector - vector to copy values from. This argument must not be
null.
public Vector4(double x,
double y,
double z,
double w)
x - value for x component.y - value for y component.z - value for z component.w - value for w component.| Method Detail |
public final void set(double x,
double y,
double z,
double w)
x - new value for x component.y - new value for y component.z - new value for z component.w - new value for w component.
public final void add(double x,
double y,
double z,
double w)
x - value for x component.y - value for y component.z - value for z component.w - value for w component.
public final void sub(double x,
double y,
double z,
double w)
x - value for x component.y - value for y component.z - value for z component.w - value for w component.public final void scale(double scale)
scale - factor to scale this vector withpublic final double length()
public final void normalize()
public final double dot(Vector4 vector)
vector - other vector for dot product.
public java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||