John W. Campbell
This is a simple class to store a 4x4 matrix. The matrix data may be
converted between object and array forms. Methods for inverting the
matrix and calculating its determinant are included. Such 4x4 matrices
are used in the handling of crystallographic symmetry in the
package Jdl.JdlPX. The Jdl4x4 object is cloneable.
Constructor and methods:
Class Details
Accessible Fields
Constructors
Methods
- Package:
- Jdl.JdlLib;
- Class name:
- Jdl4x4
- Class definition:
- public class Jdl4x4
- Extends:
- Object
- Implements:
- Cloneable
- Actions:
- none
No fields with public, package or protected access defined.
Five constructors are available to construct an empty Jdl4x4 object,
to create a Jdl4x4 object with element[4][4] set to 1.0, to create a
Jdl4x4 object from an array of double values or an array of float values
or from another Jdl4x4 object.
Constructors:
Constructor 1
Constructor 2
Constructor 3
Constructor 4
Constructor 5
Create a Jdl4x4 matrix object with zeroed elements.
- Constructor Definition:
- public Jdl4x4 ()
- Parameters List:
- none
Create a Jdl4x4 matrix object with option to specify a type. At present
only one type is defined; this sets element [4][4] to 1.0 and
zeroes all other elements. If an unknown type is given, all elements
will be set to zero.
- Constructor Definition:
- public Jdl4x4 (String typ)
- Parameters List:
- typ
- Type required t1 (element [4][4] set to 1.0)
Create a Jdl4x4 matrix object from the elements of a 4x4 double array.
- Constructor Definition:
- public Jdl4x4 (double[][] mat)
- Parameters List:
- mat
- The matrix elements in a 4x4 double array.
Create a Jdl4x4 matrix object from the elements of a 4x4 float array.
- Constructor Definition:
- public Jdl4x4 (float[][] mat)
- Parameters List:
- mat
- The matrix elements in a 4x4 float array.
Create a Jdl4x4 matrix object from another Jdl4x4 object.
- Constructor Definition:
- public Jdl4x4 (Jdl4x4 mtx)
- Parameters List:
- mtx
- The Jdl4x4 object from which to create a new matrix object.
This section contains methods to return the matrix data in double or
float arrays and to calculate its inverse and determinant.
Methods:
Return in double array - getMatrixArray
Return in float array - getMatrixArray
Calculate determinant - determinant
Invert the matrix - inverse
Return the array elements in a 4x4 double array.
- Method Definition:
- public void getMatrixArray(double[][] mat)
- Parameters List:
- mat
- 4x4 double array in which the data are to be returned.
Return the array elements in a 4x4 float array.
- Method Definition:
- public void getMatrixArray(float[][] mat)
- Parameters List:
- mat
- 4x4 float array in which the data are to be returned.
Calculate the determinant of the matrix.
- Method Definition:
- public double determinant()
- Parameters List:
- none
- Method Return:
-
The determinant of the 4x4 matrix
Calculate the inverse of the 4x4 matrix and return as a Jdl4x4 object.
- Method Definition:
- public Jdl4x4 inverse()
- Parameters List:
- none
- Method Return:
-
A matrix which is the inverse of the stored 4x4 matrix (null if
determinant is zero).
⇑ Up 2
⇑ Up 1
⇑ Top of this