|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.math.geometry.AbstractRotation
com.kuka.math.geometry.MatrixRotation
public final class MatrixRotation
Immutable representation of a spatial rotation in matrix form.
| Field Summary | |
|---|---|
static MatrixRotation |
NONE
Immutable MatrixRotation instance representing no rotation. |
| Method Summary | |
|---|---|
MatrixRotation |
compose(MatrixRotation other)
The effect of A.compose(B) is that of the matrix multiplication A*B. |
boolean |
equals(Object obj)
|
void |
fillRowFirstArray(double[] elements)
Fills a "RowFirst" representation (double[3,3]) Array "Frame33" - represented as 9 element vector. |
Matrix |
getMatrix()
Returns the underlying matrix that represents this rotation. |
Vector3D |
getUnitVectorX()
Returns the x unit vector after it has been rotated by this rotation. |
Vector3D |
getUnitVectorY()
Returns the y unit vector after it has been rotated by this rotation. |
Vector3D |
getUnitVectorZ()
Returns the z unit vector after it has been rotated by this rotation. |
int |
hashCode()
|
MatrixRotation |
invert()
Returns an inverted rotation, i.e. a rotation that reverses the effect of this one. |
static boolean |
isRotationMatrix(Matrix matrix)
Function that checks whether the given matrix is rotational matrix, i.e. it must fulfill the following conditions: equal(matrix.determinant(), 1, epsilon); equal(matrix.transpose(), matrix.invert(), epsilon);
where equal(a, b, epsilon) is an element-wise test of approximate equality (small epsilon test). |
static MatrixRotation |
of(IRotation orig)
Returns an immutable instance from the values of the provided rotation. |
static MatrixRotation |
of(Matrix matrix)
Checked creation of a MatrixRotation from a given rotation matrix. |
static MatrixRotation |
ofUnchecked(Matrix matrix)
Unchecked creation of a MatrixRotation from a given rotation matrix. |
double[] |
toRowFirstArray()
Serialization Support Serialize the MatrixRotation to a linear 9 Vector to support "rowFirstArray" (double[3][3]) Frame33 Represenations. |
String |
toString()
Returns the matrix value as a 3x3 matrix formatted in a way compatible with popular scientific numerical computing applications. |
String |
toString(NumberFormat fmt)
Returns the matrix value as a 3x3 matrix formatted in a way similar to popular scientific numerical computing applications. |
| Methods inherited from class com.kuka.math.geometry.AbstractRotation |
|---|
applyTo, applyTo, compose, rotationalDistanceTo, rotationTo |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final MatrixRotation NONE
MatrixRotation instance representing no rotation.
| Method Detail |
|---|
public static MatrixRotation ofUnchecked(Matrix matrix)
MatrixRotation from a given rotation matrix. The matrix must be a rotation
matrix, i.e. it must fulfill the following conditions:
equal(matrix.determinant(), 1, epsilon);
equal(matrix.transpose(), matrix.invert(), epsilon);
where equal(a, b, epsilon) is an element-wise test of approximate equality (small epsilon test).
Caution: Don't use this method unless you are absolutely sure that the matrix is a valid rotation matrix!
If in doubt, use of(Matrix). It can be checked if a matrix is rotational by using
isRotationMatrix(Matrix).
matrix - a rotation matrix. Will not be checked if matrix is rotational.
public static MatrixRotation of(Matrix matrix)
MatrixRotation from a given rotation matrix. The matrix must be a rotation matrix,
i.e. it must fulfill the following conditions:
equal(matrix.determinant(), 1, epsilon);
equal(matrix.transpose(), matrix.invert(), epsilon);
where equal(a, b, epsilon) is an element-wise test of approximate equality (small epsilon test). The
epsilon used is 1e-3.
The above conditions will be checked upon creation of the rotation.
matrix - a rotation matrix. Will be checked.
IllegalArgumentException - if the matrix is null or not a rotation matrixpublic static MatrixRotation of(IRotation orig)
orig - the instance from which to take over the rotation
public static boolean isRotationMatrix(Matrix matrix)
equal(matrix.determinant(), 1, epsilon);
equal(matrix.transpose(), matrix.invert(), epsilon);
where equal(a, b, epsilon) is an element-wise test of approximate equality (small epsilon test). The
epsilon used is 1e-3.
matrix - a rotation matrix. Will be checked.
public Matrix getMatrix()
getMatrix in interface IRotationgetMatrix in class AbstractRotationpublic MatrixRotation compose(MatrixRotation other)
other - the rotation to combine with this one
public MatrixRotation invert()
IRotation
invert in interface IRotationinvert in class AbstractRotationpublic Vector3D getUnitVectorX()
getUnitVectorY(),
getUnitVectorZ()public Vector3D getUnitVectorY()
getUnitVectorX(),
getUnitVectorZ()public Vector3D getUnitVectorZ()
getUnitVectorX(),
getUnitVectorY()public double[] toRowFirstArray()
public void fillRowFirstArray(double[] elements)
elements - - a double vector with exactly 9 Elements It will be filled with the elements of the rotation in the
following sequence: [rot00, rot01, rot02, rot10, rot11, rot12, rot20,rot21,rot22]public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
Double.toString(double).
The following string can be regarded as typical:
[[0.0 0.0 -1.0]; [0.0 -1.0 0.0]; [-1.0 0.0 0.0]]
toString in class AbstractRotationpublic String toString(NumberFormat fmt)
NumberFormat.format(double) method of the given formatter.
Example: The following code snippet, used on a given MatrixRotation rot
NumberFormat fmt = NumberFormat.getNumberInstance(Locale.US); fmt.setMinimumFractionDigits(1); fmt.setMaximumFractionDigits(3); System.out.println(rot.toString(fmt));might give the following output:
[[0.707 -0.707 0.0]; [0.707 0.707 0.0]; [0.0 0.0 1.0]]
fmt - the NumberFormat used to format the number values
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||