|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.numerics.Matrix3DTransformation
public class Matrix3DTransformation
Matrix3DTransformation implements 3D affine transformations using a matrix representation.
Nested Class Summary | |
---|---|
protected static class |
Matrix3DTransformation.Affine3DTransformationLoader
|
Constructor Summary | |
---|---|
Matrix3DTransformation(double[][] matrix)
Constructs a 3D transformation using the given matrix. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Provides a copy of this transformation. |
static Matrix3DTransformation |
createAlignmentTransformation(double[] v1,
double[] v2)
Instantiates a rotation that aligns the first vector with the second vector. |
double[] |
direct(double[] point)
Transforms the given point+. |
double[][] |
direct(double[][] mat)
Transforms the given matrix into the transformation's coordinate system. |
double[] |
getFlatMatrix(double[] mat)
Gets the direct homogeneous affine transformation flattened into a 1-d array. |
static XML.ObjectLoader |
getLoader()
|
double[] |
getTransposedFlatMatrix(double[] mat)
Gets the direct homogeneous affine transformation flattened into a 1-d array, ordered left to right, top to bottom If the mat parameter is null a double[16] array is created; otherwise the given array is used. |
double[] |
inverse(double[] point)
Transforms the given point using the inverse transformation (if it exists). |
double[][] |
inverse(double[][] mat)
Transforms the given matrix from the transformation's coordinate system. |
void |
multiply(double[][] mat)
Multiplies this rotation matrix by the given matrix. |
void |
multiply(Matrix3DTransformation trans)
Multiplies (concatenates) this transformation matrix with the given transformation. |
static Matrix3DTransformation |
Quaternion(double[] quaternion)
Creates an transformation representing a rotation about the origin by the given quaternion. |
static Matrix3DTransformation |
Quaternion(double q0,
double q1,
double q2,
double q3)
Creates an AffineMatrix representing a rotation about the origin by the given quaternion components. |
static Matrix3DTransformation |
rotation(double theta,
double[] axis)
Creates a 3D transforamtion representing a rotation about the origin by the given angle around the given axis. |
static Matrix3DTransformation |
rotationX(double theta)
Creates a 3D transforamtion representing a rotation about the x axis by the given angle. |
static Matrix3DTransformation |
rotationY(double theta)
Creates a 3D transforamtion representing a rotation about the y axis by the given angle. |
static Matrix3DTransformation |
rotationZ(double theta)
Creates a 3D transforamtion representing a rotation about the z axis by the given angle. |
double[] |
setOrigin(double[] origin)
Sets the origin for this rotation. |
void |
setOrigin(double ox,
double oy,
double oz)
Sets the origin for this rotation. |
double[] |
toQuaternion(double[] q)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Matrix3DTransformation(double[][] matrix)
matrix
- double[][]Method Detail |
---|
public static Matrix3DTransformation rotationX(double theta)
theta
- double
public static Matrix3DTransformation rotationY(double theta)
theta
- double
public static Matrix3DTransformation rotationZ(double theta)
theta
- double
public static Matrix3DTransformation rotation(double theta, double[] axis)
theta
- doubleaxis
- double[]
public static Matrix3DTransformation Quaternion(double[] quaternion)
quaternion
- double[]
public static Matrix3DTransformation Quaternion(double q0, double q1, double q2, double q3)
q0
- q1
- q2
- q3
-
public java.lang.Object clone()
clone
in interface Transformation
clone
in class java.lang.Object
public final double[] getFlatMatrix(double[] mat)
getFlatMatrix
in interface MatrixTransformation
mat
- double[] optional matrix
public final double[] getTransposedFlatMatrix(double[] mat)
mat
- double[] optional matrix
public final double[] toQuaternion(double[] q)
public static Matrix3DTransformation createAlignmentTransformation(double[] v1, double[] v2)
v1
- double[]v2
- double[]
public void setOrigin(double ox, double oy, double oz)
ox
- doubleoy
- doubleoz
- doublepublic final void multiply(Matrix3DTransformation trans)
trans
- Matrix3DTransformationpublic final void multiply(double[][] mat)
mat
- double[][]public double[] setOrigin(double[] origin)
origin
- double[] the new origin
public double[] direct(double[] point)
direct
in interface Transformation
point
- the coordinates to be transformed
public double[][] direct(double[][] mat)
matrix
- to be transformedpublic double[] inverse(double[] point) throws java.lang.UnsupportedOperationException
inverse
in interface Transformation
point
- the coordinates to be transformed
java.lang.UnsupportedOperationException
- If the transformation is
not invertiblepublic double[][] inverse(double[][] mat)
matrix
- to be transformedpublic static XML.ObjectLoader getLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |