|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectMatrix4d
Matrix4
public class Matrix4
A matrix of fixed 4×4 size. This specialized matrix provides
better accuracy than GeneralMatrix
for matrix inversion and multiplication. It is used
primarily for supporting datum shifts.
Field Summary | |
---|---|
static int |
SIZE
The matrix size, which is 4. |
Fields inherited from class Matrix4d |
---|
m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33 |
Constructor Summary | |
---|---|
Matrix4()
Creates a new identity matrix. |
|
Matrix4(double m00,
double m01,
double m02,
double m03,
double m10,
double m11,
double m12,
double m13,
double m20,
double m21,
double m22,
double m23,
double m30,
double m31,
double m32,
double m33)
Creates a new matrix initialized to the specified values. |
|
Matrix4(Matrix matrix)
Creates a new matrix initialized to the same value than the specified one. |
Method Summary | |
---|---|
Matrix4 |
clone()
Returns a clone of this matrix. |
boolean |
equals(Matrix matrix,
double tolerance)
Compares the element values regardless the object class. |
int |
getNumCol()
Returns the number of colmuns in this matrix, which is always 4 in this implementation. |
int |
getNumRow()
Returns the number of rows in this matrix, which is always 4 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. |
void |
multiply(Matrix matrix)
Sets the value of this matrix to the result of multiplying itself with the specified matrix. |
String |
toString()
Returns a string representation of this matrix. |
Methods inherited from class Matrix4d |
---|
add, add, add, add, determinant, epsilonEquals, epsilonEquals, equals, equals, get, get, get, get, get, get, get, getColumn, getColumn, getElement, getRotationScale, getRotationScale, getRow, getRow, getScale, hashCode, invert, invert, mul, mul, mul, mul, mulTransposeBoth, mulTransposeLeft, mulTransposeRight, negate, negate, rotX, rotY, rotZ, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setColumn, setColumn, setColumn, setElement, setIdentity, setRotation, setRotation, setRotation, setRotation, setRotation, setRotationScale, setRotationScale, setRow, setRow, setRow, setScale, setTranslation, setZero, sub, sub, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, 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 Matrix4()
public Matrix4(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33)
public Matrix4(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
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 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 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 Matrix4d
public Matrix4 clone()
clone
in interface Matrix
clone
in class Matrix4d
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |