|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectMatrix3d
Matrix3
public class Matrix3
A matrix of fixed 3×3 size. This specialized matrix provides
better accuracy than GeneralMatrix
for matrix inversion and multiplication.
Field Summary | |
---|---|
static int |
SIZE
The matrix size, which is 3. |
Fields inherited from class Matrix3d |
---|
m00, m01, m02, m10, m11, m12, m20, m21, m22 |
Constructor Summary | |
---|---|
Matrix3()
Creates a new identity matrix. |
|
Matrix3(AffineTransform transform)
Constructs a 3×3 matrix from the specified affine transform. |
|
Matrix3(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22)
Creates a new matrix initialized to the specified values. |
|
Matrix3(Matrix matrix)
Creates a new matrix initialized to the same value than the specified one. |
Method Summary | |
---|---|
Matrix3 |
clone()
Returns a clone of this matrix. |
boolean |
equals(Matrix matrix,
double tolerance)
Compares the element values regardless the object class. |
boolean |
equalsAffine(AffineTransform transform)
Returns true if this matrix is equals to the specified affine transform. |
int |
getNumCol()
Returns the number of colmuns in this matrix, which is always 3 in this implementation. |
int |
getNumRow()
Returns the number of rows in this matrix, which is always 3 in this implementation. |
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. |
boolean |
isNaN()
Returns true if at least one value is NaN . |
void |
multiply(Matrix matrix)
Sets the value of this matrix to the result of multiplying itself with the specified matrix. |
void |
setMatrix(AffineTransform transform)
Sets this matrix to the specified affine transform. |
String |
toString()
Returns a string representation of this matrix. |
Methods inherited from class Matrix3d |
---|
add, add, add, add, determinant, epsilonEquals, equals, equals, getColumn, getColumn, getElement, getRow, getRow, getScale, hashCode, invert, invert, mul, mul, mul, mul, mulNormalize, mulNormalize, mulTransposeBoth, mulTransposeLeft, mulTransposeRight, negate, negate, normalize, normalize, normalizeCP, normalizeCP, rotX, rotY, rotZ, set, set, set, set, set, set, set, set, setColumn, setColumn, setColumn, setElement, setIdentity, setRow, setRow, setRow, setScale, setZero, sub, sub, transform, transform, transpose, transpose |
Methods inherited from class Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface XMatrix |
---|
getElement, invert, negate, setElement, setIdentity, setZero, transpose |
Field Detail |
---|
public static final int SIZE
Constructor Detail |
---|
public Matrix3()
public Matrix3(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
public Matrix3(AffineTransform transform)
public Matrix3(Matrix matrix)
Method Detail |
---|
public final int getNumRow()
getNumRow
in interface XMatrix
getNumRow
in interface Matrix
public final int getNumCol()
getNumCol
in interface XMatrix
getNumCol
in interface Matrix
public final boolean isIdentity()
true
if this matrix is an identity matrix.
isIdentity
in interface XMatrix
isIdentity
in interface Matrix
true
if this matrix is an identity matrix.public final 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
.
isIdentity
in interface XMatrix
tolerance
- The tolerance value.
true
if this matrix is close enough to the identity matrix
given the tolerance value.public final 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.
isAffine
in interface XMatrix
true
if this matrix is affine.public final boolean isNaN()
true
if at least one value is NaN
.
public final 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.
multiply
in interface XMatrix
matrix
- The matrix to multiply to this matrix.public void setMatrix(AffineTransform transform)
public boolean equalsAffine(AffineTransform transform)
true
if this matrix is equals to the specified affine transform.
public boolean equals(Matrix matrix, double tolerance)
GMatrix.epsilonEquals(matrix,
tolerance)
. The method name is intentionally different in order to avoid
ambiguities at compile-time.
equals
in interface XMatrix
matrix
- The matrix to compare.tolerance
- The tolerance value.
true
if this matrix is close enough to the given matrix
given the tolerance value.public String toString()
toString
in class Matrix3d
public Matrix3 clone()
clone
in interface Matrix
clone
in class Matrix3d
Object.clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |