Class Matrices
- java.lang.Object
-
- org.biojava.nbio.structure.geometry.Matrices
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Matrix
getRotationJAMA(javax.vecmath.Matrix4d transform)
Convert a transformation matrix into a JAMA rotation matrix.static javax.vecmath.Matrix3d
getRotationMatrix(javax.vecmath.Matrix4d transform)
Convert a transformation matrix into a rotation matrix.static javax.vecmath.Matrix4d
getTransformation(Matrix rot, Matrix trans)
Convert JAMA rotation and translation to a Vecmath transformation matrix.static javax.vecmath.Vector3d
getTranslationVector(javax.vecmath.Matrix4d transform)
Extract the translational vector of a transformation matrix.
-
-
-
Method Detail
-
getRotationJAMA
public static Matrix getRotationJAMA(javax.vecmath.Matrix4d transform)
Convert a transformation matrix into a JAMA rotation matrix. Because the JAMA matrix is a pre-multiplication matrix and the Vecmath matrix is a post-multiplication one, the rotation matrix is transposed to ensure that the transformation they produce is the same.- Parameters:
transform
- Matrix4d with transposed rotation matrix- Returns:
- rotation matrix as JAMA object
-
getRotationMatrix
public static javax.vecmath.Matrix3d getRotationMatrix(javax.vecmath.Matrix4d transform)
Convert a transformation matrix into a rotation matrix.- Parameters:
transform
- Matrix4d- Returns:
- rotation matrix
-
getTranslationVector
public static javax.vecmath.Vector3d getTranslationVector(javax.vecmath.Matrix4d transform)
Extract the translational vector of a transformation matrix.- Parameters:
transform
- Matrix4d- Returns:
- Vector3d translation vector
-
getTransformation
public static javax.vecmath.Matrix4d getTransformation(Matrix rot, Matrix trans)
Convert JAMA rotation and translation to a Vecmath transformation matrix. Because the JAMA matrix is a pre-multiplication matrix and the Vecmath matrix is a post-multiplication one, the rotation matrix is transposed to ensure that the transformation they produce is the same.- Parameters:
rot
- 3x3 Rotation matrixtrans
- 3x1 Translation matrix- Returns:
- 4x4 transformation matrix
-
-