tig.maths
Class Matrix3
- java.lang.Object
-
- tig.maths.Matrix3
-
- All Implemented Interfaces:
- GeneralConstants
public class Matrix3 extends java.lang.Object implements GeneralConstants
Simple representation of a 3 x 3 matrix based ondoubles.
-
-
Field Summary
Fields Modifier and Type Field and Description doublem00Term of the matrixdoublem01Term of the matrixdoublem02Term of the matrixdoublem10Term of the matrixdoublem11Term of the matrixdoublem12Term of the matrixdoublem20Term of the matrixdoublem21Term of the matrixdoublem22Term of the matrix
-
Constructor Summary
Constructors Constructor and Description Matrix3(double x00, double x01, double x02, double x10, double x11, double x12, double x20, double x21, double x22)Unique constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static doubledet(Matrix3 M)Returns the determinant of matrix M.static Matrix3getIdentityMatrix()Returns the identity matrix.static Matrix3getRotX(double alpha)Returns a matrix that can be used as a rotation matrix around the X axis.static Matrix3getRotY(double alpha)Returns a matrix that can be used as a rotation matrix around the Y axis.static Matrix3getRotZ(double alpha)Returns a matrix that can be used as a rotation matrix around the Z axis.static Matrix3invert(Matrix3 M)Returns the inverse matrix of M.static voidmain(java.lang.String[] args)static Matrix3mul(Matrix3 M1, Matrix3 M2)Returns a matrix M such as M = M1 * M2.java.lang.StringtoString()Returns a String representation of this Vector.
-
-
-
Field Detail
-
m00
public double m00
Term of the matrix
-
m01
public double m01
Term of the matrix
-
m02
public double m02
Term of the matrix
-
m10
public double m10
Term of the matrix
-
m11
public double m11
Term of the matrix
-
m12
public double m12
Term of the matrix
-
m20
public double m20
Term of the matrix
-
m21
public double m21
Term of the matrix
-
m22
public double m22
Term of the matrix
-
-
Constructor Detail
-
Matrix3
public Matrix3(double x00, double x01, double x02, double x10, double x11, double x12, double x20, double x21, double x22)Unique constructor.
Fills the instance variablesmijfrom parameters xij.
-
-
Method Detail
-
toString
public java.lang.String toString()
Returns a String representation of this Vector. The form is :(x0, x1, x2).- Overrides:
toStringin classjava.lang.Object
-
getIdentityMatrix
public static Matrix3 getIdentityMatrix()
Returns the identity matrix.
-
getRotX
public static Matrix3 getRotX(double alpha)
Returns a matrix that can be used as a rotation matrix around the X axis.- Parameters:
alpha- The rotation angle, in radians.
-
getRotY
public static Matrix3 getRotY(double alpha)
Returns a matrix that can be used as a rotation matrix around the Y axis.- Parameters:
alpha- The rotation angle, in radians.
-
getRotZ
public static Matrix3 getRotZ(double alpha)
Returns a matrix that can be used as a rotation matrix around the Z axis.- Parameters:
alpha- The rotation angle, in radians.
-
det
public static double det(Matrix3 M)
Returns the determinant of matrix M.- Parameters:
M- The matrix whose determinant must be found.
-
invert
public static Matrix3 invert(Matrix3 M)
Returns the inverse matrix of M.
If the resulting matrix is called N, we have : M x N = I, the identity matrix.- Parameters:
M- The matrix to invert.- Throws:
java.lang.RuntimeException- if the determinant of M is = 0.
-
main
public static void main(java.lang.String[] args)
-
-
DMelt 3.0 © DataMelt by jWork.ORG