public abstract class AxisAngleTools
extends java.lang.Object
This class is mostly used to centralize operations on axis-angles, these operations are available
in classes such as AxisAngle
and the user should always using this classes instead of
using tools classes. The API of these tools classes is more likely to change over time.
Modifier and Type | Field | Description |
---|---|---|
static double |
EPS |
Tolerance used to identify edge cases, such as when the axis part of an axis-angle can not be
normalized.
|
Constructor | Description |
---|---|
AxisAngleTools() |
Modifier and Type | Method | Description |
---|---|---|
static void |
addTransform(AxisAngleReadOnly axisAngle,
Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the tuple
tupleOriginal using axisAngle and adds the result to
tupleTransformed . |
static void |
appendPitchRotation(AxisAngleReadOnly axisAngleOriginal,
double pitch,
AxisAngleBasics axisAngleToPack) |
Append a rotation about the y-axis to
axisAngleOriginal and stores the result in
axisAngleToPack . |
static void |
appendRollRotation(AxisAngleReadOnly axisAngleOriginal,
double roll,
AxisAngleBasics axisAngleToPack) |
Append a rotation about the x-axis to
axisAngleOriginal and stores the result in
axisAngleToPack . |
static void |
appendYawRotation(AxisAngleReadOnly axisAngleOriginal,
double yaw,
AxisAngleBasics axisAngleToPack) |
Append a rotation about the z-axis to
axisAngleOriginal and stores the result in
axisAngleToPack . |
static double |
distance(AxisAngleReadOnly aa1,
AxisAngleReadOnly aa2) |
Computes and returns the distance between the two axis-angles
aa1 and aa2 . |
static void |
inverseTransform(AxisAngleReadOnly axisAngle,
Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Performs the inverse of the transform of the matrix
matrixOriginal using
axisAngle and stores the result in matrixTransformed . |
static void |
inverseTransform(AxisAngleReadOnly axisAngle,
RotationMatrixReadOnly rotationMatrixOriginal,
RotationMatrix rotationMatrixTransformed) |
Performs the inverse of the transform of the rotation matrix
rotationMatrixOriginal using
axisAngle and stores the result in rotationMatrixTransformed . |
static void |
inverseTransform(AxisAngleReadOnly axisAngle,
Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfTransformInXYPlane) |
Performs the inverse of the transform of the tuple
tupleOriginal using axisAngle
and stores the result in tupleTransformed . |
static void |
inverseTransform(AxisAngleReadOnly axisAngle,
Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Performs the inverse of the transform of the tuple
tupleOriginal using axisAngle
and stores the result in tupleTransformed . |
static void |
inverseTransform(AxisAngleReadOnly axisAngle,
QuaternionReadOnly quaternionOriginal,
QuaternionBasics quaternionTransformed) |
Performs the inverse of the transform of the quaternion
quaternionOriginal using
axisAngle and stores the result in quaternionTransformed . |
static void |
inverseTransform(AxisAngleReadOnly axisAngle,
Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Performs the inverse of the transform of the vector
vectorOriginal using
axisAngle and stores the result in vectorTransformed . |
static void |
multiply(AxisAngleReadOnly orientation1,
boolean inverse1,
Orientation3DReadOnly orientation2,
boolean inverse2,
AxisAngleBasics axisAngleToPack) |
Performs the multiplication of
orientation1 and orientation2 and stores the
result in axisAngleToPack . |
static void |
multiply(AxisAngleReadOnly aa1,
AxisAngleReadOnly aa2,
AxisAngleBasics axisAngleToPack) |
Performs the multiplication of
aa1 and aa2 and stores the result in
axisAngleToPack . |
static void |
multiply(Orientation3DReadOnly orientation1,
boolean inverse1,
AxisAngleReadOnly orientation2,
boolean inverse2,
AxisAngleBasics axisAngleToPack) |
Performs the multiplication of
orientation1 and orientation2 and stores the
result in axisAngleToPack . |
static void |
multiply(Orientation3DReadOnly orientation1,
boolean inverse1,
Orientation3DReadOnly orientation2,
boolean inverse2,
AxisAngleBasics axisAngleToPack) |
Performs the multiplication of
orientation1 and orientation2 and stores the
result in axisAngleToPack . |
static void |
multiplyInvertBoth(AxisAngleReadOnly aa1,
AxisAngleReadOnly aa2,
AxisAngleBasics axisAngleToPack) |
Performs the multiplication of the inverse of
aa1 and the inverse of aa2 and
stores the result in axisAngleToPack . |
static void |
multiplyInvertLeft(AxisAngleReadOnly aa1,
AxisAngleReadOnly aa2,
AxisAngleBasics axisAngleToPack) |
Performs the multiplication of the inverse of
aa1 and aa2 and stores the result
in axisAngleToPack . |
static void |
multiplyInvertRight(AxisAngleReadOnly aa1,
AxisAngleReadOnly aa2,
AxisAngleBasics axisAngleToPack) |
Performs the multiplication of
aa1 and the inverse of aa2 and stores the result
in axisAngleToPack . |
static void |
prependPitchRotation(double pitch,
AxisAngleReadOnly axisAngleOriginal,
AxisAngleBasics axisAngleToPack) |
Prepend a rotation about the y-axis to
axisAngleOriginal and stores the result in
axisAngleToPack . |
static void |
prependRollRotation(double roll,
AxisAngleReadOnly axisAngleOriginal,
AxisAngleBasics axisAngleToPack) |
Prepend a rotation about the x-axis to
axisAngleOriginal and stores the result in
axisAngleToPack . |
static void |
prependYawRotation(double yaw,
AxisAngleReadOnly axisAngleOriginal,
AxisAngleBasics axisAngleToPack) |
Prepend a rotation about the z-axis to
axisAngleOriginal and stores the result in
axisAngleToPack . |
static void |
transform(AxisAngleReadOnly axisAngle,
Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Transforms the matrix
matrixOriginal using axisAngle and stores the result in
matrixTransformed . |
static void |
transform(AxisAngleReadOnly axisAngle,
RotationMatrixReadOnly rotationMatrixOriginal,
RotationMatrix rotationMatrixTransformed) |
Transforms the rotation matrix
rotationMatrixOriginal using axisAngle and stores
the result in rotationMatrixTransformed . |
static void |
transform(AxisAngleReadOnly axisAngle,
Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfTransformInXYPlane) |
Transforms the tuple
tupleOriginal using axisAngle and stores the result in
tupleTransformed . |
static void |
transform(AxisAngleReadOnly axisAngle,
Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the tuple
tupleOriginal using axisAngle and stores the result in
tupleTransformed . |
static void |
transform(AxisAngleReadOnly axisAngle,
QuaternionReadOnly quaternionOriginal,
QuaternionBasics quaternionTransformed) |
Transforms the quaternion
quaternionOriginal using axisAngle and stores the
result in quaternionTransformed . |
static void |
transform(AxisAngleReadOnly axisAngle,
Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Transforms the vector
vectorOriginal using axisAngle and stores the result in
vectorTransformed . |
public static final double EPS
public static void transform(AxisAngleReadOnly axisAngle, Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
using axisAngle
and stores the result in
tupleTransformed
.
Both tuples can be the same object for performing in place transformation.
axisAngle
- the axis-angle used to transform the tuple. Not modified.tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.public static void inverseTransform(AxisAngleReadOnly axisAngle, Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
using axisAngle
and stores the result in tupleTransformed
.
This is equivalent to calling
transform(AxisAngleReadOnly, Tuple3DReadOnly, Tuple3DBasics)
with an axis-angle that has
an angle of opposite value compared to the given one.
Both tuples can be the same object for performing in place transformation.
axisAngle
- the axis-angle used to transform the tuple. Not modified.tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.public static void addTransform(AxisAngleReadOnly axisAngle, Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
using axisAngle
and adds the result to
tupleTransformed
.
Both tuples can be the same object for performing in place transformation.
axisAngle
- the axis-angle used to transform the tuple. Not modified.tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.public static void transform(AxisAngleReadOnly axisAngle, Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed, boolean checkIfTransformInXYPlane)
tupleOriginal
using axisAngle
and stores the result in
tupleTransformed
.
Both tuples can be the same object for performing in place transformation.
axisAngle
- the axis-angle used to transform the tuple. Not modified.tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.checkIfTransformInXYPlane
- whether this method should assert that the axis-angle represents
a transformation in the XY plane.NotAMatrix2DException
- if checkIfTransformInXYPlane == true
and the axis-angle
does not represent a transformation in the XY plane.public static void inverseTransform(AxisAngleReadOnly axisAngle, Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed, boolean checkIfTransformInXYPlane)
tupleOriginal
using axisAngle
and stores the result in tupleTransformed
.
This is equivalent to calling
transform(AxisAngleReadOnly, Tuple2DReadOnly, Tuple2DBasics, boolean)
with an axis-angle
that has an angle of opposite value compared to the given one.
Both tuples can be the same object for performing in place transformation.
axisAngle
- the axis-angle used to transform the tuple. Not modified.tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.checkIfTransformInXYPlane
- whether this method should assert that the axis-angle represents
a transformation in the XY plane.NotAMatrix2DException
- if checkIfTransformInXYPlane == true
and the axis-angle
does not represent a transformation in the XY plane.public static void transform(AxisAngleReadOnly axisAngle, Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
using axisAngle
and stores the result in
matrixTransformed
.
Both matrices can be the same object for performing in place transformation.
matrixTransformed = R(axisAngle) * matrixOriginal * R(axisAngle)-1
where R(axisAngle) is the function to convert an axis-angle into a 3-by-3 rotation matrix.
axisAngle
- the axis-angle used to transform the matrix. Not modified.matrixOriginal
- the matrix to transform. Not modified.matrixTransformed
- the matrix in which the result is stored. Modified.public static void inverseTransform(AxisAngleReadOnly axisAngle, Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
using
axisAngle
and stores the result in matrixTransformed
.
This is equivalent to calling transform(AxisAngleReadOnly, Matrix3DReadOnly, Matrix3D)
with an axis-angle that has an angle of opposite value compared to the given one.
Both matrices can be the same object for performing in place transformation.
matrixTransformed = R(axisAngle)-1 * matrixOriginal * R(axisAngle)
where R(axisAngle) is the function to convert an axis-angle into a 3-by-3 rotation matrix.
axisAngle
- the axis-angle used to transform the matrix. Not modified.matrixOriginal
- the matrix to transform. Not modified.matrixTransformed
- the matrix in which the result is stored. Modified.public static void transform(AxisAngleReadOnly axisAngle, QuaternionReadOnly quaternionOriginal, QuaternionBasics quaternionTransformed)
quaternionOriginal
using axisAngle
and stores the
result in quaternionTransformed
.
Both quaternionOriginal
and quaternionTransformed
can be the same object for
performing in place transformation.
Note that this transformation is equivalent to concatenating the orientations of
axisAngle
and quaternionOriginal
.
axisAngle
- the axis-angle used to transform the quaternion. Not modified.quaternionOriginal
- the quaternion to transform. Not modified.quaternionTransformed
- the quaternion in which the result is stored. Modified.public static void inverseTransform(AxisAngleReadOnly axisAngle, QuaternionReadOnly quaternionOriginal, QuaternionBasics quaternionTransformed)
quaternionOriginal
using
axisAngle
and stores the result in quaternionTransformed
.
This is equivalent to calling
transform(AxisAngleReadOnly, QuaternionReadOnly, QuaternionBasics)
with an axis-angle
that has an angle of opposite value compared to the given one.
Both quaternionOriginal
and quaternionTransformed
can be the same object for
performing in place transformation.
axisAngle
- the axis-angle used to transform the quaternion. Not modified.quaternionOriginal
- the quaternion to transform. Not modified.quaternionTransformed
- the quaternion in which the result is stored. Modified.public static void transform(AxisAngleReadOnly axisAngle, Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
vectorOriginal
using axisAngle
and stores the result in
vectorTransformed
.
Both vectors can be the same object for performing in place transformation.
axisAngle
- the axis-angle used to transform the tuple. Not modified.vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.public static void inverseTransform(AxisAngleReadOnly axisAngle, Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
vectorOriginal
using
axisAngle
and stores the result in vectorTransformed
.
This is equivalent to calling
transform(AxisAngleReadOnly, Vector4DReadOnly, Vector4DBasics)
with an axis-angle that
has an angle of opposite value compared to the given one.
Both vectors can be the same object for performing in place transformation.
axisAngle
- the axis-angle used to transform the tuple. Not modified.vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.public static void transform(AxisAngleReadOnly axisAngle, RotationMatrixReadOnly rotationMatrixOriginal, RotationMatrix rotationMatrixTransformed)
rotationMatrixOriginal
using axisAngle
and stores
the result in rotationMatrixTransformed
.
Both rotation matrices can be the same object for performing in place transformation.
rotationMatrixTransformed = R(axisAngle) * rotationMatrixOriginal
where R(axisAngle) is the function to convert an axis-angle into a 3-by-3 rotation matrix.
Note that this transformation is equivalent to concatenating the orientations of
axisAngle
and rotationMatrixOriginal
.
axisAngle
- the axis-angle used to transform the rotation matrix. Not modified.rotationMatrixOriginal
- the rotation matrix to transform. Not modified.rotationMatrixTransformed
- the rotation matrix in which the result is stored. Modified.public static void inverseTransform(AxisAngleReadOnly axisAngle, RotationMatrixReadOnly rotationMatrixOriginal, RotationMatrix rotationMatrixTransformed)
rotationMatrixOriginal
using
axisAngle
and stores the result in rotationMatrixTransformed
.
This is equivalent to calling
transform(AxisAngleReadOnly, RotationMatrixReadOnly, RotationMatrix)
with an axis-angle
that has an angle of opposite value compared to the given one.
Both rotation matrices can be the same object for performing in place transformation.
rotationMatrixTransformed = R(axisAngle)-1 * rotationMatrixOriginal
where R(axisAngle) is the function to convert an axis-angle into a 3-by-3 rotation matrix.
Note that this transformation is equivalent to concatenating the orientations of
axisAngle
and rotationMatrixOriginal
.
axisAngle
- the axis-angle used to transform the rotation matrix. Not modified.rotationMatrixOriginal
- the rotation matrix to transform. Not modified.rotationMatrixTransformed
- the rotation matrix in which the result is stored. Modified.public static void multiply(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2, AxisAngleBasics axisAngleToPack)
aa1
and aa2
and stores the result in
axisAngleToPack
.
All three arguments can be the same object for in place operations.
aa1
- the first axis-angle in the multiplication. Not modified.aa2
- the second axis-angle in the multiplication. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void multiply(Orientation3DReadOnly orientation1, boolean inverse1, Orientation3DReadOnly orientation2, boolean inverse2, AxisAngleBasics axisAngleToPack)
orientation1
and orientation2
and stores the
result in axisAngleToPack
.
More precisely, orientation1
and orientation2
are first converted to axis-angles,
then an axis-angle multiplication is performed using the two first arguments as entry.
All three arguments can be the same object for in place operations.
orientation1
- the first orientation in the multiplication. Not modified.inverse1
- whether the first orientation should be inverted in the multiplication.orientation2
- the second orientation in the multiplication. Not modified.inverse2
- whether the second orientation should be inverted in the multiplication.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void multiply(Orientation3DReadOnly orientation1, boolean inverse1, AxisAngleReadOnly orientation2, boolean inverse2, AxisAngleBasics axisAngleToPack)
orientation1
and orientation2
and stores the
result in axisAngleToPack
.
More precisely, orientation1
is first converted to an axis-angle, then an axis-angle
multiplication is performed using the two first arguments as entry.
All three arguments can be the same object for in place operations.
orientation1
- the first orientation in the multiplication. Not modified.inverse1
- whether the first orientation should be inverted in the multiplication.orientation2
- the second orientation in the multiplication. Not modified.inverse2
- whether the second orientation should be inverted in the multiplication.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void multiply(AxisAngleReadOnly orientation1, boolean inverse1, Orientation3DReadOnly orientation2, boolean inverse2, AxisAngleBasics axisAngleToPack)
orientation1
and orientation2
and stores the
result in axisAngleToPack
.
More precisely, orientation2
is first converted to an axis-angle, then an axis-angle
multiplication is performed using the two first arguments as entry.
All three arguments can be the same object for in place operations.
orientation1
- the first orientation in the multiplication. Not modified.inverse1
- whether the first orientation should be inverted in the multiplication.orientation2
- the second orientation in the multiplication. Not modified.inverse2
- whether the second orientation should be inverted in the multiplication.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void multiplyInvertLeft(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2, AxisAngleBasics axisAngleToPack)
aa1
and aa2
and stores the result
in axisAngleToPack
.
All three arguments can be the same object for in place operations.
aa1
- the first axis-angle in the multiplication. Not modified.aa2
- the second axis-angle in the multiplication. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void multiplyInvertRight(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2, AxisAngleBasics axisAngleToPack)
aa1
and the inverse of aa2
and stores the result
in axisAngleToPack
.
All three arguments can be the same object for in place operations.
aa1
- the first axis-angle in the multiplication. Not modified.aa2
- the second axis-angle in the multiplication. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void multiplyInvertBoth(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2, AxisAngleBasics axisAngleToPack)
aa1
and the inverse of aa2
and
stores the result in axisAngleToPack
.
All three arguments can be the same object for in place operations.
aa1
- the first axis-angle in the multiplication. Not modified.aa2
- the second axis-angle in the multiplication. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void prependYawRotation(double yaw, AxisAngleReadOnly axisAngleOriginal, AxisAngleBasics axisAngleToPack)
axisAngleOriginal
and stores the result in
axisAngleToPack
.
All the quaternions can be the same object.
/ ux = 0 \ axisAngleToPack = | uy = 0 | * axisAngleOriginal | uz = 1 | \ angle = yaw /
yaw
- the angle to rotate about the z-axis.axisAngleOriginal
- the axis-angle on which the yaw rotation is prepended. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void appendYawRotation(AxisAngleReadOnly axisAngleOriginal, double yaw, AxisAngleBasics axisAngleToPack)
axisAngleOriginal
and stores the result in
axisAngleToPack
.
All the axis-angles can be the same object.
/ ux = 0 \ axisAngleToPack = axisAngleOriginal * | uy = 0 | | uz = 1 | \ angle = yaw /
axisAngleOriginal
- the axis-angle on which the yaw rotation is appended. Not modified.yaw
- the angle to rotate about the z-axis.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void prependPitchRotation(double pitch, AxisAngleReadOnly axisAngleOriginal, AxisAngleBasics axisAngleToPack)
axisAngleOriginal
and stores the result in
axisAngleToPack
.
All the axis-angles can be the same object.
/ ux = 0 \ axisAngleToPack = | uy = 1 | * axisAngleOriginal | uz = 0 | \ angle = pitch /
pitch
- the angle to rotate about the y-axis.axisAngleOriginal
- the axis-angle on which the yaw rotation is prepended. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void appendPitchRotation(AxisAngleReadOnly axisAngleOriginal, double pitch, AxisAngleBasics axisAngleToPack)
axisAngleOriginal
and stores the result in
axisAngleToPack
.
All the axis-angles can be the same object.
/ ux = 0 \ axisAngleToPack = axisAngleOriginal * | uy = 1 | | uz = 0 | \ angle = pitch /
axisAngleOriginal
- the axis-angle on which the yaw rotation is appended. Not modified.pitch
- the angle to rotate about the y-axis.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void prependRollRotation(double roll, AxisAngleReadOnly axisAngleOriginal, AxisAngleBasics axisAngleToPack)
axisAngleOriginal
and stores the result in
axisAngleToPack
.
All the axis-angles can be the same object.
/ ux = 1 \ axisAngleToPack = | uy = 0 | * axisAngleOriginal | uz = 0 | \ angle = roll /
roll
- the angle to rotate about the x-axis.axisAngleOriginal
- the axis-angle on which the yaw rotation is prepended. Not modified.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static void appendRollRotation(AxisAngleReadOnly axisAngleOriginal, double roll, AxisAngleBasics axisAngleToPack)
axisAngleOriginal
and stores the result in
axisAngleToPack
.
All the axis-angles can be the same object.
/ ux = 1 \ axisAngleToPack = axisAngleOriginal * | uy = 0 | | uz = 0 | \ angle = roll /
axisAngleOriginal
- the axis-angle on which the yaw rotation is appended. Not modified.roll
- the angle to rotate about the x-axis.axisAngleToPack
- the axis-angle in which the result is stored. Modified.public static double distance(AxisAngleReadOnly aa1, AxisAngleReadOnly aa2)
aa1
and aa2
.aa1
- the first axis-angle to measure the distance. Not modified.aa2
- the second axis-angle to measure the distance. Not modified.