public abstract class Matrix3DFeatures
extends java.lang.Object
Matrix3DTools
for
operations on a matrix 3D.Modifier and Type | Field | Description |
---|---|---|
static double |
EPS_CHECK_2D |
Default tolerance for determining whether a matrix 3D represents a 2D transformation or not.
|
static double |
EPS_CHECK_IDENTITY |
Default tolerance for determining whether a matrix 3D represents the identity matrix or not.
|
static double |
EPS_CHECK_ROTATION |
Default tolerance for determining whether a matrix 3D represents a 3D rotation matrix or not.
|
static double |
EPS_CHECK_SKEW |
Default tolerance for determining whether a matrix 3D is skew symmetric or not.
|
Constructor | Description |
---|---|
Matrix3DFeatures() |
Modifier and Type | Method | Description |
---|---|---|
static void |
checkIfRotationMatrix(double[] matrixArray) |
Asserts that the given matrix is a rotation matrix.
|
static void |
checkIfRotationMatrix(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22) |
Asserts that the given coefficients describe a rotation matrix.
|
static void |
checkIfRotationMatrix(org.ejml.data.DenseMatrix64F matrix) |
Asserts that the given dense-matrix is a rotation matrix.
|
static void |
checkMatrixSize(org.ejml.data.DenseMatrix64F matrix) |
Asserts that the given matrix is a 3-by-3 matrix.
|
static double |
determinant(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22) |
Computes the determinant of the matrix described by the given 9 coefficients.
|
static boolean |
epsilonEquals(Matrix3DReadOnly m1,
Matrix3DReadOnly m2,
double epsilon) |
Tests on a per component basis if the two given matrices are equal to an
epsilon . |
static boolean |
equals(Matrix3DReadOnly m1,
Matrix3DReadOnly m2) |
Tests on a per coefficient basis if the two matrices
m1 and m2 are exactly
equal. |
static boolean |
isIdentity(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22) |
Tests if the matrix described by the given 9 coefficients is equal to the identity matrix.
|
static boolean |
isIdentity(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22,
double epsilon) |
Tests if the matrix described by the given 9 coefficients is equal to the identity matrix.
|
static boolean |
isMatrix2D(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22,
double epsilon) |
Verify the matrix described by the 9 given coefficients is a transformation in the XY plane.
|
static boolean |
isMatrixSkewSymmetric(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22) |
Verify if the matrix described by the 9 given coefficients is skew symmetric:
|
static boolean |
isMatrixSkewSymmetric(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22,
double epsilon) |
Verify if the matrix described by the 9 given coefficients is skew symmetric:
|
static boolean |
isRotationMatrix(double[] matrixArray) |
Tests if the given matrix is a rotation matrix.
|
static boolean |
isRotationMatrix(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22) |
Verify if the given coefficients describe a rotation matrix.
|
static boolean |
isRotationMatrix(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22,
double epsilon) |
Verify if the given coefficients describe a rotation matrix.
|
static boolean |
isRotationMatrix(org.ejml.data.DenseMatrix64F matrix) |
Tests if the given matrix is a rotation matrix.
|
public static final double EPS_CHECK_IDENTITY
public static final double EPS_CHECK_ROTATION
public static final double EPS_CHECK_2D
public static final double EPS_CHECK_SKEW
public static double determinant(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
m00
- first matrix element in the first row.m01
- second matrix element in the first row.m02
- third matrix element in the first row.m10
- first matrix element in the second row.m11
- second matrix element in the second row.m12
- third matrix element in the second row.m20
- first matrix element in the third row.m21
- second matrix element in the third row.m22
- third matrix element in the third row.public static void checkIfRotationMatrix(org.ejml.data.DenseMatrix64F matrix)
The given matrix is a rotation matrix if:
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
.
matrix
- the matrix to verify. Not modified.NotARotationMatrixException
- if the matrix is not a rotation matrix.public static void checkIfRotationMatrix(double[] matrixArray)
The given matrix is a rotation matrix if:
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
.
matrixArray
- the matrix to verify, not null, not modified. The array is expected to be
encoded in a row-major format.NotARotationMatrixException
- if the matrix is not a rotation matrix.public static void checkIfRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
This method is meant for internal use only.
The given matrix is a rotation matrix if:
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
.
m00
- first matrix element in the first row.m01
- second matrix element in the first row.m02
- third matrix element in the first row.m10
- first matrix element in the second row.m11
- second matrix element in the second row.m12
- third matrix element in the second row.m20
- first matrix element in the third row.m21
- second matrix element in the third row.m22
- third matrix element in the third row.NotARotationMatrixException
- if the matrix is not a rotation matrix.public static void checkMatrixSize(org.ejml.data.DenseMatrix64F matrix)
matrix
- the matrix to verify. Not modified.java.lang.RuntimeException
- if the matrix is not a 3-by-3 matrix.public static boolean isIdentity(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
The assertion is done on a per coefficient basis using EPS_CHECK_IDENTITY
as the
tolerance.
m00
- first matrix element in the first row.m01
- second matrix element in the first row.m02
- third matrix element in the first row.m10
- first matrix element in the second row.m11
- second matrix element in the second row.m12
- third matrix element in the second row.m20
- first matrix element in the third row.m21
- second matrix element in the third row.m22
- third matrix element in the third row.true
if the matrix is considered to be equal to the identity matrix,
false
otherwise.public static boolean isIdentity(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22, double epsilon)
The assertion is done on a per coefficient basis using epsilon
as the tolerance.
m00
- first matrix element in the first row.m01
- second matrix element in the first row.m02
- third matrix element in the first row.m10
- first matrix element in the second row.m11
- second matrix element in the second row.m12
- third matrix element in the second row.m20
- first matrix element in the third row.m21
- second matrix element in the third row.m22
- third matrix element in the third row.epsilon
- the tolerance as shown above.true
if the matrix is considered to be equal to the identity matrix,
false
otherwise.public static boolean isRotationMatrix(org.ejml.data.DenseMatrix64F matrix)
The given matrix is a rotation matrix if:
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
.
matrix
- the matrix to verify, not null, not modified.true
if the given matrix is a rotation matrix, false
otherwise.public static boolean isRotationMatrix(double[] matrixArray)
The given matrix is a rotation matrix if:
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
.
matrixArray
- the matrix to verify, not null, not modified. The array is expected to be
encoded in a row-major format.true
if the given matrix is a rotation matrix, false
otherwise.public static boolean isRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
The given matrix is a rotation matrix if:
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
.
m00
- first matrix element in the first row.m01
- second matrix element in the first row.m02
- third matrix element in the first row.m10
- first matrix element in the second row.m11
- second matrix element in the second row.m12
- third matrix element in the second row.m20
- first matrix element in the third row.m21
- second matrix element in the third row.m22
- third matrix element in the third row.true
if the given matrix is a rotation matrix, false
otherwise.public static boolean isRotationMatrix(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22, double epsilon)
The given matrix is a rotation matrix if:
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
,
EPS_CHECK_ROTATION
.
m00
- first matrix element in the first row.m01
- second matrix element in the first row.m02
- third matrix element in the first row.m10
- first matrix element in the second row.m11
- second matrix element in the second row.m12
- third matrix element in the second row.m20
- first matrix element in the third row.m21
- second matrix element in the third row.m22
- third matrix element in the third row.epsilon
- the tolerance as shown above.true
if the given matrix is a rotation matrix, false
otherwise.public static boolean isMatrix2D(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22, double epsilon)
The matrix is considered to be a 2D transformation in the XY plane if:
epsilon
,
m20
, m02
, m21
, and m12
are equal to 0.0 +/-
epsilon
.
m00
- first matrix element in the first row.m01
- second matrix element in the first row.m02
- third matrix element in the first row.m10
- first matrix element in the second row.m11
- second matrix element in the second row.m12
- third matrix element in the second row.m20
- first matrix element in the third row.m21
- second matrix element in the third row.m22
- third matrix element in the third row.epsilon
- the tolerance used as shown above.true
if the given matrix describes a 2D transformation in the XY plane,
false
otherwise.public static boolean isMatrixSkewSymmetric(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
| 0 -z y | m = | z 0 -x | | -y x 0 |
The given matrix is considered to be skew symmetric if:
EPS_CHECK_SKEW
,
m10
, m01
), (m12
,
m21
), and (m20
, m02
) are equal to 0.0 +/- EPS_CHECK_SKEW
.
m00
- first matrix element in the first row.m01
- second matrix element in the first row.m02
- third matrix element in the first row.m10
- first matrix element in the second row.m11
- second matrix element in the second row.m12
- third matrix element in the second row.m20
- first matrix element in the third row.m21
- second matrix element in the third row.m22
- third matrix element in the third row.true
if the matrix is skew symmetric, false
otherwise.public static boolean isMatrixSkewSymmetric(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22, double epsilon)
| 0 -z y | m = | z 0 -x | | -y x 0 |
The given matrix is considered to be skew symmetric if:
EPS_CHECK_SKEW
,
m10
, m01
), (m12
,
m21
), and (m20
, m02
) are equal to 0.0 +/- EPS_CHECK_SKEW
.
m00
- first matrix element in the first row.m01
- second matrix element in the first row.m02
- third matrix element in the first row.m10
- first matrix element in the second row.m11
- second matrix element in the second row.m12
- third matrix element in the second row.m20
- first matrix element in the third row.m21
- second matrix element in the third row.m22
- third matrix element in the third row.epsilon
- the tolerance used as shown above.true
if the matrix is skew symmetric, false
otherwise.public static boolean epsilonEquals(Matrix3DReadOnly m1, Matrix3DReadOnly m2, double epsilon)
epsilon
.m1
- the first matrix. Not modified.m2
- the second matrix. Not modified.epsilon
- the tolerance to use when comparing each component.true
if the two matrices are equal, false
otherwise.public static boolean equals(Matrix3DReadOnly m1, Matrix3DReadOnly m2)
m1
and m2
are exactly
equal.
If any of the two matrices is null
, this methods returns false
.
m1
- the first matrix. Not modified.m2
- the second matrix. Not modified.true
if the two matrices are exactly equal, false
otherwise or if
at least one of the two matrices is null
.