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 and Description |
---|---|
static double |
EPS
Tolerance used to identify various edge cases, such as to identify when an axis-angle represents
a zero orientation.
|
Constructor and Description |
---|
RotationVectorConversion() |
Modifier and Type | Method and 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.
|
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.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.