|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XMatrix
A matrix capables to perform some matrix operations. The basic Matrix
interface
is basically just a two dimensional array of numbers. The XMatrix
interface add
inversion and multiplication capabilities.
It is used as a bridge across various matrix implementations in Java3D
(Matrix3f
, Matrix3d
, Matrix4f
,
Matrix4d
, GMatrix
).
Method Summary | |
---|---|
boolean |
equals(Matrix matrix,
double tolerance)
Compares the element values regardless the object class. |
double |
getElement(int row,
int column)
Returns the element at the specified index. |
int |
getNumCol()
Returns the number of colmuns in this matrix. |
int |
getNumRow()
Returns the number of rows in this matrix. |
void |
invert()
Inverts this matrix in place. |
boolean |
isAffine()
Returns true if this matrix is an affine transform. |
boolean |
isIdentity()
Returns true if this matrix is an identity matrix. |
boolean |
isIdentity(double tolerance)
Returns true if this matrix is an identity matrix using the provided tolerance. |
void |
multiply(Matrix matrix)
Sets the value of this matrix to the result of multiplying itself with the specified matrix. |
void |
negate()
Negates the value of this matrix: this = -this . |
void |
setElement(int row,
int column,
double value)
Set the element at the specified index. |
void |
setIdentity()
Sets this matrix to the identity matrix. |
void |
setZero()
Sets all the values in this matrix to zero. |
void |
transpose()
Sets the value of this matrix to its transpose. |
Methods inherited from interface Matrix |
---|
clone |
Method Detail |
---|
int getNumRow()
getNumRow
in interface Matrix
int getNumCol()
getNumCol
in interface Matrix
double getElement(int row, int column)
getElement
in interface Matrix
row
- The row number to be retrieved (zero indexed).column
- The column number to be retrieved (zero indexed).
void setElement(int row, int column, double value)
setElement
in interface Matrix
row
- The row number to be retrieved (zero indexed).column
- The column number to be retrieved (zero indexed).value
- The new matrix element value.void setZero()
void setIdentity()
boolean isIdentity()
true
if this matrix is an identity matrix.
isIdentity
in interface Matrix
true
if this matrix is an identity matrix.boolean isIdentity(double tolerance)
true
if this matrix is an identity matrix using the provided tolerance.
This method is equivalent to computing the difference between this matrix and an identity
matrix of identical size, and returning true
if and only if all differences are
smaller than or equal to tolerance
.
tolerance
- The tolerance value.
true
if this matrix is close enough to the identity matrix
given the tolerance value.boolean isAffine()
true
if this matrix is an affine transform.
A transform is affine if the matrix is square and last row contains
only zeros, except in the last column which contains 1.
true
if this matrix is affine.void negate()
this
= -this
.
void transpose()
void invert() throws SingularMatrixException
SingularMatrixException
- if this matrix is not invertible.void multiply(Matrix matrix)
this
= this
× matrix
. In the context
of coordinate transformations, this is equivalent to
AffineTransform.concatenate
:
first transforms by the supplied transform and then transform the result by the original
transform.
matrix
- The matrix to multiply to this matrix.boolean equals(Matrix matrix, double tolerance)
GMatrix.epsilonEquals(matrix,
tolerance)
. The method name is intentionally different in order to avoid
ambiguities at compile-time.
matrix
- The matrix to compare.tolerance
- The tolerance value.
true
if this matrix is close enough to the given matrix
given the tolerance value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |