|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object
|
+--Jama.Matrix
|
+--Vector3D
Represents a line vector in 3D space. The vector is in the homogeneous coordinate system (x,y,z,1)
| Fields inherited from class Jama.Matrix |
A,
m,
n |
| Constructor Summary | |
Vector3D()
Constructs a zero vector. |
|
Vector3D(double x,
double y,
double z)
Constructs a 3D vector. |
|
Vector3D(double x,
double y,
double z,
boolean normalized)
Constructs a 3D vector, optionally normalized. |
|
Vector3D(Jama.Matrix m)
Constructs a vector from a matrix. |
|
Vector3D(Point3D pt)
Constructs a vector by taking the (x,y,z) elements of the point. |
|
| Method Summary | |
static Vector3D |
add(Vector3D A,
Vector3D B)
adds two vectors |
static Vector3D |
add(Vector3D A,
Vector3D B,
boolean normalized)
adds two vectors |
Vector3D |
cross(Vector3D B)
Returns the cross product A x B . |
double |
dot(Vector3D B)
returns the dot vector A.B . |
double |
getH()
Returns the homogeneous (H) factor. |
double |
getX()
returns the first (X) element of the vector. |
double |
getY()
returns the second (Y) element of the vector. |
double |
getZ()
returns the third (Z) element of the vector. |
double |
norm()
Returns the norm (vector length) of this vector. |
void |
normalize()
Normalizes this vector. |
Vector3D |
normalized()
Returns the normalized form of this vector. |
static Vector3D |
normalized(double x,
double y,
double z)
Returns a normalized vector with the specified (x,y,z) values. |
void |
set(Jama.Matrix m)
Sets the vectors x,y,z,h values from the matrix. |
void |
set(Point3D pt)
Sets the vectors x,y,z values from the point. |
void |
setH(double v)
Sets the homogeneous factor. |
void |
setX(double v)
Sets the first (X) element of the vector. |
void |
setY(double v)
Sets the second (Y) element of the vector. |
void |
setZ(double v)
Sets the third (Z) element of the vector. |
static Vector3D |
subtract(Vector3D A,
Vector3D B)
Subtracts two vectors |
Jama.Matrix |
times(double s)
Multiplies the vector by a scalar. |
String |
toString()
Returns the string representation of the vector. |
void |
unhomogenize()
Divides the x,y,z factor by h if necessary. |
| Methods inherited from class Jama.Matrix |
arrayLeftDivide,
arrayLeftDivideEquals,
arrayRightDivide,
arrayRightDivideEquals,
arrayTimes,
arrayTimesEquals,
checkMatrixDimensions,
chol,
clone,
cond,
constructWithCopy,
copy,
det,
eig,
get,
getArray,
getArrayCopy,
getColumnDimension,
getColumnPackedCopy,
getMatrix,
getMatrix,
getMatrix,
getMatrix,
getRowDimension,
getRowPackedCopy,
identity,
inverse,
lu,
minus,
minusEquals,
norm1,
norm2,
normF,
normInf,
plus,
plusEquals,
print,
print,
print,
print,
qr,
random,
rank,
read,
set,
setMatrix,
setMatrix,
setMatrix,
setMatrix,
solve,
solveTranspose,
svd,
times,
timesEquals,
trace,
transpose,
uminus |
| Methods inherited from class java.lang.Object |
|
| Constructor Detail |
public Vector3D(double x,
double y,
double z,
boolean normalized)
x - the x value of the vector.y - the y value of the vector.z - the z value of the vector.normalized - if true, normalizes the new vector.
public Vector3D(double x,
double y,
double z)
x - the x value of the vector.y - the y value of the vector.z - the z value of the vector.public Vector3D(Point3D pt)
pt - the 3D point.public Vector3D(Jama.Matrix m)
m - the 4x1 homogeneous matrix. The matrix must not be
modified afterwards.public Vector3D()
| Method Detail |
public void set(Point3D pt)
pt - the source point.public void set(Jama.Matrix m)
m - the 4x1 homogeneous source matrix.public Jama.Matrix times(double s)
public String toString()
public double getX()
public double getY()
public double getZ()
public double getH()
public void setX(double v)
v - the new value of X.public void setY(double v)
v - the new value of Y.public void setZ(double v)
v - the new value of Z.public void setH(double v)
public void unhomogenize()
public Vector3D normalized()
public double norm()
public void normalize()
public static Vector3D normalized(double x,
double y,
double z)
public Vector3D cross(Vector3D B)
B - the other vectorpublic double dot(Vector3D B)
B - the other vector
public static Vector3D add(Vector3D A,
Vector3D B)
public static Vector3D add(Vector3D A,
Vector3D B,
boolean normalized)
public static Vector3D subtract(Vector3D A,
Vector3D B)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||