AxisAngleBasics
, AxisAngleReadOnly
, Orientation3DBasics
, QuaternionBasics
, QuaternionReadOnly
, RotationMatrixReadOnly
AxisAngle
, AxisAngle32
, Quaternion
, Quaternion32
, RotationMatrix
public interface Orientation3DReadOnly
Even though the representation used is unknown at this level of abstraction, this interface allows to enforce a minimum set of features that all representations of an orientation should provide, such as transformation functions.
Modifier and Type | Field | Description |
---|---|---|
static double |
ORIENTATION_2D_EPSILON |
Default tolerance to use when testing if this orientation represents an orientation in the
XY-plane.
|
Modifier and Type | Method | Description |
---|---|---|
default void |
addTransform(Tuple3DBasics tupleToTransform) |
Transforms the given tuple by this orientation and adds the result to the tuple.
|
void |
addTransform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the tuple
tupleOriginal by this orientation and adds the result to
tupleTransformed . |
default void |
checkIfOrientation2D() |
Tests if this orientation 3D actually represents a rotation strictly around the z-axis.
|
default void |
checkIfOrientation2D(double epsilon) |
Tests if this orientation 3D actually represents a rotation strictly around the z-axis.
|
void |
get(AxisAngleBasics axisAngleToPack) |
Converts, if necessary, and packs this orientation into an axis-angle.
|
void |
get(RotationMatrix rotationMatrixToPack) |
Converts, if necessary, and packs this orientation into a 3-by-3 rotation matrix.
|
void |
get(QuaternionBasics quaternionToPack) |
Converts, if necessary, and packs this orientation in a quaternion.
|
void |
getEuler(Tuple3DBasics eulerAnglesToPack) |
Computes and packs the orientation described by this orientation as the Euler angles.
|
double |
getPitch() |
Computes and returns the pitch angle from the yaw-pitch-roll representation of this orientation.
|
double |
getRoll() |
Computes and returns the roll angle from the yaw-pitch-roll representation of this orientation.
|
void |
getRotationVector(Vector3DBasics rotationVectorToPack) |
Converts and packs this orientation in a 3D rotation vector.
|
double |
getYaw() |
Computes and returns the yaw angle from the yaw-pitch-roll representation of this orientation.
|
void |
getYawPitchRoll(double[] yawPitchRollToPack) |
Converts and packs this orientation in a yaw-pitch-roll representation.
|
void |
inverseTransform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Performs the inverse of the transform to the matrix
matrixOriginal by this orientation
and stores the result in matrixTransformed . |
default void |
inverseTransform(RotationMatrixReadOnly matrixOriginal,
RotationMatrix matrixTransformed) |
Performs the inverse of the transform to the given
matrixOriginal and stores the result
in matrixTransformed . |
default void |
inverseTransform(RotationScaleMatrixReadOnly matrixOriginal,
RotationScaleMatrix matrixTransformed) |
Performs the inverse of the transform to the given
matrixOriginal and stores the result
in matrixTransformed . |
default void |
inverseTransform(Matrix3D matrixToTransform) |
Performs the inverse of the transform to the given matrix by this orientation.
|
default void |
inverseTransform(RotationMatrix matrixToTransform) |
Performs the inverse of the transform to the given rotation matrix by this orientation.
|
default void |
inverseTransform(RotationScaleMatrix matrixToTransform) |
Performs the inverse of the transform to the given rotation-scale matrix by this orientation.
|
default void |
inverseTransform(Tuple2DBasics tupleToTransform) |
Performs the inverse of the transform to the given tuple by this orientation.
|
default void |
inverseTransform(Tuple2DBasics tupleToTransform,
boolean checkIfOrientation2D) |
Performs the inverse of the transform to the given tuple by this orientation.
|
default void |
inverseTransform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed) |
Performs the inverse of the transform to the tuple
tupleOriginal by this orientation and
stores the result in tupleTransformed . |
void |
inverseTransform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfOrientation2D) |
Performs the inverse of the transform to the tuple
tupleOriginal by this orientation and
stores the result in tupleTransformed . |
default void |
inverseTransform(Tuple3DBasics tupleToTransform) |
Performs the inverse of the transform to the given tuple by this orientation.
|
void |
inverseTransform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Performs the inverse of the transform to the tuple
tupleOriginal by this orientation and
stores the result in tupleTransformed . |
default void |
inverseTransform(QuaternionBasics quaternionToTransform) |
Performs the inverse of the transform to the given quaternion by this orientation.
|
default void |
inverseTransform(QuaternionReadOnly quaternionOriginal,
QuaternionBasics quaternionTransformed) |
Performs the inverse of the transform to the given
quaternionOriginal and stores the
result in quaternionTransformed . |
default void |
inverseTransform(Vector4DBasics vectorToTransform) |
Performs the inverse of the transform to the vector part, i.e.
|
void |
inverseTransform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Performs the inverse of the transform to the vector part, i.e.
|
default boolean |
isOrientation2D() |
Tests if this orientation 3D actually represents a rotation strictly around the z-axis.
|
boolean |
isOrientation2D(double epsilon) |
Tests if this orientation 3D actually represents a rotation strictly around the z-axis.
|
default java.lang.String |
toStringAsYawPitchRoll() |
Provides a
String representation of this orientation converted to yaw-pitch-roll angles
as follows: yaw-pitch-roll: (yaw, pitch, roll). |
void |
transform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Transforms the matrix
matrixOriginal by this orientation and stores the result in
matrixTransformed . |
default void |
transform(RotationMatrixReadOnly matrixOriginal,
RotationMatrix matrixTransformed) |
Transforms the given
matrixOriginal and stores the result in matrixTransformed . |
default void |
transform(RotationScaleMatrixReadOnly matrixOriginal,
RotationScaleMatrix matrixTransformed) |
Transforms the given
matrixOriginal and stores the result in matrixTransformed . |
default void |
transform(Matrix3D matrixToTransform) |
Transforms the given matrix by this orientation.
|
default void |
transform(RotationMatrix matrixToTransform) |
Transforms the given rotation matrix by this orientation.
|
default void |
transform(RotationScaleMatrix matrixToTransform) |
Transforms the given rotation-scale matrix by this orientation.
|
default void |
transform(Tuple2DBasics tupleToTransform) |
Transforms the given tuple by this orientation.
|
default void |
transform(Tuple2DBasics tupleToTransform,
boolean checkIfOrientation2D) |
Transforms the given tuple by this orientation.
|
default void |
transform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed) |
Transforms the tuple
tupleOriginal by this orientation and stores the result in
tupleTransformed . |
void |
transform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfOrientation2D) |
Transforms the tuple
tupleOriginal by this orientation and stores the result in
tupleTransformed . |
default void |
transform(Tuple3DBasics tupleToTransform) |
Transforms the given tuple by this orientation.
|
void |
transform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the tuple
tupleOriginal by this orientation and stores the result in
tupleTransformed . |
default void |
transform(QuaternionBasics quaternionToTransform) |
Transforms the given quaternion by this orientation.
|
default void |
transform(QuaternionReadOnly quaternionOriginal,
QuaternionBasics quaternionTransformed) |
Transforms the given
quaternionOriginal and stores the result in
quaternionTransformed . |
default void |
transform(Vector4DBasics vectorToTransform) |
Transforms the vector part, i.e.
|
void |
transform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Transforms the vector part, i.e.
|
static final double ORIENTATION_2D_EPSILON
default boolean isOrientation2D()
This is commonly used to test if this orientation can be used to transform 2D geometry object.
This test uses the default tolerance ORIENTATION_2D_EPSILON
, to specify explicitly the
tolerance to be use, see isOrientation2D(double)
.
true
if this orientation represents a 2D orientation in the XY-plane,
false
otherwise.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.
epsilon
- the tolerance to use.true
if this orientation represents a 2D orientation in the XY-plane,
false
otherwise.default void checkIfOrientation2D()
This is commonly used to test if this orientation can be used to transform 2D geometry object.
NotAnOrientation2DException
- if this orientation does not represent a rotation strictly
around the z-axis.default void checkIfOrientation2D(double epsilon)
This is commonly used to test if this orientation can be used to transform 2D geometry object.
epsilon
- the tolerance to use.NotAnOrientation2DException
- if this orientation does not represent a rotation strictly
around the z-axis.void get(RotationMatrix rotationMatrixToPack)
rotationMatrixToPack
- the rotation matrix into which this orientation is to be stored.
Modified.void get(AxisAngleBasics axisAngleToPack)
axisAngleToPack
- the axis-angle into which this orientation is to be stored. Modified.void get(QuaternionBasics quaternionToPack)
quaternionToPack
- the quaternion into which this orientation is to be stored. Modified.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.
rotationVectorToPack
- the rotation vector in which this orientation is to be stored.
Modified.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) /
yawPitchRollToPack
- the array in which the yaw-pitch-roll angles are stored. Modified.void getEuler(Tuple3DBasics eulerAnglesToPack)
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
eulerAnglesToPack
- the tuple in which the Euler angles are stored. Modified.double getYaw()
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
double getPitch()
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
double getRoll()
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
default void transform(Tuple3DBasics tupleToTransform)
If the given tuple is expressed in the local frame described by this orientation, then the tuple is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
tupleToTransform
- the 3D tuple to be transformed. Modified.void transform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this orientation and stores the result in
tupleTransformed
.
If the given tuple is expressed in the local frame described by this orientation, then the tuple is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
tupleOriginal
- the original value of the tuple to be transformed. Not modified.tupleTransformed
- the result of the original tuple after transformation. Modified.default void addTransform(Tuple3DBasics tupleToTransform)
If the given tuple is expressed in the local frame described by this orientation, then the tuple is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
tupleToTransform
- the 3D tuple to be transformed. Modified.void addTransform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this orientation and adds the result to
tupleTransformed
.
If the given tuple is expressed in the local frame described by this orientation, then the tuple is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
tupleOriginal
- the original value of the tuple to be transformed. Not modified.tupleTransformed
- the result of the original tuple after transformation. Modified.default void transform(Tuple2DBasics tupleToTransform)
If the given tuple is expressed in the local frame described by this orientation, then the tuple is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
tupleToTransform
- the 2D tuple to be transformed. Modified.NotAnOrientation2DException
- if this orientation is not a 2D orientation.default void transform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed)
tupleOriginal
by this orientation and stores the result in
tupleTransformed
.
If the given tuple is expressed in the local frame described by this orientation, then the tuple is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
tupleOriginal
- the original value of the tuple to be transformed. Not modified.tupleTransformed
- the result of the original tuple after transformation. Modified.NotAnOrientation2DException
- if this orientation is not a 2D orientation.default void transform(Tuple2DBasics tupleToTransform, boolean checkIfOrientation2D)
If the given tuple is expressed in the local frame described by this orientation, then the tuple is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
checkIfOrientation2D
- whether this method should assert that this orientation represents a
transformation in the XY plane.tupleToTransform
- the 2D tuple to be transformed. Modified.NotAnOrientation2DException
- if this orientation is not a 2D orientation.void transform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed, boolean checkIfOrientation2D)
tupleOriginal
by this orientation and stores the result in
tupleTransformed
.
If the given tuple is expressed in the local frame described by this orientation, then the tuple is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
checkIfOrientation2D
- whether this method should assert that this orientation represents a
transformation in the XY plane.tupleOriginal
- the original value of the tuple to be transformed. Not modified.tupleTransformed
- the result of the original tuple after transformation. Modified.NotAnOrientation2DException
- if this orientation is not a 2D orientation.default void transform(Matrix3D matrixToTransform)
If the given matrix is expressed in the local frame described by this orientation, then the matrix is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
matrixToTransform
- the 3D matrix to be transformed. Modified.void transform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
by this orientation and stores the result in
matrixTransformed
.
If the given matrix is expressed in the local frame described by this orientation, then the matrix is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
matrixOriginal
- the original value of the matrix to be transformed. Not modified.matrixTransformed
- the result of the original matrix after transformation. Modified.default void transform(Vector4DBasics vectorToTransform)
x
, y
, and z
components, of the given
4D vector, its scalar component s
remains unaffected by this operation.
If the given vector part is expressed in the local frame described by this orientation, then the vector part is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
vectorToTransform
- the 4D tuple to be transformed. Modified.void transform(Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
x
, y
, and z
components, of the given
vectorOriginal
and stores the result in vectorTransformed
.
The scalar component s
remains unaffected by this operation and is simply copied over.
If the given vector part is expressed in the local frame described by this orientation, then the vector part is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
vectorOriginal
- the original value of the vector to be transformed. Not modified.vectorTransformed
- the result of the original vector after transformation. Modified.default void transform(RotationMatrix matrixToTransform)
The operation is equivalent to prepend this orientation to the given rotation matrix.
matrixToTransform
- the rotation matrix to be transformed. Modified.default void transform(RotationMatrixReadOnly matrixOriginal, RotationMatrix matrixTransformed)
matrixOriginal
and stores the result in matrixTransformed
.
The operation is equivalent to prepend this orientation to the matrixOriginal
and store
the result in matrixTransformed
.
matrixOriginal
- the original value of the matrix to be transformed. Not modified.matrixTransformed
- the result of the original matrix after transformation. Modified.default void transform(RotationScaleMatrix matrixToTransform)
The operation is equivalent to prepend this orientation to the rotation part of the given rotation-scale matrix.
matrixToTransform
- the rotation-scale matrix to be transformed. Modified.default void transform(RotationScaleMatrixReadOnly matrixOriginal, RotationScaleMatrix matrixTransformed)
matrixOriginal
and stores the result in matrixTransformed
.
The operation is equivalent to prepend this orientation to the rotation part of
matrixOriginal
and store the result in matrixTransformed
.
matrixOriginal
- the original value of the matrix to be transformed. Not modified.matrixTransformed
- the result of the original matrix after transformation. Modified.default void transform(QuaternionBasics quaternionToTransform)
The operation is equivalent to prepend this orientation to the given quaternion.
quaternionToTransform
- the quaternion to be transformed. Modified.default void transform(QuaternionReadOnly quaternionOriginal, QuaternionBasics quaternionTransformed)
quaternionOriginal
and stores the result in
quaternionTransformed
.
The operation is equivalent to prepend this orientation to the quaternionOriginal
and
store the result in quaternionTransformed
.
quaternionOriginal
- the original value of the quaternion to be transformed. Not modified.quaternionTransformed
- the result of the original quaternion after transformation.
Modified.default void inverseTransform(Tuple3DBasics tupleToTransform)
If the given tuple is expressed in the base frame in which this orientation is expressed, then the tuple is transformed such that it is, after this method is called, expressed in the local frame described by this orientation.
tupleToTransform
- the 3D tuple to be transformed. Modified.void inverseTransform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this orientation and
stores the result in tupleTransformed
.
If the given tuple is expressed in the base frame in which this orientation is expressed, then the tuple is transformed such that it is, after this method is called, expressed in the local frame described by this orientation.
tupleOriginal
- the original value of the tuple to be transformed. Not modified.tupleTransformed
- the result of the original tuple after transformation. Modified.default void inverseTransform(Tuple2DBasics tupleToTransform)
If the given tuple is expressed in the base frame in which this orientation is expressed, then the tuple is transformed such that it is, after this method is called, expressed in the local frame described by this orientation.
tupleToTransform
- the 2D tuple to be transformed. Modified.NotAnOrientation2DException
- if this orientation is not a 2D orientation.default void inverseTransform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed)
tupleOriginal
by this orientation and
stores the result in tupleTransformed
.
If the given tuple is expressed in the base frame in which this orientation is expressed, then the tuple is transformed such that it is, after this method is called, expressed in the local frame described by this orientation.
tupleOriginal
- the original value of the tuple to be transformed. Not modified.tupleTransformed
- the result of the original tuple after transformation. Modified.NotAnOrientation2DException
- if this orientation is not a 2D orientation.default void inverseTransform(Tuple2DBasics tupleToTransform, boolean checkIfOrientation2D)
If the given tuple is expressed in the base frame in which this orientation is expressed, then the tuple is transformed such that it is, after this method is called, expressed in the local frame described by this orientation.
checkIfOrientation2D
- whether this method should assert that this orientation represents a
transformation in the XY plane.tupleToTransform
- the 2D tuple to be transformed. Modified.NotAnOrientation2DException
- if this orientation is not a 2D orientation.void inverseTransform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed, boolean checkIfOrientation2D)
tupleOriginal
by this orientation and
stores the result in tupleTransformed
.
If the given tuple is expressed in the base frame in which this orientation is expressed, then the tuple is transformed such that it is, after this method is called, expressed in the local frame described by this orientation.
checkIfOrientation2D
- whether this method should assert that this orientation represents a
transformation in the XY plane.tupleOriginal
- the original value of the tuple to be transformed. Not modified.tupleTransformed
- the result of the original tuple after transformation. Modified.NotAnOrientation2DException
- if this orientation is not a 2D orientation.default void inverseTransform(Matrix3D matrixToTransform)
If the given matrix is expressed in the base frame in which this orientation is expressed, then the matrix is transformed such that it is, after this method is called, expressed in the local frame described by this orientation.
matrixToTransform
- the 3D matrix to be transformed. Modified.void inverseTransform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
by this orientation
and stores the result in matrixTransformed
.
If the given matrix is expressed in the base frame in which this orientation is expressed, then the matrix is transformed such that it is, after this method is called, expressed in the local frame described by this orientation.
matrixOriginal
- the original value of the matrix to be transformed. Not modified.matrixTransformed
- the result of the original matrix after transformation. Modified.default void inverseTransform(Vector4DBasics vectorToTransform)
x
, y
, and
z
components, of the given 4D vector, its scalar component s
remains unaffected
by this operation.
If the given vector part is expressed in the base frame in which this orientation is expressed, then the vector part is transformed such that it is, after this method is called, expressed in the local frame described by this orientation.
vectorToTransform
- the 4D tuple to be transformed. Modified.void inverseTransform(Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
x
, y
, and
z
components, of the given vectorOriginal
and stores the result in
vectorTransformed
.
The scalar component s
remains unaffected by this operation and is simply copied over.
If the given vector part is expressed in the local frame described by this orientation, then the vector part is transformed such that it is, after this method is called, expressed in the base frame in which this orientation is expressed.
vectorOriginal
- the original value of the vector to be transformed. Not modified.vectorTransformed
- the result of the original vector after transformation. Modified.default void inverseTransform(RotationMatrix matrixToTransform)
The operation is equivalent to prepend the inverse of this orientation to the given rotation matrix.
matrixToTransform
- the rotation matrix to be transformed. Modified.default void inverseTransform(RotationMatrixReadOnly matrixOriginal, RotationMatrix matrixTransformed)
matrixOriginal
and stores the result
in matrixTransformed
.
The operation is equivalent to prepend the inverse of this orientation to the
matrixOriginal
and store the result in matrixTransformed
.
matrixOriginal
- the original value of the matrix to be transformed. Not modified.matrixTransformed
- the result of the original matrix after transformation. Modified.default void inverseTransform(RotationScaleMatrix matrixToTransform)
The operation is equivalent to prepend the inverse of this orientation to the rotation part of the given rotation-scale matrix.
matrixToTransform
- the rotation-scale matrix to be transformed. Modified.default void inverseTransform(RotationScaleMatrixReadOnly matrixOriginal, RotationScaleMatrix matrixTransformed)
matrixOriginal
and stores the result
in matrixTransformed
.
The operation is equivalent to prepend the inverse of this orientation to the rotation part of
matrixOriginal
and store the result in matrixTransformed
.
matrixOriginal
- the original value of the matrix to be transformed. Not modified.matrixTransformed
- the result of the original matrix after transformation. Modified.default void inverseTransform(QuaternionBasics quaternionToTransform)
The operation is equivalent to prepend the inverse of this orientation to the given quaternion.
quaternionToTransform
- the quaternion to be transformed. Modified.default void inverseTransform(QuaternionReadOnly quaternionOriginal, QuaternionBasics quaternionTransformed)
quaternionOriginal
and stores the
result in quaternionTransformed
.
The operation is equivalent to prepend the inverse of this orientation to the
quaternionOriginal
and store the result in quaternionTransformed
.
quaternionOriginal
- the original value of the quaternion to be transformed. Not modified.quaternionTransformed
- the result of the original quaternion after transformation.
Modified.default java.lang.String toStringAsYawPitchRoll()
String
representation of this orientation converted to yaw-pitch-roll angles
as follows: yaw-pitch-roll: (yaw, pitch, roll).