Interface MMatrix4d
- All Superinterfaces:
- Matrix4d
Interface for 4x4 matrices. Allows modifying the matrix.
- Since:
- 9.10.2
- 
Field Summary
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddInPlace(double scalar) Adds a scalar to each component of this matrix.voidaddInPlace(Matrix4d matrix) Sets the value of this matrix to sum of itself and the given matrix.static MMatrix4dcreate()Returns a new identity matrix.static MMatrix4dcreate(double[] elements) Constructs a matrix with the given array of 16 elements or 12 elements.static MMatrix4dcreate(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 MMatrix4dReturns a new matrix with the values of the given matrix.voidinvert()Inverts this matrix in place.voidmultiplyInPlace(Matrix4d matrix) Sets the value of this matrix to the result of multiplying itself with the given matrix.voidNormalizes the axis of the matrix.voidSets the values of this matrix to the values of the given matrix.voidsetByDoubleArray(double[] numbers) Sets the matrix values to the values given in the numbers array.voidsetColumn(int column, double firstRow, double secondRow, double thirdRow, double fourthRow) Sets the specified column of this matrix to the four values provided.voidSets the specified column with the x,y,z values received from the vector.voidSets the rotational component (upper 3x3) of this transform to the rotation matrix converted from the Euler angles provided; the other non-rotational elements are set as if this were an identity matrix.voidSets this matrix to an identity matrix.voidsetM00(double m00) Set the first element of the first row in the matrix.voidsetM01(double m01) Set the second element of the first row in the matrix.voidsetM02(double m02) Set the third element of the first row in the matrix.voidsetM03(double m03) Set the fourth element of the first row in the matrix.voidsetM10(double m10) Sets the first value of the second row in the matrix.voidsetM11(double m11) Sets the second value of the second row in the matrix.voidsetM12(double m12) Sets the third value of the second row in the matrix.voidsetM13(double m13) Sets the fourth value of the second row in the matrix.voidsetM20(double m20) Sets the first value of the third row in the matrix.voidsetM21(double m21) Sets the second value of the third row in the matrix.voidsetM22(double m22) Sets the third value of the third row in the matrix.voidsetM23(double m23) Sets the fourth value of the third row in the matrix.voidsetM30(double m30) Sets the first value of the fourth row in the matrix.voidsetM31(double m31) Sets the second value of the fourth row in the matrix.voidsetM32(double m32) Sets the third value of the fourth row in the matrix.voidsetM33(double m33) Sets the fourth value of the fourth row in the matrix.voidsetRotation(Vector3d x, Vector3d y, Vector3d z) Sets the rotation (and scaling) based on the vectors given.voidsetRotationX(double angle) Sets the rotation about the X axis of this matrix.voidsetRotationY(double angle) Sets the rotation about the Y axis of this matrix.voidsetRotationZ(double angle) Sets the rotation about the Z axis of this matrix.voidsetScale(double scale) Sets the scale component of the current matrix by factoring out the current scale (by doing an SVD) from the rotational component and multiplying by the new scale.voidsetTranslation(Vector3d translationComponent) Sets the translation component of this matrix based on a vector.voidsubtractInPlace(Matrix4d matrix) Sets the value of this matrix to the matrix difference of itself and the given matrix.voidTransposes this matrix.Methods inherited from interface com.solibri.geometry.linearalgebra.Matrix4dadd, add, getM00, getM01, getM02, getM03, getM10, getM11, getM12, getM13, getM20, getM21, getM22, getM23, getM30, getM31, getM32, getM33, getTranslation, isIdentityMatrix, multiply, subtract, transform, transform, transformNormal
- 
Method Details- 
createReturns a new identity matrix.- Returns:
- a new identity matrix
- Since:
- 9.10.2
 
- 
createReturns a new matrix with the values of the given matrix.- Parameters:
- matrix- the matrix that is inputed to create another matrix
- Returns:
- a new matrix with the values of the given matrix
- Since:
- 9.10.2
 
- 
createConstructs 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
 
- 
createstatic MMatrix4d 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 row
- m01- second element in first row
- m02- third element in first row
- m03- fourth element in first row
- m10- first element in second row
- m11- second element in second row
- m12- third element in second row
- m13- fourth element in second row
- m20- first element in third row
- m21- second element in third row
- m22- third element in third row
- m23- fourth element in third row
- m30- first element in fourth row
- m31- second element in fourth row
- m32- third element in fourth row
- m33- fourth element in fourth row
- Returns:
- a new matrix with the given 16 elements
- Since:
- 9.10.2
 
- 
addInPlacevoid addInPlace(double scalar) Adds a scalar to each component of this matrix.- Parameters:
- scalar- the scalar that is added to each component
- Since:
- 9.10.2
 
- 
addInPlaceSets the value of this matrix to sum of itself and the given matrix.- Parameters:
- matrix- the matrix which is added to this
- Since:
- 9.10.2
 
- 
subtractInPlaceSets the value of this matrix to the matrix difference of itself and the given matrix.- Parameters:
- matrix- the matrix by which this is subtracted
- Since:
- 9.10.2
 
- 
invertvoid invert()Inverts this matrix in place.- Since:
- 9.10.2
 
- 
transposevoid transpose()Transposes this matrix.- Since:
- 9.10.2
 
- 
multiplyInPlaceSets the value of this matrix to the result of multiplying itself with the given matrix.- Parameters:
- matrix- the matrix by which this is multiplied
- Since:
- 9.10.2
 
- 
setRotationXvoid setRotationX(double angle) Sets the rotation about the X axis of this matrix.- Parameters:
- angle- the angle to rotate on the X axis in radians
- Since:
- 9.10.2
 
- 
setRotationYvoid setRotationY(double angle) Sets the rotation about the Y axis of this matrix.- Parameters:
- angle- the angle to rotate on the Y axis in radians
- Since:
- 9.10.2
 
- 
setRotationZvoid setRotationZ(double angle) Sets the rotation about the Z axis of this matrix.- Parameters:
- angle- the angle to rotate on the Z axis in radians
- Since:
- 9.10.2
 
- 
setSets the values of this matrix to the values of the given matrix.- Parameters:
- matrix- the matrix from which values are copied to this
- Since:
- 9.10.2
 
- 
setColumnSets the specified column with the x,y,z values received from the vector.- Parameters:
- column- the index of the column
- vector- the vector that is set to the column
- Since:
- 9.10.2
 
- 
setColumnvoid setColumn(int column, double firstRow, double secondRow, double thirdRow, double fourthRow) Sets the specified column of this matrix to the four values provided.- Parameters:
- column- index of the column
- firstRow- first row element
- secondRow- second row element
- thirdRow- third row element
- fourthRow- fourth row element
- Since:
- 9.10.2
 
- 
setIdentityvoid setIdentity()Sets this matrix to an identity matrix.- Since:
- 9.10.2
 
- 
setM00void setM00(double m00) Set the first element of the first row in the matrix.- Parameters:
- m00- value that is set
- Since:
- 9.10.2
 
- 
setM01void setM01(double m01) Set the second element of the first row in the matrix.- Parameters:
- m01- value that is set
 
- 
setM02void setM02(double m02) Set the third element of the first row in the matrix.- Parameters:
- m02- the value that is set
- Since:
- 9.10.2
 
- 
setM03void setM03(double m03) Set the fourth element of the first row in the matrix.- Parameters:
- m03- value that is set
- Since:
- 9.10.2
 
- 
setM10void setM10(double m10) Sets the first value of the second row in the matrix.- Parameters:
- m10- value that is set
- Since:
- 9.10.2
 
- 
setM11void setM11(double m11) Sets the second value of the second row in the matrix.- Parameters:
- m11- value that is set
- Since:
- 9.10.2
 
- 
setM12void setM12(double m12) Sets the third value of the second row in the matrix.- Parameters:
- m12- value that is set
- Since:
- 9.10.2
 
- 
setM13void setM13(double m13) Sets the fourth value of the second row in the matrix.- Parameters:
- m13- value that is set
- Since:
- 9.10.2
 
- 
setM20void setM20(double m20) Sets the first value of the third row in the matrix.- Parameters:
- m20- value that is set
- Since:
- 9.10.2
 
- 
setM21void setM21(double m21) Sets the second value of the third row in the matrix.- Parameters:
- m21- value that is set
- Since:
- 9.10.2
 
- 
setM22void setM22(double m22) Sets the third value of the third row in the matrix.- Parameters:
- m22- value that is set
- Since:
- 9.10.2
 
- 
setM23void setM23(double m23) Sets the fourth value of the third row in the matrix.- Parameters:
- m23- value that is set
- Since:
- 9.10.2
 
- 
setM30void setM30(double m30) Sets the first value of the fourth row in the matrix.- Parameters:
- m30- value that is set
- Since:
- 9.10.2
 
- 
setM31void setM31(double m31) Sets the second value of the fourth row in the matrix.- Parameters:
- m31- value that is set
- Since:
- 9.10.2
 
- 
setM32void setM32(double m32) Sets the third value of the fourth row in the matrix.- Parameters:
- m32- value that is set
- Since:
- 9.10.2
 
- 
setM33void setM33(double m33) Sets the fourth value of the fourth row in the matrix.- Parameters:
- m33- value that is set
- Since:
- 9.10.2
 
- 
setTranslationSets the translation component of this matrix based on a vector.- Parameters:
- translationComponent- the position
- Since:
- 9.10.2
 
- 
setRotationSets the rotation (and scaling) based on the vectors given.- Parameters:
- x- The first three cells of the first column of this matrix
- y- The first three cells of the second column of this matrix
- z- The first three cells of the third column of this matrix
 
- 
setScalevoid setScale(double scale) Sets the scale component of the current matrix by factoring out the current scale (by doing an SVD) from the rotational component and multiplying by the new scale.- Parameters:
- scale- scaling factor
 
- 
setByDoubleArrayvoid setByDoubleArray(double[] numbers) Sets the matrix values to the values given in the numbers array. The array must be of 12 or 16 elements.- Parameters:
- numbers- the elements of the matrix
- Throws:
- IllegalArgumentException- if another size besides 12 or 16 is given
 
- 
setEulerSets the rotational component (upper 3x3) of this transform to the rotation matrix converted from the Euler angles provided; the other non-rotational elements are set as if this were an identity matrix. The euler parameter is a Vector3d consisting of three rotation angles applied first about the X, then Y then Z axis. These rotations are applied using a static frame of reference. In other words, the orientation of the Y rotation axis is not affected by the X rotation and the orientation of the Z rotation axis is not affected by the X or Y rotation.- Parameters:
- euler- the Vector3d consisting of three rotation angles about X,Y,Z
- Since:
- 9.10.2
 
- 
normalizevoid normalize()Normalizes the axis of the matrix.- Since:
- 9.10.2
 
 
-