public class AxisAngleConversion
extends java.lang.Object
To convert an orientation into other data structure types see:
QuaternionConversion
,
RotationMatrixConversion
,
RotationVectorConversion
,
YawPitchRollConversion
.
Modifier and Type | Field | Description |
---|---|---|
static double |
EPS |
Tolerance used to identify various edge cases, such as to identify when a quaternion is a neutral
quaternion.
|
Constructor | Description |
---|---|
AxisAngleConversion() |
Modifier and Type | Method | Description |
---|---|---|
static void |
convertMatrixToAxisAngle(double m00,
double m01,
double m02,
double m10,
double m11,
double m12,
double m20,
double m21,
double m22,
AxisAngleBasics axisAngleToPack) |
Converts the given rotation matrix into an axis-angle.
|
static void |
convertMatrixToAxisAngle(RotationMatrixReadOnly rotationMatrix,
AxisAngleBasics axisAngleToPack) |
Converts the given rotation matrix into an axis-angle.
|
static void |
convertMatrixToAxisAngle(RotationScaleMatrixReadOnly rotationScaleMatrix,
AxisAngleBasics axisAngleToPack) |
Converts the rotation part of the given rotation-scale matrix into an axis-angle.
|
static void |
convertQuaternionToAxisAngle(double qx,
double qy,
double qz,
double qs,
AxisAngleBasics axisAngleToPack) |
Converts the given quaternion into an axis-angle.
|
static void |
convertQuaternionToAxisAngle(QuaternionReadOnly quaternion,
AxisAngleBasics axisAngleToPack) |
Converts the given quaternion into an axis-angle.
|
static void |
convertRotationVectorToAxisAngle(double rx,
double ry,
double rz,
AxisAngleBasics axisAngleToPack) |
Converts the rotation vector into an axis-angle.
|
static void |
convertRotationVectorToAxisAngle(Vector3DReadOnly rotationVector,
AxisAngleBasics axisAngleToPack) |
Converts the rotation vector into an axis-angle.
|
static void |
convertYawPitchRollToAxisAngle(double[] yawPitchRoll,
AxisAngleBasics axisAngleToPack) |
Converts the given yaw-pitch-roll angles into an axis-angle.
|
static void |
convertYawPitchRollToAxisAngle(double yaw,
double pitch,
double roll,
AxisAngleBasics axisAngleToPack) |
Converts the given yaw-pitch-roll angles into an axis-angle.
|
public static final double EPS
public static void convertMatrixToAxisAngle(RotationScaleMatrixReadOnly rotationScaleMatrix, AxisAngleBasics axisAngleToPack)
After calling this method, the orientation represented by the axis-angle is the same as the given rotation part of the rotation-scale matrix.
Edge case:
Double.NaN
, the axis-angle 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.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void convertMatrixToAxisAngle(RotationMatrixReadOnly rotationMatrix, AxisAngleBasics axisAngleToPack)
After calling this method, the orientation represented by the axis-angle is the same as the given rotation matrix.
Edge case:
Double.NaN
, the axis-angle is set to
Double.NaN
.
rotationMatrix
- a 3-by-3 matrix representing an orientation. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void convertMatrixToAxisAngle(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22, AxisAngleBasics axisAngleToPack)
After calling this method, the orientation represented by the axis-angle is the same as the given rotation matrix.
Edge case:
Double.NaN
, the axis-angle is set to
Double.NaN
.
m00
- the 1st row 1st column coefficient of the rotation matrix.m01
- the 1st row 2nd column coefficient of the rotation matrix.m02
- the 1st row 3rd column coefficient of the rotation matrix.m10
- the 2nd row 1st column coefficient of the rotation matrix.m11
- the 2nd row 2nd column coefficient of the rotation matrix.m12
- the 2nd row 3rd column coefficient of the rotation matrix.m20
- the 3rd row 1st column coefficient of the rotation matrix.m21
- the 3rd row 2nd column coefficient of the rotation matrix.m22
- the 3rd row 3rd column coefficient of the rotation matrix.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void convertQuaternionToAxisAngle(QuaternionReadOnly quaternion, AxisAngleBasics axisAngleToPack)
After calling this method, the quaternion and the axis-angle represent the same orientation.
Edge case:
Double.NaN
, the axis-angle is set to
Double.NaN
.
AxisAngleBasics.setToZero()
.
quaternion
- the unit quaternion to use for the conversion. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void convertQuaternionToAxisAngle(double qx, double qy, double qz, double qs, AxisAngleBasics axisAngleToPack)
After calling this method, the quaternion and the axis-angle represent the same orientation.
Edge case:
Double.NaN
, the axis-angle is set to
Double.NaN
.
AxisAngleBasics.setToZero()
.
qx
- the x-component of the quaternion.qy
- the y-component of the quaternion.qz
- the z-component of the quaternion.qs
- the s-component of the quaternion.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void convertRotationVectorToAxisAngle(Vector3DReadOnly rotationVector, AxisAngleBasics axisAngleToPack)
After calling this method, the rotation vector and the axis-angle represent the same orientation.
Edge case:
Double.NaN
, the axis-angle is set to
Double.NaN
.
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.
rotationVector
- the rotation vector to use in the conversion. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void convertRotationVectorToAxisAngle(double rx, double ry, double rz, AxisAngleBasics axisAngleToPack)
After calling this method, the rotation vector and the axis-angle represent the same orientation.
Edge case:
Double.NaN
, the axis-angle is set to
Double.NaN
.
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.
rx
- the x-component of the rotation vector to use in the conversion.ry
- the y-component of the rotation vector to use in the conversion.rz
- the z-component of the rotation vector to use in the conversion.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void convertYawPitchRollToAxisAngle(double[] yawPitchRoll, AxisAngleBasics axisAngleToPack)
After calling this method, the yaw-pitch-roll and the axis-angle represent the same orientation.
Edge case:
Double.NaN
, the axis-angle 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.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void convertYawPitchRollToAxisAngle(double yaw, double pitch, double roll, AxisAngleBasics axisAngleToPack)
After calling this method, the yaw-pitch-roll and the axis-angle represent the same orientation.
Edge case:
Double.NaN
, the axis-angle 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.axisAngleToPack
- the axis-angle in which the result is stored. Modified.