public class Matrix3
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
double[] |
m
The matrix's components, stored in row-major order.
|
Constructor and Description |
---|
Matrix3()
Constructs a 3 x 3 identity matrix.
|
Matrix3(double m11,
double m12,
double m13,
double m21,
double m22,
double m23,
double m31,
double m32,
double m33)
Constructs a 3 x 3 matrix with specified components.
|
Matrix3(Matrix3 matrix)
Constructs a 3 x 3 matrix with the components of a specified matrix.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
Matrix3 |
invert()
Inverts this matrix in place.
|
Matrix3 |
invertMatrix(Matrix3 matrix)
Inverts the specified matrix and stores the result in this matrix.
|
Matrix3 |
multiplyByMatrix(double m11,
double m12,
double m13,
double m21,
double m22,
double m23,
double m31,
double m32,
double m33)
Multiplies this matrix by a matrix specified by individual components.
|
Matrix3 |
multiplyByMatrix(Matrix3 matrix)
Multiplies this matrix by a specified matrix.
|
Matrix3 |
multiplyByRotation(double angleDegrees)
Multiplies this matrix by a rotation matrix about a specified axis and angle.
|
Matrix3 |
multiplyByScale(double xScale,
double yScale)
Multiplies this matrix by a scale matrix with specified values.
|
Matrix3 |
multiplyByTileTransform(Sector src,
Sector dst)
Multiplies this matrix by a matrix that transforms normalized coordinates from a source sector to a destination
sector.
|
Matrix3 |
multiplyByTranslation(double x,
double y)
Multiplies this matrix by a translation matrix with specified translation values.
|
Matrix3 |
multiplyByVerticalFlip()
Multiplies this matrix by a matrix that flips and shifts the y-axis.
|
Matrix3 |
set(double m11,
double m12,
double m13,
double m21,
double m22,
double m23,
double m31,
double m32,
double m33)
Sets this 3 x 3 matrix to specified components.
|
Matrix3 |
set(Matrix3 matrix)
Sets this 3 x 3 matrix to the components of a specified matrix.
|
Matrix3 |
setRotation(double angleDegrees)
Sets the rotation components of this matrix to a specified angle.
|
Matrix3 |
setScale(double xScale,
double yScale)
Sets the scale components of this matrix to specified values.
|
Matrix3 |
setToIdentity()
Sets this matrix to the 3 x 3 identity matrix.
|
Matrix3 |
setToMultiply(Matrix3 a,
Matrix3 b)
Sets this matrix to the matrix product of two specified matrices.
|
Matrix3 |
setToRotation(double angleDegrees)
Sets this matrix to a rotation matrix with a specified angle.
|
Matrix3 |
setToScale(double xScale,
double yScale)
Sets this matrix to a scale matrix with specified scale components.
|
Matrix3 |
setToTileTransform(Sector src,
Sector dst)
Sets this matrix to one that transforms normalized coordinates from a source sector to a destination sector.
|
Matrix3 |
setToTranslation(double x,
double y)
Sets this matrix to a translation matrix with specified translation components.
|
Matrix3 |
setToVerticalFlip()
Sets this matrix to one that flips and shifts the y-axis.
|
Matrix3 |
setTranslation(double x,
double y)
Sets the translation components of this matrix to specified values.
|
java.lang.String |
toString() |
Matrix3 |
transpose()
Transposes this matrix in place.
|
Matrix3 |
transposeMatrix(Matrix3 matrix)
Transposes the specified matrix and stores the result in this matrix.
|
float[] |
transposeToArray(float[] result,
int offset)
Transposes this matrix, storing the result in the specified single precision array.
|
public final double[] m
public Matrix3()
public Matrix3(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33)
m11
- matrix element at row 1, column 1m12
- matrix element at row 1, column 2m13
- matrix element at row 1, column 3m21
- matrix element at row 2, column 1m22
- matrix element at row 2, column 2m23
- matrix element at row 2, column 3m31
- matrix element at row 3, column 1m32
- matrix element at row 3, column 2m33
- matrix element at row 3, column 3public Matrix3(Matrix3 matrix)
matrix
- the matrix specifying the new componentsjava.lang.IllegalArgumentException
- If the matrix is nullpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Matrix3 set(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33)
m11
- matrix element at row 1, column 1m12
- matrix element at row 1, column 2m13
- matrix element at row 1, column 3m21
- matrix element at row 2, column 1m22
- matrix element at row 2, column 2m23
- matrix element at row 2, column 3m31
- matrix element at row 3, column 1m32
- matrix element at row 3, column 2m33
- matrix element at row 3, column 3public Matrix3 set(Matrix3 matrix)
matrix
- the matrix specifying the new componentsjava.lang.IllegalArgumentException
- If the matrix is nullpublic Matrix3 setTranslation(double x, double y)
x
- the X translation componenty
- the Y translation componentpublic Matrix3 setRotation(double angleDegrees)
angleDegrees
- the angle of rotation in degreespublic Matrix3 setScale(double xScale, double yScale)
xScale
- the X scale componentyScale
- the Y scale componentpublic Matrix3 setToIdentity()
public Matrix3 setToTranslation(double x, double y)
x
- the X translation componenty
- the Y translation componentpublic Matrix3 setToRotation(double angleDegrees)
angleDegrees
- the angle of rotation in degreespublic Matrix3 setToScale(double xScale, double yScale)
xScale
- the X scale componentyScale
- the Y scale componentpublic Matrix3 setToVerticalFlip()
public Matrix3 setToTileTransform(Sector src, Sector dst)
src
- the source sectordst
- the destination sectorpublic Matrix3 setToMultiply(Matrix3 a, Matrix3 b)
a
- the first matrix multiplicandb
- The second matrix multiplicandjava.lang.IllegalArgumentException
- If either matrix is nullpublic Matrix3 multiplyByTranslation(double x, double y)
x
- the X translation componenty
- the Y translation componentpublic Matrix3 multiplyByRotation(double angleDegrees)
angleDegrees
- the angle of rotation in degreespublic Matrix3 multiplyByScale(double xScale, double yScale)
xScale
- the X scale componentyScale
- the Y scale componentpublic Matrix3 multiplyByVerticalFlip()
public Matrix3 multiplyByTileTransform(Sector src, Sector dst)
src
- the source sectordst
- the destination sectorpublic Matrix3 multiplyByMatrix(Matrix3 matrix)
matrix
- the matrix to multiply with this matrixjava.lang.IllegalArgumentException
- If the matrix is nullpublic Matrix3 multiplyByMatrix(double m11, double m12, double m13, double m21, double m22, double m23, double m31, double m32, double m33)
m11
- matrix element at row 1, column 1m12
- matrix element at row 1, column 2m13
- matrix element at row 1, column 3m21
- matrix element at row 2, column 1m22
- matrix element at row 2, column 2m23
- matrix element at row 2, column 3m31
- matrix element at row 3, column 1m32
- matrix element at row 3, column 2m33
- matrix element at row 3, column 3public Matrix3 transpose()
public Matrix3 transposeMatrix(Matrix3 matrix)
matrix
- the matrix whose transpose is computedjava.lang.IllegalArgumentException
- If the matrix in nullpublic float[] transposeToArray(float[] result, int offset)
result
- a pre-allocated array of length 9 in which to return the transposed componentspublic Matrix3 invert()
java.lang.IllegalArgumentException
- If this matrix cannot be invertedpublic Matrix3 invertMatrix(Matrix3 matrix)
matrix
- the matrix whose inverse is computedjava.lang.IllegalArgumentException
- If the matrix is null or cannot be inverted