Matrix3DReadOnly
, Orientation3DReadOnly
RotationMatrix
public interface RotationMatrixReadOnly extends Matrix3DReadOnly, Orientation3DReadOnly
A rotation matrix is used to represent a 3D orientation through its 9 coefficients. A rotation matrix has to comply to several constraints:
1
.
ORIENTATION_2D_EPSILON
Modifier and Type | Method | Description |
---|---|---|
default void |
addTransform(Tuple3DBasics tupleToTransform) |
Transforms the given tuple by this matrix and add the result to the tuple.
|
default void |
addTransform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the given tuple
tupleOriginal by this matrix and add the result to
tupleTransformed . |
default double |
distance(RotationMatrixReadOnly other) |
Computes and returns the distance between this rotation matrix and the
other . |
default boolean |
geometricallyEquals(RotationMatrixReadOnly other,
double epsilon) |
Tests if
this and other represent the same orientation to an epsilon . |
default void |
get(AxisAngleBasics axisAngleToPack) |
Converts, if necessary, and packs this orientation into an axis-angle.
|
default void |
get(RotationMatrix rotationMatrixToPack) |
Converts, if necessary, and packs this orientation into a 3-by-3 rotation matrix.
|
default void |
get(Vector3DBasics rotationVectorToPack) |
Deprecated.
Use
getRotationVector(Vector3DBasics) instead |
default void |
get(QuaternionBasics quaternionToPack) |
Converts, if necessary, and packs this orientation in a quaternion.
|
default void |
getEuler(Tuple3DBasics eulerAnglesToPack) |
Computes and packs the orientation described by this orientation as the Euler angles.
|
default double |
getPitch() |
Computes and returns the pitch angle from the yaw-pitch-roll representation of this orientation.
|
default double |
getRoll() |
Computes and returns the roll angle from the yaw-pitch-roll representation of this orientation.
|
default void |
getRotationVector(Vector3DBasics rotationVectorToPack) |
Converts and packs this orientation in a 3D rotation vector.
|
default double |
getYaw() |
Computes and returns the yaw angle from the yaw-pitch-roll representation of this orientation.
|
default void |
getYawPitchRoll(double[] yawPitchRollToPack) |
Converts and packs this orientation in a yaw-pitch-roll representation.
|
default void |
inverseTransform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Performs the inverse of the transforms to the given 3D matrix
matrixOriginal by this
matrix and stores the result in matrixTransformed . |
default void |
inverseTransform(Matrix3D matrixToTransform) |
Performs the inverse of the transforms to the given 3D matrix
matrixOriginal by this
matrix. |
default void |
inverseTransform(Tuple2DBasics tupleToTransform) |
Performs the inverse of the transform to the given tuple by this matrix.
|
default void |
inverseTransform(Tuple2DBasics tupleToTransform,
boolean checkIfOrientation2D) |
Performs the inverse of the transform to the given tuple by this matrix.
|
default void |
inverseTransform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed) |
Performs the inverse of the transform to the given tuple
tupleOriginal by this matrix and
stores the result in tupleTransformed . |
default void |
inverseTransform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfOrientation2D) |
Performs the inverse of the transform to the given tuple
tupleOriginal by this matrix and
stores the result in tupleTransformed . |
default void |
inverseTransform(Tuple3DBasics tupleToTransform) |
Performs the inverse of the transform to the given tuple by this matrix.
|
default void |
inverseTransform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Performs the inverse of the transform to the given tuple
tupleOriginal by this matrix and
stores the result in tupleTransformed . |
default void |
inverseTransform(Vector4DBasics vectorToTransform) |
Performs the inverse of the transform to the vector part the given 4D vector by this matrix.
|
default void |
inverseTransform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Performs the inverse of the transform to the vector part the given 4D vector
vectorOriginal by this matrix and stores the result in vectorTransformed . |
default boolean |
isOrientation2D(double epsilon) |
Tests if this orientation 3D actually represents a rotation strictly around the z-axis.
|
default void |
transform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Transforms the given 3D matrix
matrixOriginal by this matrix and stores the result in
matrixTransformed . |
default void |
transform(Matrix3D matrixToTransform) |
Transforms the given 3D matrix by this matrix.
|
default void |
transform(Tuple2DBasics tupleToTransform) |
Transforms the given tuple by this matrix.
|
default void |
transform(Tuple2DBasics tupleToTransform,
boolean checkIfOrientation2D) |
Transforms the given tuple by this matrix.
|
default void |
transform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed) |
Transforms the given tuple
tupleOriginal by this matrix and stores the result in
tupleTransformed . |
default void |
transform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfOrientation2D) |
Transforms the given tuple
tupleOriginal by this matrix and stores the result in
tupleTransformed . |
default void |
transform(Tuple3DBasics tupleToTransform) |
Transforms the given tuple by this matrix.
|
default void |
transform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the given tuple
tupleOriginal by this matrix and stores the result in
tupleTransformed . |
default void |
transform(Vector4DBasics vectorToTransform) |
Transforms the vector part of the given 4D vector.
|
default void |
transform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Transforms the vector part of the given 4D vector
vectorOriginal and stores the result
into vectorTransformed . |
checkIfMatrix2D, checkIfRotationMatrix, containsNaN, determinant, epsilonEquals, equals, get, get, get, get, getColumn, getColumn, getElement, getM00, getM01, getM02, getM10, getM11, getM12, getM20, getM21, getM22, getRow, getRow, isIdentity, isIdentity, isMatrix2D, isMatrix2D, isMatrixSkewSymmetric, isMatrixSkewSymmetric, isRotationMatrix, isRotationMatrix
checkIfOrientation2D, checkIfOrientation2D, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, isOrientation2D, toStringAsYawPitchRoll, transform, transform, transform, transform, transform, transform
default boolean isOrientation2D(double epsilon)
This is commonly used to test if this orientation can be used to transform 2D geometry object.
The implementation of this test depends on the type of representation used for this orientation.
This rotation matrix is considered to be an orientation 2D if:
epsilon
,
m20
, m02
, m21
, and m12
are equal to 0.0 +/-
epsilon
.
isOrientation2D
in interface Orientation3DReadOnly
epsilon
- the tolerance to use.true
if this orientation represents a 2D orientation in the XY-plane,
false
otherwise.default double distance(RotationMatrixReadOnly other)
other
.other
- the other rotation matrix to compute the distance. Not modified.@Deprecated default void get(Vector3DBasics rotationVectorToPack)
getRotationVector(Vector3DBasics)
insteadWARNING: a rotation vector is different from a yaw-pitch-roll or Euler angles representation. A rotation vector is equivalent to the axis of an axis-angle that is multiplied by the angle of the same axis-angle.
rotationVectorToPack
- the rotation vector representing the same orientation as this.
Modified.default void get(RotationMatrix rotationMatrixToPack)
get
in interface Orientation3DReadOnly
rotationMatrixToPack
- the rotation matrix into which this orientation is to be stored.
Modified.default void get(AxisAngleBasics axisAngleToPack)
get
in interface Orientation3DReadOnly
axisAngleToPack
- the axis-angle into which this orientation is to be stored. Modified.default void get(QuaternionBasics quaternionToPack)
get
in interface Orientation3DReadOnly
quaternionToPack
- the quaternion into which this orientation is to be stored. Modified.default void getRotationVector(Vector3DBasics rotationVectorToPack)
WARNING: a rotation vector is different from a yaw-pitch-roll or Euler angles representation. A rotation vector is equivalent to the axis of an axis-angle that is multiplied by the angle of the same axis-angle.
getRotationVector
in interface Orientation3DReadOnly
rotationVectorToPack
- the rotation vector in which this orientation is to be stored.
Modified.default void getEuler(Tuple3DBasics eulerAnglesToPack)
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
getEuler
in interface Orientation3DReadOnly
eulerAnglesToPack
- the tuple in which the Euler angles are stored. Modified.default void getYawPitchRoll(double[] yawPitchRollToPack)
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
The yaw-pitch-roll representation describes a 3D orientation as a succession of three rotations around three axes:
As an example, a rotation matrix can be computed from a yaw-pitch-roll representation as follows:
/ cos(yaw) -sin(yaw) 0 \ / cos(pitch) 0 sin(pitch) \ / 1 0 0 \ R = | sin(yaw) cos(yaw) 0 | * | 0 1 0 | * | 0 cos(roll) -sin(roll) | \ 0 0 1 / \ -sin(pitch) 0 cos(pitch) / \ 0 sin(roll) cos(roll) /
getYawPitchRoll
in interface Orientation3DReadOnly
yawPitchRollToPack
- the array in which the yaw-pitch-roll angles are stored. Modified.default double getYaw()
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
getYaw
in interface Orientation3DReadOnly
default double getPitch()
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
getPitch
in interface Orientation3DReadOnly
default double getRoll()
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
getRoll
in interface Orientation3DReadOnly
default void addTransform(Tuple3DBasics tupleToTransform)
tupleToTransform = tupleToTransform + this * tupleToTransform
addTransform
in interface Matrix3DReadOnly
addTransform
in interface Orientation3DReadOnly
tupleToTransform
- the tuple to transform. Modified.default void addTransform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this matrix and add the result to
tupleTransformed
.
tupleTransformed = tupleTransformed + this * tupleOriginal
addTransform
in interface Matrix3DReadOnly
addTransform
in interface Orientation3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple to add the result to. Modified.default void transform(Tuple3DBasics tupleToTransform)
tupleToTransform = this * tupleToTransform
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
tupleToTransform
- the tuple to transform. Modified.default void transform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this matrix and stores the result in
tupleTransformed
.
tupleTransformed = this * tupleOriginal
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple to store the result. Modified.default void transform(Tuple2DBasics tupleToTransform)
tupleToTransform = this * tupleToTransform
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
tupleToTransform
- the tuple to transform. Modified.default void transform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed)
tupleOriginal
by this matrix and stores the result in
tupleTransformed
.
tupleTransformed = this * tupleOriginal
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple to store the result. Modified.default void transform(Tuple2DBasics tupleToTransform, boolean checkIfOrientation2D)
tupleToTransform = this * tupleToTransform
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
tupleToTransform
- the tuple to transform. Modified.checkIfOrientation2D
- whether this method should assert that this matrix represents a
transformation in the XY plane.default void transform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed, boolean checkIfOrientation2D)
tupleOriginal
by this matrix and stores the result in
tupleTransformed
.
tupleTransformed = this * tupleOriginal
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple to store the result. Modified.checkIfOrientation2D
- whether this method should assert that this matrix represents a
transformation in the XY plane.default void transform(Vector4DBasics vectorToTransform)
vectorToTransform.s = vectorToTransform.s
vectorToTransform.xyz = this * vectorToTransform.xyz
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
vectorToTransform
- the vector to transform. Modified.default void transform(Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
vectorOriginal
and stores the result
into vectorTransformed
.
vectorTransformed.s = vectorOriginal.s
vectorTransformed.xyz = this * vectorOriginal.xyz
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.default void transform(Matrix3D matrixToTransform)
matrixToTransform = this * matrixToTransform * this-1
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
matrixToTransform
- the matrix to transform. Modified.default void transform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
by this matrix and stores the result in
matrixTransformed
.
matrixTransformed = this * matrixOriginal * this-1
transform
in interface Matrix3DReadOnly
transform
in interface Orientation3DReadOnly
matrixOriginal
- the matrix to transform. Not modified.matrixTransformed
- the matrix in which the result is stored. Modified.default void inverseTransform(Tuple3DBasics tupleToTransform)
tupleToTransform = this-1 * tupleToTransform
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
tupleToTransform
- the tuple to transform. Modified.default void inverseTransform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this matrix and
stores the result in tupleTransformed
.
tupleTransformed = this-1 * tupleOriginal
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.default void inverseTransform(Tuple2DBasics tupleToTransform)
tupleToTransform = this-1 * tupleToTransform
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
tupleToTransform
- the tuple to transform. Modified.default void inverseTransform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed)
tupleOriginal
by this matrix and
stores the result in tupleTransformed
.
tupleTransformed = this-1 * tupleOriginal
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.default void inverseTransform(Tuple2DBasics tupleToTransform, boolean checkIfOrientation2D)
tupleToTransform = this-1 * tupleToTransform
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
tupleToTransform
- the tuple to transform. Modified.checkIfOrientation2D
- whether this method should assert that this matrix represents a
transformation in the XY plane.default void inverseTransform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed, boolean checkIfOrientation2D)
tupleOriginal
by this matrix and
stores the result in tupleTransformed
.
tupleTransformed = this-1 * tupleOriginal
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.checkIfOrientation2D
- whether this method should assert that this matrix represents a
transformation in the XY plane.default void inverseTransform(Vector4DBasics vectorToTransform)
vectorToTransform.s = vectorToTransform.s
vectorToTransform.xyz = this-1 * vectorToTransform.xyz
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
vectorToTransform
- the vector to transform. Modified.default void inverseTransform(Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
vectorOriginal
by this matrix and stores the result in vectorTransformed
.
vectorTransformed.s = vectorOriginal.s
vectorTransformed.xyz = this-1 * vectorOriginal.xyz
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.default void inverseTransform(Matrix3D matrixToTransform)
matrixOriginal
by this
matrix.
matrixToTransform = this-1 * matrixToTransform * this-1
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
matrixToTransform
- the matrix to transform. Not modified.default void inverseTransform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
by this
matrix and stores the result in matrixTransformed
.
matrixTransformed = this-1 * matrixOriginal * this-1
inverseTransform
in interface Matrix3DReadOnly
inverseTransform
in interface Orientation3DReadOnly
matrixOriginal
- the matrix to transform. Not modified.matrixTransformed
- the matrix in which the result is stored. Modified.default boolean geometricallyEquals(RotationMatrixReadOnly other, double epsilon)
this
and other
represent the same orientation to an epsilon
.
Two rotation matrices are considered geometrically equal if the magnitude of their difference is
less than or equal to epsilon
.
Note that this.geometricallyEquals(other, epsilon) == true
does not necessarily imply
this.epsilonEquals(other, epsilon)
and vice versa.
other
- the other rotation matrix to compare against this. Not modified.epsilon
- the maximum angle between the two rotation matrices to be considered equal.true
if the two rotation matrices represent the same geometry, false
otherwise.