Interface Matrix4d
-
- All Known Subinterfaces:
MMatrix4d
public interface Matrix4d
Read only interface for 4x4 matrices.- Since:
- 9.10.2
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description MMatrix4d
add(double scalar)
Returns a copy of this matrix after adding a scalar to each component of this matrix.MMatrix4d
add(Matrix4d matrix)
Returns a copy of this matrix after calculating the sum of this matrix and the given matrix.static Matrix4d
create(double[] elements)
Constructs a matrix with the given array of 16 elements or 12 elements.static Matrix4d
create(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)
Constructs a matrix with the given 16 elements.static Matrix4d
create(Matrix4d matrix)
Returns a new matrix with the values of the given matrix.static Matrix4d
create(Vector3d x, Vector3d y, Vector3d z, Vector3d translation)
Constructs a matrix from the given vectors and the translation vector.double
getM00()
Returns the first element of the first row in the matrix.double
getM01()
Returns the second element of the first row in the matrix.double
getM02()
Returns the third element of the first row in the matrix.double
getM03()
Returns the fourth element of the first row in the matrix.double
getM10()
Returns the first element of the second row in the matrix.double
getM11()
Returns the second element of the second row in the matrix.double
getM12()
Returns the third element of the second row in the matrix.double
getM13()
Returns the fourth element of the second row in the matrix.double
getM20()
Returns the first element of the third row in the matrix.double
getM21()
Returns the second element of the third row in the matrix.double
getM22()
Returns the third element of the third row in the matrix.double
getM23()
Returns the fourth element of the third row in the matrix.double
getM30()
Returns the first element of the fourth row in the matrix.double
getM31()
Returns the second element of the fourth row in the matrix.double
getM32()
Returns the third element of the fourth row in the matrix.double
getM33()
Returns the fourth element of the fourth row in the matrix.MVector3d
getTranslation()
Returns the translation component of this matrix.boolean
isIdentityMatrix()
Returns true if this matrix is an identity matrix.MMatrix4d
multiply(Matrix4d matrix)
Returns a copy of this matrix after calculating the product of this matrix and the given matrix.static MMatrix4d
productOf(Matrix4d matrix1, Matrix4d matrix2)
Returns the product of the two inputed matrixes.MMatrix4d
subtract(Matrix4d matrix)
Returns a copy of this matrix after calculating the difference between this matrix and the given matrix.MVector3d
transform(Vector3d vector)
Returns a copy of the given vector transformed by this matrix.Collection<MVector3d>
transform(Collection<? extends Vector3d> points)
Transforms the points with the transformation matrix.MVector3d
transformNormal(Vector3d normal)
Transforms the normal of this matrix by getting the normals of the inputed parameter.
-
-
-
Field Detail
-
IDENTITY
static final Matrix4d IDENTITY
Returns a new identity matrix.- Since:
- 9.10.2
-
-
Method Detail
-
create
static Matrix4d create(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)
Constructs a matrix with the given 16 elements. The first four elements are the first row of the matrix. The second four elements are the second row of the matrix. The third four elements are the third row of the matrix. The fourth four elements are the fourth row of the matrix.- Parameters:
m00
- first element in first rowm01
- second element in first rowm02
- third element in first rowm03
- fourth element in first rowm10
- first element in second rowm11
- second element in second rowm12
- third element in second rowm13
- fourth element in second rowm20
- first element in third rowm21
- second element in third rowm22
- third element in third rowm23
- fourth element in third rowm30
- first element in fourth rowm31
- second element in fourth rowm32
- third element in fourth rowm33
- fourth element in fourth row- Returns:
- a new matrix with the given 16 elements
- Since:
- 9.10.2
-
create
static Matrix4d create(Matrix4d matrix)
Returns a new matrix with the values of the given matrix.- Parameters:
matrix
- the matrix that is given to create another matrix- Returns:
- a new matrix with the values of the given matrix
- Since:
- 9.10.2
-
create
static Matrix4d create(Vector3d x, Vector3d y, Vector3d z, Vector3d translation)
Constructs a matrix from the given vectors and the translation vector.- Parameters:
x
- the x vectory
- the y vectorz
- the z vectortranslation
- the translation vector- Returns:
- a new matrix constructed from the given vectors and the translation vector
- Since:
- 9.10.2
-
create
static Matrix4d create(double[] elements)
Constructs a matrix with the given array of 16 elements or 12 elements. The first four elements are the first row of the matrix. The second four elements are the second row of the matrix. The third four elements are the third row of the matrix. The fourth four elements, if present, are the fourth row of the matrix, and if not present they are set to (0, 0, 0, 1). Example: M00 = elements[0], M01 = elements[1] etc...- Parameters:
elements
- the elements array- Returns:
- returns a new matrix with the contents from elements
- Throws:
IllegalArgumentException
- if the given array does not contain 12 or 16 elements- Since:
- 9.10.2
-
getM00
double getM00()
Returns the first element of the first row in the matrix.- Returns:
- first element of first row
- Since:
- 9.10.2
-
getM01
double getM01()
Returns the second element of the first row in the matrix.- Returns:
- second element of first row
- Since:
- 9.10.2
-
getM02
double getM02()
Returns the third element of the first row in the matrix.- Returns:
- third element of first row
- Since:
- 9.10.2
-
getM03
double getM03()
Returns the fourth element of the first row in the matrix.- Returns:
- fourth element of first row
- Since:
- 9.10.2
-
getM10
double getM10()
Returns the first element of the second row in the matrix.- Returns:
- first element of second row
- Since:
- 9.10.2
-
getM11
double getM11()
Returns the second element of the second row in the matrix.- Returns:
- second element of second row
- Since:
- 9.10.2
-
getM12
double getM12()
Returns the third element of the second row in the matrix.- Returns:
- third element of second row
- Since:
- 9.10.2
-
getM13
double getM13()
Returns the fourth element of the second row in the matrix.- Returns:
- fourth element of second row.
- Since:
- 9.10.2
-
getM20
double getM20()
Returns the first element of the third row in the matrix.- Returns:
- first element of third row
- Since:
- 9.10.2
-
getM21
double getM21()
Returns the second element of the third row in the matrix.- Returns:
- second element of third row
- Since:
- 9.10.2
-
getM22
double getM22()
Returns the third element of the third row in the matrix.- Returns:
- third element of third row
- Since:
- 9.10.2
-
getM23
double getM23()
Returns the fourth element of the third row in the matrix.- Returns:
- fourth element of third row
- Since:
- 9.10.2
-
getM30
double getM30()
Returns the first element of the fourth row in the matrix.- Returns:
- first element of fourth row
- Since:
- 9.10.2
-
getM31
double getM31()
Returns the second element of the fourth row in the matrix.- Returns:
- second element of fourth row
- Since:
- 9.10.2
-
getM32
double getM32()
Returns the third element of the fourth row in the matrix.- Returns:
- third element of fourth row
- Since:
- 9.10.2
-
getM33
double getM33()
Returns the fourth element of the fourth row in the matrix.- Returns:
- fourth element of fourth row
- Since:
- 9.10.2
-
getTranslation
MVector3d getTranslation()
Returns the translation component of this matrix.- Returns:
- the translation
- Since:
- 9.10.2
-
transform
MVector3d transform(Vector3d vector)
Returns a copy of the given vector transformed by this matrix.- Parameters:
vector
- vector that is inputed to transform this vector- Returns:
- returns a transformed 3D vector
- Since:
- 9.10.2
-
transformNormal
MVector3d transformNormal(Vector3d normal)
Transforms the normal of this matrix by getting the normals of the inputed parameter.- Parameters:
normal
- the input normal to be transformed- Returns:
- returns a copy of the given vector transformed by this matrix
- Since:
- 9.10.2
-
isIdentityMatrix
boolean isIdentityMatrix()
Returns true if this matrix is an identity matrix.- Returns:
- returns true if this matrix is an identity matrix
- Since:
- 9.10.2
-
transform
Collection<MVector3d> transform(Collection<? extends Vector3d> points)
Transforms the points with the transformation matrix.- Parameters:
points
- the collection of points to be transformed- Returns:
- returns a collection of transformed vector points
- Since:
- 9.10.2
-
productOf
static MMatrix4d productOf(Matrix4d matrix1, Matrix4d matrix2)
Returns the product of the two inputed matrixes.- Parameters:
matrix1
- matrix on the left side of the multiplicationmatrix2
- matrix on the right side of the multiplication- Returns:
- the product of the given matrices
-
add
MMatrix4d add(double scalar)
Returns a copy of this matrix after adding a scalar to each component of this matrix.- Parameters:
scalar
- the scalar that is added to each component of this matrix- Returns:
- a copy of this matrix after adding a scalar to each component of this matrix
- Since:
- 9.10.2
-
add
MMatrix4d add(Matrix4d matrix)
Returns a copy of this matrix after calculating the sum of this matrix and the given matrix.- Parameters:
matrix
- the matrix that is added to this matrix- Returns:
- a copy of this matrix after calculating the sum of this matrix and the given matrix. and the given matrix.
- Since:
- 9.10.2
-
multiply
MMatrix4d multiply(Matrix4d matrix)
Returns a copy of this matrix after calculating the product of this matrix and the given matrix.- Parameters:
matrix
- the matrix by which this matrix is multiplied- Returns:
- a copy of this matrix after calculating the product of this matrix and the given matrix.
- Since:
- 9.10.2
-
subtract
MMatrix4d subtract(Matrix4d matrix)
Returns a copy of this matrix after calculating the difference between this matrix and the given matrix.- Parameters:
matrix
- the matrix on the right side of the difference- Returns:
- a copy of this matrix after calculating the difference between this matrix and the given matrix.
- Since:
- 9.10.2
-
-