public final class Matrix3By3Symmetric extends Object implements IEquatable<Matrix3By3Symmetric>, IEquatableEpsilon<Matrix3By3Symmetric>, ImmutableValueType
Constructor and Description |
---|
Matrix3By3Symmetric()
Initializes a new instance.
|
Matrix3By3Symmetric(Matrix3By3 matrix)
Initializes this instance as a symmetrical matrix constructed
from the given symmetrical or nearly symmetrical
Matrix3By3 . |
Modifier and Type | Method and Description |
---|---|
Matrix3By3 |
add(Matrix3By3 matrix)
Adds a matrix to this matrix.
|
Matrix3By3Symmetric |
add(Matrix3By3Symmetric matrix)
Adds a matrix to this matrix.
|
static Matrix3By3 |
add(Matrix3By3Symmetric left,
Matrix3By3 right)
Adds a matrix to this matrix.
|
static Matrix3By3Symmetric |
add(Matrix3By3Symmetric left,
Matrix3By3Symmetric right)
Adds a matrix to this matrix.
|
double |
determinant()
Calculates the determinant of the matrix.
|
static Matrix3By3Symmetric |
diagonalMatrix(Cartesian vector)
Forms a diagonal matrix from the input vector.
|
static Matrix3By3Symmetric |
diagonalMatrix(double m11,
double m22,
double m33)
Forms a diagonal matrix from the input elements.
|
static Matrix3By3Symmetric |
diagonalMatrix(UnitCartesian vector)
Forms a diagonal matrix from the input unit vector.
|
EigenDecomposition |
eigenDecomposition()
Determines the eigenvectors and eigenvalues of the matrix.
|
boolean |
equals(Matrix3By3 other)
Indicates whether another instance of this type is exactly equal to this instance.
|
static boolean |
equals(Matrix3By3Symmetric left,
Matrix3By3Symmetric right)
Returns
true if the two instances are exactly equal. |
boolean |
equals(Object obj)
Indicates whether another object is exactly equal to this instance.
|
boolean |
equalsEpsilon(Matrix3By3Symmetric 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(Matrix3By3Symmetric 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.
|
static Matrix3By3Symmetric |
fromLowerTriangular(double m11,
double m21,
double m22,
double m31,
double m32,
double m33)
Forms a symmetric matrix from the lower triangular elements.
|
static Matrix3By3Symmetric |
fromLowerTriangular(Matrix3By3 matrix)
Forms a symmetric matrix from the lower triangular elements of the provided matrix.
|
static Matrix3By3Symmetric |
fromUpperTriangular(double m11,
double m12,
double m13,
double m22,
double m23,
double m33)
Forms a symmetric matrix from the upper triangular elements.
|
static Matrix3By3Symmetric |
fromUpperTriangular(Matrix3By3 matrix)
Forms a symmetric matrix from the upper triangular elements of the provided matrix.
|
double |
get(int row,
int column)
Accesses the matrix elements using zero-based indexing.
|
static Matrix3By3Symmetric |
getIdentity()
Gets a
Matrix3By3Symmetric 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 Matrix3By3Symmetric |
getUndefined()
Gets a
Matrix3By3Symmetric with elements of Double.NaN . |
static Matrix3By3Symmetric |
getZero()
Gets a
Matrix3By3Symmetric 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.
|
Matrix3By3Symmetric |
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.
|
Matrix3By3Symmetric |
multiply(double scalar)
Multiplies this matrix by a scalar.
|
static Matrix3By3Symmetric |
multiply(double scalar,
Matrix3By3Symmetric matrix)
Multiplies a scalar by a matrix.
|
Matrix3By3 |
multiply(Matrix3By3 matrix)
Multiplies this matrix by a matrix.
|
Matrix3By3Symmetric |
multiply(Matrix3By3Symmetric matrix)
Multiplies this matrix by a matrix.
|
static Cartesian |
multiply(Matrix3By3Symmetric matrix,
Cartesian vector)
Multiplies the 3-by-3 matrix by the Cartesian vector.
|
static Matrix3By3Symmetric |
multiply(Matrix3By3Symmetric matrix,
double scalar)
Multiplies a matrix by a scalar.
|
static Matrix3By3 |
multiply(Matrix3By3Symmetric left,
Matrix3By3 right)
Multiplies the left matrix by the right matrix.
|
static Matrix3By3Symmetric |
multiply(Matrix3By3Symmetric left,
Matrix3By3Symmetric right)
Multiplies the left matrix by the right matrix.
|
static boolean |
notEquals(Matrix3By3Symmetric left,
Matrix3By3Symmetric right)
Returns
true if the two instances are not exactly equal. |
Matrix3By3 |
subtract(Matrix3By3 matrix)
Subtracts a matrix from this matrix.
|
Matrix3By3Symmetric |
subtract(Matrix3By3Symmetric matrix)
Subtracts a matrix from this matrix.
|
static Matrix3By3 |
subtract(Matrix3By3Symmetric left,
Matrix3By3 right)
Subtracts the second matrix from the first.
|
static Matrix3By3Symmetric |
subtract(Matrix3By3Symmetric left,
Matrix3By3Symmetric right)
Subtracts the second matrix from the first.
|
Matrix3By3Symmetric |
transpose()
Transposes the matrix.
|
public Matrix3By3Symmetric()
public Matrix3By3Symmetric(@Nonnull Matrix3By3 matrix)
Matrix3By3
.
Mxy and Myx of this matrix will be equal to the average Mxy and Myx of the given matrix.matrix
- The symmetrical or nearly symmetrical Matrix3By3
.@Nonnull public static Matrix3By3Symmetric getIdentity()
Matrix3By3Symmetric
representing an identity transformation.@Nonnull public static Matrix3By3Symmetric getUndefined()
Matrix3By3Symmetric
with elements of Double.NaN
.
Use IsUndefined
(get
) to test whether a Matrix3By3Symmetric
instance
is undefined since it will return true
if any of the element values
are Double.NaN
.
@Nonnull public static Matrix3By3Symmetric getZero()
Matrix3By3Symmetric
representing the zero matrix.@Nonnull public static Matrix3By3Symmetric diagonalMatrix(double m11, double m22, double m33)
m11
- 1,1m22
- 2,2m33
- 3,3@Nonnull public static Matrix3By3Symmetric diagonalMatrix(@Nonnull Cartesian vector)
vector
- The vector.@Nonnull public static Matrix3By3Symmetric diagonalMatrix(@Nonnull UnitCartesian vector)
vector
- The vector.@Nonnull public static Matrix3By3Symmetric fromLowerTriangular(double m11, double m21, double m22, double m31, double m32, double m33)
m11
- 1,1m21
- 2,1m22
- 2,2m31
- 3,1m32
- 3,2m33
- 3,3@Nonnull public static Matrix3By3Symmetric fromLowerTriangular(@Nonnull Matrix3By3 matrix)
matrix
- The original matrix.@Nonnull public static Matrix3By3Symmetric fromUpperTriangular(double m11, double m12, double m13, double m22, double m23, double m33)
m11
- 1,1m12
- 1,2m13
- 1,3m22
- 2,2m23
- 2,3m33
- 3,3@Nonnull public static Matrix3By3Symmetric fromUpperTriangular(@Nonnull Matrix3By3 matrix)
matrix
- The original matrix.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 Matrix3By3Symmetric transpose()
public final double determinant()
@Nonnull public final Matrix3By3Symmetric invert()
ArithmeticException
- Thrown when the absolute value of the Matrix3By3Symmetric.determinant()
is less than
Constants.Epsilon15
.public final boolean getIsUndefined()
Double.NaN
.public final double frobeniusNormSquared()
public final double frobeniusNorm()
public final EigenDecomposition eigenDecomposition()
Values
(get
) matrix.@Nonnull public final Matrix3By3Symmetric add(@Nonnull Matrix3By3Symmetric matrix)
matrix
- The matrix.@Nonnull public final Matrix3By3 add(@Nonnull Matrix3By3 matrix)
matrix
- The matrix.@Nonnull public final Matrix3By3Symmetric subtract(@Nonnull Matrix3By3Symmetric matrix)
matrix
- The matrix to subtract.@Nonnull public final Matrix3By3 subtract(@Nonnull Matrix3By3 matrix)
matrix
- The matrix to subtract.@Nonnull public final Matrix3By3Symmetric multiply(double scalar)
scalar
- The scalar to multiply by.@Nonnull public final Matrix3By3Symmetric multiply(@Nonnull Matrix3By3Symmetric matrix)
matrix
- The matrix to multiply by.@Nonnull public final Matrix3By3 multiply(@Nonnull Matrix3By3 matrix)
matrix
- The matrix to multiply by.@Nonnull public final Cartesian multiply(@Nonnull Cartesian vector)
vector
- The vector.@Nonnull public static Matrix3By3Symmetric multiply(@Nonnull Matrix3By3Symmetric matrix, double scalar)
matrix
- The matrix.scalar
- The scalar.@Nonnull public static Matrix3By3Symmetric multiply(double scalar, @Nonnull Matrix3By3Symmetric matrix)
scalar
- The scalar.matrix
- The matrix.@Nonnull public static Matrix3By3Symmetric multiply(@Nonnull Matrix3By3Symmetric left, @Nonnull Matrix3By3Symmetric right)
left
- The matrix on the left.right
- The matrix on the right.@Nonnull public static Matrix3By3 multiply(@Nonnull Matrix3By3Symmetric left, @Nonnull Matrix3By3 right)
left
- The matrix on the left.right
- The matrix on the right.@Nonnull public static Cartesian multiply(@Nonnull Matrix3By3Symmetric matrix, @Nonnull Cartesian vector)
matrix
- The matrix.vector
- The vector.@Nonnull public static Matrix3By3Symmetric add(@Nonnull Matrix3By3Symmetric left, @Nonnull Matrix3By3Symmetric right)
left
- The left matrix.right
- The right matrix.@Nonnull public static Matrix3By3 add(@Nonnull Matrix3By3Symmetric left, @Nonnull Matrix3By3 right)
left
- The left matrix.right
- The right matrix.@Nonnull public static Matrix3By3Symmetric subtract(@Nonnull Matrix3By3Symmetric left, @Nonnull Matrix3By3Symmetric right)
left
- The left matrix.right
- The right matrix.@Nonnull public static Matrix3By3 subtract(@Nonnull Matrix3By3Symmetric left, @Nonnull Matrix3By3 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 Matrix3By3Symmetric other)
equalsType
in interface IEquatable<Matrix3By3Symmetric>
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 Matrix3By3 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 Matrix3By3Symmetric 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<Matrix3By3Symmetric>
other
- The Matrix3By3Symmetric
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 Matrix3By3Symmetric left, @Nonnull Matrix3By3Symmetric 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 Matrix3By3Symmetric left, @Nonnull Matrix3By3Symmetric 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
.