java.lang.Object
io.sf.jclf.math.linear3.Matrices
Basic operations with 3x3 matrices.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubledeterminant3(double[][] a) static voidinverse3(double[][] a, double[][] inverse) Compute the inverse of a 3x3 matrixa.static voidmultiplyByMatrix3(double[][] a, double[][] b, double[][] result) Multiply the 3x3 matrixaby 3x3 matrixb.static voidmultiplyByVector3(double[][] a, double[] v, double[] result) Multiply the 3x3 matrixaby tri-vectorv.static voidmultiplyByVector3(double[][] a, double x, double y, double z, double[] result) Multiply the 3x3 matrixaby a 3-vector of componentsx,yandz.static double[][]rotation(double[] u, double angleRad) Create a rotation matrix respect to the given axis.static double[][]rotX(double angleRad) Create ax-rotation matrix.static double[][]rotY(double angleRad) Create ay-rotation matrix.static double[][]rotZ(double angleRad) Create az-rotation matrix.static voidtranspose3(double[][] a) In-place transposition of a 3x3 matrix.
-
Constructor Details
-
Matrices
public Matrices()
-
-
Method Details
-
inverse3
public static void inverse3(double[][] a, double[][] inverse) Compute the inverse of a 3x3 matrixa.- Parameters:
a- the matrix whose inverse has to be computed.inverse- the 3x3 matrix where the inverse is to be stored.- Throws:
IllegalArgumentException- if the determinant is null and the inverse cannot be computed.
-
determinant3
public static double determinant3(double[][] a) -
multiplyByVector3
public static void multiplyByVector3(double[][] a, double[] v, double[] result) Multiply the 3x3 matrixaby tri-vectorv.- Parameters:
a- the matrix to be multiplied.v- the tri-vector.result- the vector to store the result in.
-
multiplyByVector3
public static void multiplyByVector3(double[][] a, double x, double y, double z, double[] result) Multiply the 3x3 matrixaby a 3-vector of componentsx,yandz.- Parameters:
a- the matrix to be multiplied.x- the first component of the vector.y- the second component of the vector.z- the third component of the vector.result- the vector to store the result in.
-
multiplyByMatrix3
public static void multiplyByMatrix3(double[][] a, double[][] b, double[][] result) Multiply the 3x3 matrixaby 3x3 matrixb.- Parameters:
a- the first matrix operand.b- the second matrix operand.result- the 3x3 matrix where the result of the multiplication is to be stored.
-
transpose3
public static void transpose3(double[][] a) In-place transposition of a 3x3 matrix.- Parameters:
a- the matrix to transpose.
-
rotX
public static double[][] rotX(double angleRad) Create ax-rotation matrix.- Parameters:
angleRad- the rotation angle, in radians.- Returns:
- the rotation matrix.
-
rotY
public static double[][] rotY(double angleRad) Create ay-rotation matrix.- Parameters:
angleRad- the rotation angle, in radians.- Returns:
- the rotation matrix.
-
rotZ
public static double[][] rotZ(double angleRad) Create az-rotation matrix.- Parameters:
angleRad- the rotation angle, in radians.- Returns:
- the rotation matrix.
-
rotation
public static double[][] rotation(double[] u, double angleRad) Create a rotation matrix respect to the given axis.- Parameters:
u- the unit vector defining the rotation axis.angleRad- the rotation angle, in radians.- Returns:
- the rotation matrix.
-