public class Vector3 extends Vector2
Constructor and Description |
---|
Vector3()
New zero vector.
|
Vector3(double x,
double y,
double z)
New (
x ,y ,z ) vector. |
Vector3(Point3 point)
New vector copy of
point . |
Vector3(Vector3 other)
New vector copy of
other . |
Modifier and Type | Method and Description |
---|---|
void |
add(Vector3 other)
Add each element of other to the corresponding element of this.
|
java.lang.Object |
clone() |
void |
copy(Point3 point)
Make this a copy of
point . |
void |
copy(Vector3 other)
Make this a copy of other.
|
void |
crossProduct(Vector3 other)
Set this to the cross product of this and other.
|
void |
crossProduct(Vector3 A,
Vector3 B)
Set this to the cross product of A and B.
|
double |
dotProduct(double ox,
double oy,
double oz) |
double |
dotProduct(Vector3 other)
Dot product of this and other.
|
boolean |
equals(java.lang.Object other)
Is this equal to other ?
|
void |
fill(double value)
Assign value to all elements.
|
boolean |
isZero()
Are all components to zero?.
|
double |
length()
Cartesian length.
|
void |
mult(Vector3 other)
Multiply each element of this by the corresponding element of other.
|
double |
normalize()
Transform this into an unit vector.
|
void |
scalarAdd(double value)
Add value to each element.
|
void |
scalarDiv(double value)
Divide each element by value.
|
void |
scalarMult(double value)
Multiply each element by value.
|
void |
scalarSub(double value)
Substract value to each element.
|
void |
set(double x,
double y,
double z)
Explicitly set the three components.
|
void |
set(int i,
double value)
Explicitly set the i-th component to value.
|
void |
sub(Vector3 other)
Substract each element of other to the corresponding element of this.
|
java.lang.String |
toString() |
boolean |
validComponent(int i)
Is i the index of a component ?
|
double |
z() |
public Vector3()
public Vector3(double x, double y, double z)
x
,y
,z
) vector.public Vector3(Vector3 other)
other
.public Vector3(Point3 point)
point
.public boolean equals(java.lang.Object other)
public boolean validComponent(int i)
validComponent
in class Vector2
public double dotProduct(double ox, double oy, double oz)
public double dotProduct(Vector3 other)
public double z()
public void set(int i, double value)
public void set(double x, double y, double z)
public void add(Vector3 other)
public void sub(Vector3 other)
public void mult(Vector3 other)
public void scalarAdd(double value)
public void scalarSub(double value)
public void scalarMult(double value)
scalarMult
in class Vector2
public void scalarDiv(double value)
public void crossProduct(Vector3 other)
public void crossProduct(Vector3 A, Vector3 B)
public double normalize()
public void copy(Vector3 other)
public void copy(Point3 point)
point
.