public abstract class RotationVectorConversion
extends java.lang.Object
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.
To convert an orientation into other data structure types see:
AxisAngleConversion
,
QuaternionConversion
,
RotationMatrixConversion
,
YawPitchRollConversion
.
Modifier and Type | Field | Description |
---|---|---|
static double |
EPS |
Tolerance used to identify various edge cases, such as to identify when an axis-angle represents
a zero orientation.
|
Constructor | Description |
---|---|
RotationVectorConversion() |
Modifier and Type | Method | Description |
---|---|---|
static void |
convertAxisAngleToRotationVector(AxisAngleReadOnly axisAngle,
Vector3DBasics rotationVectorToPack) |
Converts the given axis-angle into a rotation vector.
|
static void |
convertAxisAngleToRotationVectorImpl(double ux,
double uy,
double uz,
double angle,
Vector3DBasics rotationVectorToPack) |
Converts the given axis-angle into a rotation vector.
|
static void |
convertMatrixToRotationVector(RotationMatrixReadOnly rotationMatrix,
Vector3DBasics rotationVectorToPack) |
Converts the given rotation matrix into a rotation vector.
|
static void |
convertMatrixToRotationVector(RotationScaleMatrixReadOnly rotationScaleMatrix,
Vector3DBasics rotationVectorToPack) |
Converts the rotation part of the given rotation-scale matrix into a rotation vector.
|
(package private) static void |
convertMatrixToRotationVectorImpl(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22,
Vector3DBasics rotationVectorToPack) |
Converts the given rotation matrix into a rotation vector.
|
static void |
convertQuaternionToRotationVector(QuaternionReadOnly quaternion,
Vector3DBasics rotationVectorToPack) |
Converts the given quaternion into a rotation vector.
|
static void |
convertYawPitchRollToRotationVector(double[] yawPitchRoll,
Vector3DBasics rotationVectorToPack) |
Converts the given yaw-pitch-roll angles into a rotation vector.
|
static void |
convertYawPitchRollToRotationVector(double yaw,
double pitch,
double roll,
Vector3DBasics rotationVectorToPack) |
Converts the given yaw-pitch-roll angles into a rotation vector.
|
public static final double EPS
public static void convertAxisAngleToRotationVector(AxisAngleReadOnly axisAngle, Vector3DBasics rotationVectorToPack)
After calling this method, the axis-angle and the rotation vector represent the same orientation.
Edge case:
Double.NaN
, the rotation vector is set to
Double.NaN
.
EPS
, the rotation vector is set to zero.
axisAngle
- the axis-angle to use for the conversion. Not modified.rotationVectorToPack
- the vector in which the result is stored. Modified.public static void convertAxisAngleToRotationVectorImpl(double ux, double uy, double uz, double angle, Vector3DBasics rotationVectorToPack)
After calling this method, the axis-angle and the rotation vector represent the same orientation.
Edge case:
Double.NaN
, the rotation vector is set to
Double.NaN
.
EPS
, the rotation vector is set to zero.
ux
- the axis x-component of the axis-angle to use for the conversion.uy
- the axis y-component of the axis-angle to use for the conversion.uz
- the axis z-component of the axis-angle to use for the conversion.angle
- the angle of the axis-angle to use for the conversion.rotationVectorToPack
- the vector in which the result is stored. Modified.public static void convertQuaternionToRotationVector(QuaternionReadOnly quaternion, Vector3DBasics rotationVectorToPack)
After calling this method, the quaternion and the rotation vector represent the same orientation.
Edge case:
Double.NaN
, the rotation vector is set to
Double.NaN
.
EPS
, the rotation vector is set to zero.
quaternion
- the quaternion to use for the conversion. Not modified.rotationVectorToPack
- the vector in which the result is stored. Modified.public static void convertMatrixToRotationVector(RotationScaleMatrixReadOnly rotationScaleMatrix, Vector3DBasics rotationVectorToPack)
After calling this method, the rotation matrix and the rotation vector represent the same orientation.
Edge case:
Double.NaN
, the rotation vector is set
to Double.NaN
.
rotationScaleMatrix
- a 3-by-3 matrix representing an orientation and a scale. Only the
orientation part is used during the conversion. Not modified.rotationVectorToPack
- the vector in which the result is stored. Modified.public static void convertMatrixToRotationVector(RotationMatrixReadOnly rotationMatrix, Vector3DBasics rotationVectorToPack)
After calling this method, the rotation matrix and the rotation vector represent the same orientation.
Edge case:
Double.NaN
, the rotation vector is set
to Double.NaN
.
rotationMatrix
- a 3-by-3 matrix representing an orientation. Not modified.rotationVectorToPack
- the vector in which the result is stored. Modified.static void convertMatrixToRotationVectorImpl(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22, Vector3DBasics rotationVectorToPack)
This method is for internal use. Use
convertMatrixToRotationVector(RotationMatrixReadOnly, Vector3DBasics)
or
convertMatrixToRotationVector(RotationScaleMatrixReadOnly, Vector3DBasics)
instead.
After calling this method, the rotation matrix and the rotation vector represent the same orientation.
Edge case:
Double.NaN
, the rotation vector is set
to Double.NaN
.
m00
- the new 1st row 1st column coefficient for the matrix to use for the conversion.m01
- the new 1st row 2nd column coefficient for the matrix to use for the conversion.m02
- the new 1st row 3rd column coefficient for the matrix to use for the conversion.m10
- the new 2nd row 1st column coefficient for the matrix to use for the conversion.m11
- the new 2nd row 2nd column coefficient for the matrix to use for the conversion.m12
- the new 2nd row 3rd column coefficient for the matrix to use for the conversion.m20
- the new 3rd row 1st column coefficient for the matrix to use for the conversion.m21
- the new 3rd row 2nd column coefficient for the matrix to use for the conversion.m22
- the new 3rd row 3rd column coefficient for the matrix to use for the conversion.rotationVectorToPack
- the vector in which the result is stored. Modified.public static void convertYawPitchRollToRotationVector(double[] yawPitchRoll, Vector3DBasics rotationVectorToPack)
After calling this method, the yaw-pitch-roll and the rotation vector represent the same orientation.
Edge case:
Double.NaN
, the rotation vector is set
to Double.NaN
.
Note: the yaw-pitch-roll representation, also called Euler angles, corresponds to the
representation of an orientation by decomposing it by three successive rotations around the three
axes: Z (yaw), Y (pitch), and X (roll). The equivalent rotation matrix of such representation is:
R = RZ(yaw) * RY(pitch) * RX(roll)
yawPitchRoll
- the yaw-pitch-roll angles to use in the conversion. Not modified.rotationVectorToPack
- the vector in which the result is stored. Modified.public static void convertYawPitchRollToRotationVector(double yaw, double pitch, double roll, Vector3DBasics rotationVectorToPack)
After calling this method, the yaw-pitch-roll and the rotation vector represent the same orientation.
Edge case:
Double.NaN
, the rotation vector is set
to Double.NaN
.
Note: the yaw-pitch-roll representation, also called Euler angles, corresponds to the
representation of an orientation by decomposing it by three successive rotations around the three
axes: Z (yaw), Y (pitch), and X (roll). The equivalent rotation matrix of such representation is:
R = RZ(yaw) * RY(pitch) * RX(roll)
yaw
- the yaw angle to use in the conversion.pitch
- the pitch angle to use in the conversion.roll
- the roll angle to use in the conversion.rotationVectorToPack
- the vector in which the result is stored. Modified.