public final class Matrix3By3 extends Object implements IEquatable<Matrix3By3>, IEquatableEpsilon<Matrix3By3>, ImmutableValueType
For more information, see the Coordinates topic.
Constructor and Description |
---|
Matrix3By3()
Initializes a new instance.
|
Matrix3By3(AngleAxisRotation rotation)
Initializes a new instance from an angle axis rotation.
|
Matrix3By3(double m11,
double m12,
double m13,
double m21,
double m22,
double m23,
double m31,
double m32,
double m33)
Initializes a new instance from elements.
|
Matrix3By3(EigenDecomposition eigenDecomposition)
Initializes a new instance from an
EigenDecomposition . |
Matrix3By3(ElementaryRotation rotation)
Initializes a new instance representing an elementary rotation about one of the original axes.
|
Matrix3By3(EulerSequence sequence)
Initializes a new instance from the provided
EulerSequence . |
Matrix3By3(Matrix3By3Symmetric matrix)
Initializes a new instance from a
Matrix3By3Symmetric . |
Matrix3By3(UnitQuaternion quaternion)
Initializes a new instance from a
UnitQuaternion . |
Matrix3By3(YawPitchRoll sequence)
Initializes a new instance from the provided
YawPitchRoll sequence. |
Modifier and Type | Method and Description |
---|---|
Matrix3By3 |
add(Matrix3By3 matrix)
Adds a matrix to this matrix.
|
static Matrix3By3 |
add(Matrix3By3 left,
Matrix3By3 right)
Adds a matrix to this matrix.
|
static Matrix3By3 |
add(Matrix3By3 left,
Matrix3By3Symmetric right)
Adds a matrix to this matrix.
|
Matrix3By3 |
add(Matrix3By3Symmetric matrix)
Adds a matrix to this matrix.
|
static Matrix3By3 |
crossProductEquivalentMatrix(Cartesian vector)
Forms a
Matrix3By3 from the input vector such that the result of the cross product of the input vector
with another vector is equivalent to premultiplying the other vector by the returned matrix. |
static Matrix3By3 |
crossProductEquivalentMatrix(UnitCartesian vector)
Forms a
Matrix3By3 from the input vector such that the result of the cross product of the input unit vector
with another vector is equivalent to premultiplying the other vector by the returned matrix. |
double |
determinant()
Calculates the determinant of the matrix.
|
static Matrix3By3 |
diagonalMatrix(Cartesian vector)
Forms a diagonal matrix from the input vector.
|
static Matrix3By3 |
diagonalMatrix(double m11,
double m22,
double m33)
Forms a diagonal matrix from the input elements.
|
static Matrix3By3 |
diagonalMatrix(UnitCartesian vector)
Forms a diagonal matrix from the input unit vector.
|
static boolean |
equals(Matrix3By3 left,
Matrix3By3 right)
Returns
true if the two instances are exactly equal. |
boolean |
equals(Matrix3By3Symmetric other)
Indicates whether another instance of this type is exactly equal to this instance.
|
boolean |
equals(Object obj)
Indicates whether another object is exactly equal to this instance.
|
boolean |
equalsEpsilon(Matrix3By3 other,
double epsilon)
Returns true if all of the elements of this matrix are within
epsilon
of the same elements of the specified matrix. |
boolean |
equalsType(Matrix3By3 other)
Indicates whether another instance of this type is exactly equal to this instance.
|
double |
frobeniusNorm()
Computes the Frobenius norm of the matrix.
|
double |
frobeniusNormSquared()
Computes the square of the Frobenius norm of the matrix.
|
double |
get(int row,
int column)
Accesses the matrix elements using zero-based indexing.
|
static Matrix3By3 |
getIdentity()
Gets a
Matrix3By3 representing an identity transformation. |
boolean |
getIsUndefined()
Gets a value indicating whether any of the matrix values are
Double.NaN . |
double |
getM11()
Gets the element in the first row, first column.
|
double |
getM12()
Gets the element in the first row, second column.
|
double |
getM13()
Gets the element in the first row, third column.
|
double |
getM21()
Gets the element in the second row, first column.
|
double |
getM22()
Gets the element in the second row, second column.
|
double |
getM23()
Gets the element in the second row, third column.
|
double |
getM31()
Gets the element in the third row, first column.
|
double |
getM32()
Gets the element in the third row, second column.
|
double |
getM33()
Gets the element in the third row, third column.
|
static Matrix3By3 |
getUndefined()
Gets a
Matrix3By3 with elements of Double.NaN . |
static Matrix3By3 |
getZero()
Gets a
Matrix3By3 representing the zero matrix. |
int |
hashCode()
Returns a hash code for this instance, which is suitable for use in hashing algorithms and data structures like a hash table.
|
Matrix3By3 |
invert()
Inverts the matrix.
|
Cartesian |
multiply(Cartesian vector)
Forms a new Cartesian vector as the product of this 3-by-3 matrix and the provided Cartesian vector.
|
Matrix3By3 |
multiply(double scalar)
Multiplies this matrix by a scalar.
|
static Matrix3By3 |
multiply(double scalar,
Matrix3By3 matrix)
Multiplies a scalar by a matrix.
|
Matrix3By3 |
multiply(ElementaryRotation rotation)
Forms a new 3-by-3 matrix as the product of this 3-by-3 matrix and the provided elementary rotation.
|
Matrix3By3 |
multiply(Matrix3By3 matrix)
Multiplies this matrix by a matrix.
|
static Cartesian |
multiply(Matrix3By3 matrix,
Cartesian vector)
Multiplies the 3-by-3 matrix by the Cartesian vector.
|
static Matrix3By3 |
multiply(Matrix3By3 matrix,
double scalar)
Multiplies a matrix by a scalar.
|
static Matrix3By3 |
multiply(Matrix3By3 matrix,
ElementaryRotation rotation)
Multiplies a 3-by-3 matrix by an
ElementaryRotation . |
static Matrix3By3 |
multiply(Matrix3By3 left,
Matrix3By3 right)
Multiplies the left matrix by the right matrix.
|
static Matrix3By3 |
multiply(Matrix3By3 left,
Matrix3By3Symmetric right)
Multiplies the left matrix by the right matrix.
|
Matrix3By3 |
multiply(Matrix3By3Symmetric matrix)
Multiplies this matrix by a matrix.
|
static boolean |
notEquals(Matrix3By3 left,
Matrix3By3 right)
Returns
true if the two instances are not exactly equal. |
Matrix3By3 |
subtract(Matrix3By3 matrix)
Subtracts a matrix from this matrix.
|
static Matrix3By3 |
subtract(Matrix3By3 left,
Matrix3By3 right)
Subtracts the second matrix from the first.
|
static Matrix3By3 |
subtract(Matrix3By3 left,
Matrix3By3Symmetric right)
Subtracts the second matrix from the first.
|
Matrix3By3 |
subtract(Matrix3By3Symmetric matrix)
Subtracts a matrix from this matrix.
|
Matrix3By3 |
transpose()
Transposes the matrix.
|
public Matrix3By3()
public Matrix3By3(@Nonnull EulerSequence sequence)
EulerSequence
.sequence
- The Euler sequence of rotations.public Matrix3By3(@Nonnull YawPitchRoll sequence)
YawPitchRoll
sequence.sequence
- The yaw-pitch-roll sequence of rotations.public Matrix3By3(@Nonnull ElementaryRotation rotation)
rotation
- The elementary rotation.UnsupportedCaseException
- Thrown if the Axis
(get
) property of rotation
is
not AxisIndicator.FIRST
, AxisIndicator.SECOND
, or
AxisIndicator.THIRD
.public Matrix3By3(@Nonnull AngleAxisRotation rotation)
rotation
- The angle axis rotation.public Matrix3By3(@Nonnull UnitQuaternion quaternion)
UnitQuaternion
.quaternion
- The quaternion.public Matrix3By3(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33)
m11
- 1,1m12
- 1,2m13
- 1,3m21
- 2,1m22
- 2,2m23
- 2,3m31
- 3,1m32
- 3,2m33
- 3,3public Matrix3By3(@Nonnull Matrix3By3Symmetric matrix)
Matrix3By3Symmetric
.matrix
- The symmetric matrix.public Matrix3By3(@Nonnull EigenDecomposition eigenDecomposition)
EigenDecomposition
.eigenDecomposition
- The eigenvectors and eigenvalues of the matrix.@Nonnull public static Matrix3By3 getIdentity()
Matrix3By3
representing an identity transformation.@Nonnull public static Matrix3By3 getUndefined()
Matrix3By3
with elements of Double.NaN
.
Use IsUndefined
(get
) to test whether a Matrix3By3
instance
is undefined since it will return true
if any of the element values
are Double.NaN
.
@Nonnull public static Matrix3By3 getZero()
Matrix3By3
representing the zero matrix.@Nonnull public static Matrix3By3 crossProductEquivalentMatrix(@Nonnull Cartesian vector)
Matrix3By3
from the input vector such that the result of the cross product of the input vector
with another vector is equivalent to premultiplying the other vector by the returned matrix.vector
- The vector for which the cross product equivalent matrix is desired.@Nonnull public static Matrix3By3 crossProductEquivalentMatrix(@Nonnull UnitCartesian vector)
Matrix3By3
from the input vector such that the result of the cross product of the input unit vector
with another vector is equivalent to premultiplying the other vector by the returned matrix.vector
- The unit vector for which the cross product equivalent matrix is desired.@Nonnull public static Matrix3By3 diagonalMatrix(double m11, double m22, double m33)
m11
- 1,1m22
- 2,2m33
- 3,3@Nonnull public static Matrix3By3 diagonalMatrix(@Nonnull Cartesian vector)
vector
- The vector.@Nonnull public static Matrix3By3 diagonalMatrix(@Nonnull UnitCartesian vector)
vector
- The vector.public final double get(int row, int column)
row
- The row index.column
- The column index.ArgumentOutOfRangeException
- Thrown when either row
or column
is less than 0 or greater than 2.public final double getM11()
public final double getM12()
public final double getM13()
public final double getM21()
public final double getM22()
public final double getM23()
public final double getM31()
public final double getM32()
public final double getM33()
@Nonnull public final Matrix3By3 transpose()
public final double determinant()
@Nonnull public final Matrix3By3 invert()
ArithmeticException
- Thrown when the absolute value of the Matrix3By3.determinant()
is less than
Constants.Epsilon15
.public final boolean getIsUndefined()
Double.NaN
.public final double frobeniusNormSquared()
public final double frobeniusNorm()
@Nonnull public final Matrix3By3 add(@Nonnull Matrix3By3 matrix)
matrix
- The matrix.@Nonnull public final Matrix3By3 add(@Nonnull Matrix3By3Symmetric matrix)
matrix
- The matrix.@Nonnull public final Matrix3By3 subtract(@Nonnull Matrix3By3 matrix)
matrix
- The matrix to subtract.@Nonnull public final Matrix3By3 subtract(@Nonnull Matrix3By3Symmetric matrix)
matrix
- The matrix to subtract.@Nonnull public final Matrix3By3 multiply(double scalar)
scalar
- The scalar to multiply by.@Nonnull public final Matrix3By3 multiply(@Nonnull ElementaryRotation rotation)
rotation
- The elementary rotation.UnsupportedCaseException
- Thrown if the Axis
(get
) property of rotation
is
not AxisIndicator.FIRST
, AxisIndicator.SECOND
, or
AxisIndicator.THIRD
.@Nonnull public final Matrix3By3 multiply(@Nonnull Matrix3By3 matrix)
matrix
- The matrix to multiply by.@Nonnull public final Matrix3By3 multiply(@Nonnull Matrix3By3Symmetric matrix)
matrix
- The matrix to multiply by.@Nonnull public final Cartesian multiply(@Nonnull Cartesian vector)
vector
- The vector.@Nonnull public static Matrix3By3 multiply(@Nonnull Matrix3By3 matrix, double scalar)
matrix
- The matrix.scalar
- The scalar.@Nonnull public static Matrix3By3 multiply(double scalar, @Nonnull Matrix3By3 matrix)
scalar
- The scalar.matrix
- The matrix.@Nonnull public static Matrix3By3 multiply(@Nonnull Matrix3By3 matrix, @Nonnull ElementaryRotation rotation)
ElementaryRotation
.matrix
- The matrix.rotation
- The elementary rotation.@Nonnull public static Matrix3By3 multiply(@Nonnull Matrix3By3 left, @Nonnull Matrix3By3 right)
left
- The matrix on the left.right
- The matrix on the right.@Nonnull public static Matrix3By3 multiply(@Nonnull Matrix3By3 left, @Nonnull Matrix3By3Symmetric right)
left
- The matrix on the left.right
- The matrix on the right.@Nonnull public static Cartesian multiply(@Nonnull Matrix3By3 matrix, @Nonnull Cartesian vector)
matrix
- The matrix.vector
- The vector.@Nonnull public static Matrix3By3 add(@Nonnull Matrix3By3 left, @Nonnull Matrix3By3 right)
left
- The left matrix.right
- The right matrix.@Nonnull public static Matrix3By3 add(@Nonnull Matrix3By3 left, @Nonnull Matrix3By3Symmetric right)
left
- The left matrix.right
- The right matrix.@Nonnull public static Matrix3By3 subtract(@Nonnull Matrix3By3 left, @Nonnull Matrix3By3 right)
left
- The left matrix.right
- The right matrix.@Nonnull public static Matrix3By3 subtract(@Nonnull Matrix3By3 left, @Nonnull Matrix3By3Symmetric right)
left
- The left matrix.right
- The right matrix.public boolean equals(Object obj)
equals
in class Object
obj
- The object to compare to this instance.true
if obj
is an instance of this type and represents the same value as this instance; otherwise false
.Object.hashCode()
,
HashMap
public final boolean equalsType(@Nonnull Matrix3By3 other)
equalsType
in interface IEquatable<Matrix3By3>
other
- The instance to compare to this instance.true
if other
represents the same value as this instance; otherwise false
.public final boolean equals(@Nonnull Matrix3By3Symmetric other)
other
- The instance to compare to this instance.true
if other
represents the same value as this instance; otherwise false
.public final boolean equalsEpsilon(@Nonnull Matrix3By3 other, double epsilon)
epsilon
of the same elements of the specified matrix. That is, in order for the matrices to be
considered equal (and for this function to return true), the absolute value of the
difference between each of their elements must be less than or equal to epsilon
.equalsEpsilon
in interface IEquatableEpsilon<Matrix3By3>
other
- The Matrix3By3
to compare to this matrix.epsilon
- The largest difference between the elements of the matrices for which they will be considered equal.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public static boolean equals(@Nonnull Matrix3By3 left, @Nonnull Matrix3By3 right)
true
if the two instances are exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
represents the same value as right
; otherwise false
.public static boolean notEquals(@Nonnull Matrix3By3 left, @Nonnull Matrix3By3 right)
true
if the two instances are not exactly equal.left
- The instance to compare to right
.right
- The instance to compare to left
.true
if left
does not represent the same value as right
; otherwise false
.