Orientation3DReadOnly
AxisAngleBasics
AxisAngle
, AxisAngle32
public interface AxisAngleReadOnly extends Orientation3DReadOnly
An axis-angle is used to represent a 3D orientation by a unitary axis of components (x, y, z) and an angle of rotation usually expressed in radians.
ORIENTATION_2D_EPSILON
Modifier and Type | Method | Description |
---|---|---|
default void |
addTransform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the tuple
tupleOriginal by this orientation and adds the result to
tupleTransformed . |
default double |
axisNorm() |
Calculates and returns the norm of the axis of this axis-angle.
|
default void |
checkIfIsZOnly(double epsilon) |
Deprecated.
|
default boolean |
containsNaN() |
Tests if this axis-angle contains a
Double.NaN . |
default double |
distance(AxisAngleReadOnly other) |
Computes and returns the distance from this axis-angle to
other . |
default boolean |
epsilonEquals(AxisAngleReadOnly other,
double epsilon) |
Tests on a per component basis, if this axis-angle is equal to
other to an
epsilon . |
default boolean |
equals(AxisAngleReadOnly other) |
Tests on a per component basis, if this axis-angle is exactly equal to
other . |
default boolean |
geometricallyEquals(AxisAngleReadOnly other,
double epsilon) |
Tests if
this and other represent the same orientation to an epsilon . |
default void |
get(double[] axisAngleArrayToPack) |
Packs the components of this axis-angle in an array starting from its first index.
|
default void |
get(float[] axisAngleArrayToPack) |
Packs the components of this axis-angle in an array starting from its first index.
|
default void |
get(int startIndex,
double[] axisAngleArrayToPack) |
Packs the components of this axis-angle in an array starting from
startIndex . |
default void |
get(int startIndex,
float[] axisAngleArrayToPack) |
Packs the components of this axis-angle in an array starting from
startIndex . |
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(QuaternionBasics quaternionToPack) |
Converts, if necessary, and packs this orientation in a quaternion.
|
double |
getAngle() |
Returns the angle of this axis-angle, usually expressed in radians.
|
default float |
getAngle32() |
Returns the angle of this axis-angle, usually expressed in radians.
|
default double |
getElement(int index) |
Selects a component of this axis-angle based on
index and returns its value. |
default float |
getElement32(int index) |
Selects a component of this axis-angle based on
index and returns its value. |
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.
|
double |
getX() |
Returns the x-component of the unitary axis of this axis-angle.
|
default float |
getX32() |
Returns the x-component of the unitary axis of this axis-angle.
|
double |
getY() |
Returns the y-component of the unitary axis of this axis-angle.
|
default float |
getY32() |
Returns the y-component of the unitary axis of this axis-angle.
|
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.
|
double |
getZ() |
Returns the z-component of the unitary axis of this axis-angle.
|
default float |
getZ32() |
Returns the z-component of the unitary axis of this axis-angle.
|
default 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(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(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(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Performs the inverse of the transform to the vector part, i.e.
|
default boolean |
isAxisUnitary(double epsilon) |
Tests if the axis of this axis-angle is of unit-length.
|
default boolean |
isOrientation2D(double epsilon) |
Tests if this orientation 3D actually represents a rotation strictly around the z-axis.
|
default boolean |
isZOnly(double epsilon) |
Deprecated.
Use
isOrientation2D(double) instead |
default void |
transform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Transforms the matrix
matrixOriginal by this orientation and stores the result in
matrixTransformed . |
default void |
transform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfOrientation2D) |
Transforms the tuple
tupleOriginal by this orientation and stores the result in
tupleTransformed . |
default void |
transform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the tuple
tupleOriginal by this orientation and stores the result in
tupleTransformed . |
default void |
transform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Transforms the vector part, i.e.
|
addTransform, checkIfOrientation2D, checkIfOrientation2D, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, isOrientation2D, toStringAsYawPitchRoll, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform
double getAngle()
default float getAngle32()
double getX()
default float getX32()
double getY()
default float getY32()
double getZ()
default float getZ32()
default boolean containsNaN()
Double.NaN
.true
if this axis-angle contains a Double.NaN
, false
otherwise.default double axisNorm()
norm = √(x2 + y2 + z2)
default boolean isAxisUnitary(double epsilon)
epsilon
- tolerance to use in this test.true
if the axis is unitary, false
otherwise.@Deprecated default boolean isZOnly(double epsilon)
isOrientation2D(double)
insteadThis is commonly used to test if the axis-angle can be used to transform 2D geometry object.
epsilon
- the tolerance to use.true
if this axis-angle represents a rotation around the z-axis, false
otherwise.@Deprecated default void checkIfIsZOnly(double epsilon)
This is commonly used to test if the axis-angle can be used to transform 2D geometry object.
epsilon
- the tolerance to use.NotAMatrix2DException
- if this axis-angle does not represent a rotation around the
z-axis.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.
An axis-angle is an orientation 2D if either:
epsilon
.
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(AxisAngleReadOnly other)
other
.other
- the other axis-angle to measure the distance. Not 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 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 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 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 get(double[] axisAngleArrayToPack)
axisAngleArrayToPack
- the array in which this axis-angle is stored. Modified.default void get(int startIndex, double[] axisAngleArrayToPack)
startIndex
. The
components are packed in the following order: x, y, z, and angle.startIndex
- the index in the array where the first component is stored.axisAngleArrayToPack
- the array in which this axis-angle is stored. Modified.default void get(float[] axisAngleArrayToPack)
axisAngleArrayToPack
- the array in which this axis-angle is stored. Modified.default void get(int startIndex, float[] axisAngleArrayToPack)
startIndex
. The
components are packed in the following order: x, y, z, and angle.startIndex
- the index in the array where the first component is stored.axisAngleArrayToPack
- the array in which this axis-angle is stored. Modified.default double getElement(int index)
index
and returns its value.
For index
values of 0, 1, and 2, the corresponding components are x, y, and z,
respectively, while 3 corresponds to the angle.
index
- the index of the component to get.java.lang.IndexOutOfBoundsException
- if index
∉ [0, 3].default float getElement32(int index)
index
and returns its value.
For index
values of 0, 1, and 2, the corresponding components are x, y, and z,
respectively, while 3 corresponds to the angle.
index
- the index of the component to get.java.lang.IndexOutOfBoundsException
- if index
∉ [0, 3].default 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.
transform
in interface Orientation3DReadOnly
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(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.
addTransform
in interface Orientation3DReadOnly
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(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.
transform
in interface Orientation3DReadOnly
tupleOriginal
- the original value of the tuple to be transformed. Not modified.tupleTransformed
- the result of the original tuple after transformation. Modified.checkIfOrientation2D
- whether this method should assert that this orientation represents a
transformation in the XY plane.default 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.
transform
in interface Orientation3DReadOnly
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(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.
transform
in interface Orientation3DReadOnly
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(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.
inverseTransform
in interface Orientation3DReadOnly
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(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.
inverseTransform
in interface Orientation3DReadOnly
tupleOriginal
- the original value of the tuple to be transformed. Not modified.tupleTransformed
- the result of the original tuple after transformation. Modified.checkIfOrientation2D
- whether this method should assert that this orientation represents a
transformation in the XY plane.default 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.
inverseTransform
in interface Orientation3DReadOnly
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(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.
inverseTransform
in interface Orientation3DReadOnly
matrixOriginal
- the original value of the matrix to be transformed. Not modified.matrixTransformed
- the result of the original matrix after transformation. Modified.default boolean equals(AxisAngleReadOnly other)
other
. A
failing test does not necessarily mean that the two axis-angles represent two different
orientations.other
- the other axis-angle to compare against this. Not modified.true
if the two axis-angles are exactly equal component-wise, false
otherwise.default boolean epsilonEquals(AxisAngleReadOnly other, double epsilon)
other
to an
epsilon
. A failing test does not necessarily mean that the two axis-angles represent
two different orientations.other
- the other axis-angle to compare against this. Not modified.epsilon
- tolerance to use when comparing each component.true
if the two axis-angle are equal component-wise, false
otherwise.default boolean geometricallyEquals(AxisAngleReadOnly other, double epsilon)
this
and other
represent the same orientation to an epsilon
.
Two axis-angle 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 axis-angle to compare against this. Not modified.epsilon
- the maximum angle for the two quaternions to be considered equal.true
if the two axis-angle represent the same geometry, false
otherwise.