Clearable
, EpsilonComparable<QuaternionBasedTransform>
, GeometricallyComparable<QuaternionBasedTransform>
, Settable<QuaternionBasedTransform>
, Transform
public class QuaternionBasedTransform extends java.lang.Object implements Transform, EpsilonComparable<QuaternionBasedTransform>, GeometricallyComparable<QuaternionBasedTransform>, Settable<QuaternionBasedTransform>, Clearable
QuaternionBasedTransform
represents a 4-by-4 transformation matrix that can rotate and
translate.
The QuaternionBasedTransform
provides the same features as RigidBodyTransform
.
However, it stores the rotation part of the transform as a quaternion.
For efficiency and readability, the transform is never stored in a 4-by-4 matrix.
A few special cases to keep in mind:
Point3DBasics
or Point2DBasics
, this object
is rotated, then translated.
Vector3DBasics
or Vector2DBasics
, this
object is only rotated. It is NOT translated.
Constructor | Description |
---|---|
QuaternionBasedTransform() |
Creates a new quaternion-based transform set to identity.
|
QuaternionBasedTransform(double[] array) |
Creates a new quaternion-based transform given the value of its 7 components (4 components for
quaternion and 3 for the translation).
|
QuaternionBasedTransform(org.ejml.data.DenseMatrix64F matrix) |
Creates a new quaternion-based transform given the value of its 7 components (4 components for
quaternion and 3 for the translation).
|
QuaternionBasedTransform(AxisAngleReadOnly axisAngle,
Tuple3DReadOnly translation) |
Creates a new quaternion-based transform and initializes it to the given axis-angle and
translation.
|
QuaternionBasedTransform(RotationMatrixReadOnly rotationMatrix,
Tuple3DReadOnly translation) |
Creates a new quaternion-based transform and initializes it to the given rotation matrix and
translation.
|
QuaternionBasedTransform(QuaternionBasedTransform other) |
Creates a quaternion-based new transform and initializes it to
other . |
QuaternionBasedTransform(RigidBodyTransform rigidBodyTransform) |
Creates a new quaternion-based transform and initializes to the given rigid-body transform.
|
QuaternionBasedTransform(QuaternionReadOnly quaternion,
Tuple3DReadOnly translation) |
Creates a new quaternion-based transform and initializes it to the given quaternion and
translation.
|
Modifier and Type | Method | Description |
---|---|---|
void |
appendPitchRotation(double pitch) |
Append a rotation about the y-axis to the rotation part 'q' of this transform.
|
void |
appendRollRotation(double roll) |
Append a rotation about the x-axis to the rotation part 'q' of this transform.
|
void |
appendTranslation(double x,
double y,
double z) |
Append a translation transform to this transform.
|
void |
appendTranslation(Tuple3DReadOnly translation) |
Append a translation transform to this transform.
|
void |
appendYawRotation(double yaw) |
Append a rotation about the z-axis to the rotation part 'q' of this transform.
|
boolean |
containsNaN() |
Tests if at least one element of this transform is equal to Double.NaN.
|
boolean |
epsilonEquals(QuaternionBasedTransform other,
double epsilon) |
Tests separately and on a per component basis if the rotation part and the translation part of
this transform and
other are equal to an epsilon . |
boolean |
equals(java.lang.Object object) |
Tests if the given
object 's class is the same as this, in which case the method returns
equals(QuaternionBasedTransform) , it returns false otherwise or if the
object is null . |
boolean |
equals(QuaternionBasedTransform other) |
Tests separately and on a per component basis if the rotation part and the translation part of
this transform and
other are exactly equal. |
boolean |
geometricallyEquals(QuaternionBasedTransform other,
double epsilon) |
Two quaternion based transforms are considered geometrically equal if both the rotation-scale
matrices and translation vectors are equal.
|
void |
get(double[] transformArrayToPack) |
Packs this quaternion-based transform in an array.
|
void |
get(int startRow,
int column,
org.ejml.data.DenseMatrix64F matrixToPack) |
Packs this quaternion-based transform in a column vector.
|
void |
get(org.ejml.data.DenseMatrix64F matrixToPack) |
Packs this quaternion-based transform in a column vector.
|
void |
get(RotationMatrix rotationMarixToPack,
Tuple3DBasics translationToPack) |
Packs the quaternion and translation of this quaternion-based transform.
|
void |
get(RotationScaleMatrix rotationMarixToPack,
Tuple3DBasics translationToPack) |
Packs the quaternion and translation of this quaternion-based transform.
|
void |
get(QuaternionBasics quaternionToPack,
Tuple3DBasics translationToPack) |
Packs the quaternion and translation of this quaternion-based transform.
|
QuaternionReadOnly |
getQuaternion() |
Get the read-only reference to the quaternion of this transform.
|
void |
getRotation(AxisAngleBasics axisAngleToPack) |
Packs the rotation part of this affine transform as an axis-angle.
|
void |
getRotation(RotationMatrix rotationMatrixToPack) |
Packs the rotation part of this affine transform.
|
void |
getRotation(Vector3DBasics rotationVectorToPack) |
Packs the rotation part of this affine transform as a rotation vector.
|
void |
getRotation(QuaternionBasics quaternionToPack) |
Packs the rotation part of this affine transform as a quaternion.
|
void |
getRotationEuler(Vector3DBasics eulerAnglesToPack) |
Computes and packs the orientation described by the rotation part of this transform as the Euler
angles.
|
void |
getRotationYawPitchRoll(double[] yawPitchRollToPack) |
Computes and packs the orientation described by the rotation part of this transform as the
yaw-pitch-roll angles.
|
void |
getTranslation(Tuple3DBasics translationToPack) |
Packs the translation part of this affine transform.
|
Vector3DReadOnly |
getTranslationVector() |
Gets the read-only reference of the translation part of this affine transform.
|
double |
getTranslationX() |
Gets the x-component of the translation part of this transform.
|
double |
getTranslationY() |
Gets the y-component of the translation part of this transform.
|
double |
getTranslationZ() |
Gets the z-component of the translation part of this transform.
|
int |
hashCode() |
|
void |
interpolate(QuaternionBasedTransform other,
double alpha) |
Performs a linear interpolation from this transform to
other given the percentage
alpha . |
void |
interpolate(QuaternionBasedTransform firstTransform,
QuaternionBasedTransform secondTransform,
double alpha) |
Performs a linear interpolation from
firstTransform to secondTransform given the
percentage alpha . |
void |
inverseTransform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Performs the inverse of the transform on the given matrix
matrixOriginal and stores
the result in matrixTransformed . |
void |
inverseTransform(RotationMatrixReadOnly matrixOriginal,
RotationMatrix matrixTransformed) |
Performs the inverse of the transform on the given matrix
matrixOriginal and stores
the result in matrixTransformed . |
void |
inverseTransform(AffineTransform original,
AffineTransform transformed) |
Performs the inverse of the transform on the given
original and stores the result in
transformed . |
void |
inverseTransform(QuaternionBasedTransform original,
QuaternionBasedTransform transformed) |
Performs the inverse of the transform on the given
original stores the result in
transformed . |
void |
inverseTransform(RigidBodyTransform original,
RigidBodyTransform transformed) |
Performs the inverse of the transform on the given
original and stores the result in
transformed . |
void |
inverseTransform(Point2DReadOnly pointOriginal,
Point2DBasics pointTransformed,
boolean checkIfTransformInXYPlane) |
Performs the inverse of the transform on the given point
pointOriginal and stores the
result in pointTransformed . |
void |
inverseTransform(Vector2DReadOnly vectorOriginal,
Vector2DBasics vectorTransformed,
boolean checkIfTransformInXYPlane) |
Performs the inverse of the transform on the given vector
vectorOriginal and stores
the result in vectorTransformed . |
void |
inverseTransform(Point3DReadOnly pointOriginal,
Point3DBasics pointTransformed) |
Performs the inverse of the transform on the given point
pointOriginal and stores the
result in pointTransformed . |
void |
inverseTransform(Vector3DReadOnly vectorOriginal,
Vector3DBasics vectorTransformed) |
Performs the inverse of the transform on the given vector
vectorOriginal and stores
the result in vectorTransformed . |
void |
inverseTransform(QuaternionReadOnly quaternionOriginal,
QuaternionBasics quaternionTransformed) |
Performs the inverse of the transform on the given quaternion
quaternionOriginal and
stores the result in quaternionTransformed . |
void |
inverseTransform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Performs the inverse of the transform on the given vector
vectorOriginal and stores
the result in vectorTransformed . |
void |
invert() |
Inverts this quaternion-based transform.
|
void |
invertRotation() |
Inverts only the rotation part of this transform, the translation remains unchanged.
|
void |
multiply(AffineTransform affineTransform) |
Performs the multiplication of this transform with
affineTransform . |
void |
multiply(QuaternionBasedTransform other) |
Performs the multiplication of this transform with
other . |
void |
multiply(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of this transform with
rigidBodyTransform . |
void |
multiplyInvertOther(AffineTransform affineTransform) |
Performs the multiplication of this transform with the inverse of
affineTransform . |
void |
multiplyInvertOther(QuaternionBasedTransform other) |
Performs the multiplication of this transform with the inverse of
other . |
void |
multiplyInvertOther(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of this transform with the inverse of
rigidBodyTransform . |
void |
multiplyInvertThis(AffineTransform affineTransform) |
Performs the multiplication of the inverse of this transform with
affineTransform . |
void |
multiplyInvertThis(QuaternionBasedTransform other) |
Performs the multiplication of the inverse of this transform with
other . |
void |
multiplyInvertThis(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of the inverse of this transform with
rigidBodyTransform . |
void |
preMultiply(AffineTransform affineTransform) |
Performs the multiplication of
affineTransform with this transform. |
void |
preMultiply(QuaternionBasedTransform other) |
Performs the multiplication of
other with this transform. |
void |
preMultiply(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of
rigidBodyTransform with this transform. |
void |
preMultiplyInvertOther(AffineTransform affineTransform) |
Performs the multiplication of the inverse of
affineTransform with this transform. |
void |
preMultiplyInvertOther(QuaternionBasedTransform other) |
Performs the multiplication of the inverse of
other with this transform. |
void |
preMultiplyInvertOther(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of the inverse of
rigidBodyTransform with this transform. |
void |
preMultiplyInvertThis(AffineTransform affineTransform) |
Performs the multiplication of
affineTransform with the inverse of this transform. |
void |
preMultiplyInvertThis(QuaternionBasedTransform other) |
Performs the multiplication of
other with the inverse of this transform. |
void |
preMultiplyInvertThis(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of
rigidBodyTransform with the inverse of this transform. |
void |
prependPitchRotation(double pitch) |
Prepend a rotation about the y-axis to this transform.
|
void |
prependRollRotation(double roll) |
Prepend a rotation about the x-axis to the rotation part 'q' of this transform.
|
void |
prependTranslation(double x,
double y,
double z) |
Prepend a translation transform to this transform.
|
void |
prependTranslation(Tuple3DReadOnly translation) |
Prepend a translation transform to this transform.
|
void |
prependYawRotation(double yaw) |
Prepend a rotation about the z-axis to this transform.
|
void |
set(double[] array) |
Sets the value of this transform's 7 components.
|
void |
set(double qx,
double qy,
double qz,
double qs,
double x,
double y,
double z) |
Sets the 7 components of this transform.
|
void |
set(org.ejml.data.DenseMatrix64F matrix) |
Sets the value of this transform's 7 components.
|
void |
set(AxisAngleReadOnly axisAngle,
Tuple3DReadOnly translation) |
Sets this quaternion-based transform to the given axis-angle and translation.
|
void |
set(RotationMatrixReadOnly rotationMatrix,
Tuple3DReadOnly translation) |
Sets this quaternion-based transform to the given rotation matrix and translation.
|
void |
set(QuaternionBasedTransform other) |
Sets this quaternion-based transform to the given
other . |
void |
set(RigidBodyTransform rigidBodyTransform) |
Sets this quaternion-based transform to the given rigid-body transform.
|
void |
set(QuaternionReadOnly quaternion,
Tuple3DReadOnly translation) |
Sets this quaternion-based transform to the given quaternion and translation.
|
void |
setIdentity() |
Resets this quaternion-based transform to represent a zero rotation and zero translation.
|
void |
setRotation(AxisAngleReadOnly axisAngle) |
Sets the rotation part of this transform to the given axis-angle.
|
void |
setRotation(RotationMatrixReadOnly rotationMatrix) |
Sets the rotation part of this transform to the given rotation matrix.
|
void |
setRotation(Vector3DReadOnly rotationVector) |
Sets the rotation part of this transform to the given rotation vector.
|
void |
setRotation(QuaternionReadOnly quaternion) |
Sets the rotation part of this transform to the given quaternion.
|
void |
setRotationEuler(double rotX,
double rotY,
double rotZ) |
Sets the rotation part of this transform to represent the same orientation as the given Euler
angles
rotX , rotY , and rotZ . |
void |
setRotationEuler(Vector3DReadOnly eulerAngles) |
Sets the rotation part of this transform to represent the same orientation as the given Euler
angles
eulerAngles . |
void |
setRotationPitch(double pitch) |
Sets the rotation part of this transform to represent a counter clockwise rotation around the
y-axis of an angle
pitch . |
void |
setRotationRoll(double roll) |
Sets the rotation part of this transform to represent a counter clockwise rotation around the
x-axis of an angle
roll . |
void |
setRotationToNaN() |
Sets all the components of the quaternion to
Double.NaN . |
void |
setRotationToZero() |
Sets the rotation part to represent a 'zero' rotation.
|
void |
setRotationYaw(double yaw) |
Sets the rotation part of this transform to represent a counter clockwise rotation around the
z-axis of an angle
yaw . |
void |
setRotationYawPitchRoll(double[] yawPitchRoll) |
Sets the rotation part of this transform to represent the same orientation as the given
yaw-pitch-roll angles
yaw , pitch , and roll . |
void |
setRotationYawPitchRoll(double yaw,
double pitch,
double roll) |
Sets the rotation part of this transform to represent the same orientation as the given
yaw-pitch-roll angles
yaw , pitch , and roll . |
void |
setToNaN() |
Sets all the components of this affine transform making it invalid.
|
void |
setToZero() |
Resets this quaternion-based transform to represent a zero rotation and zero translation.
|
void |
setTranslation(double x,
double y,
double z) |
Sets the translation part of this transform.
|
void |
setTranslation(Tuple3DReadOnly translation) |
Sets the translation part of this transform.
|
void |
setTranslationToNaN() |
Sets all the components of the translation vector to
Double.NaN . |
void |
setTranslationToZero() |
Sets the translation part to zero.
|
void |
setTranslationX(double x) |
Sets the x-component of the translation part of this transform.
|
void |
setTranslationY(double y) |
Sets the y-component of the translation part of this transform.
|
void |
setTranslationZ(double z) |
Sets the z-component of the translation part of this transform.
|
void |
setUnsafe(double qx,
double qy,
double qz,
double qs,
double x,
double y,
double z) |
Sets the 7 components of this transform.
|
java.lang.String |
toString() |
Provides a
String representation of this transform as follows: Quaternion: (qx, qy, qz, qs) Translation: ( x, y, z) |
void |
transform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Transforms the given
matrixOriginal by this transform and stores the result in
matrixTransformed . |
void |
transform(RotationMatrixReadOnly matrixOriginal,
RotationMatrix matrixTransformed) |
Transforms the given
matrixOriginal by this transform and stores the result in
matrixTransformed . |
void |
transform(AffineTransform original,
AffineTransform transformed) |
Transforms the given
original by this transform and stores the result in
transformed . |
void |
transform(QuaternionBasedTransform original,
QuaternionBasedTransform transformed) |
Transforms the given
original by this transform and stores the result in
transformed . |
void |
transform(RigidBodyTransform original,
RigidBodyTransform transformed) |
Transforms the given
original by this transform and stores the result in
transformed . |
void |
transform(Point2DReadOnly pointOriginal,
Point2DBasics pointTransformed,
boolean checkIfTransformInXYPlane) |
Transforms the given
point2DOriginal by this transform and stores the result in
point2DTransformed . |
void |
transform(Vector2DReadOnly vectorOriginal,
Vector2DBasics vectorTransformed,
boolean checkIfTransformInXYPlane) |
Transforms the given
vector2DOriginal by this transform and stores the result in
vector2DTransformed . |
void |
transform(Point3DReadOnly pointOriginal,
Point3DBasics pointTransformed) |
Transforms the given
pointOriginal by this transform and stores the result in
pointTransformed . |
void |
transform(Vector3DReadOnly vectorOriginal,
Vector3DBasics vectorTransformed) |
Transforms the given
vectorOriginal by this transform and stores the result in
vectorTransformed . |
void |
transform(QuaternionReadOnly quaternionOriginal,
QuaternionBasics quaternionTransformed) |
Transforms the given
quaternionOriginal by this transform and stores the result in
quaternionTransformed . |
void |
transform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Transforms the vector part (x, y, z) of the given
vector4DOriginal as a 3D vector and
translates it by s times the translation part of the transform. |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform, transform
public QuaternionBasedTransform()
When set to identity, this transform has no effect when transforming a geometry object.
public QuaternionBasedTransform(QuaternionBasedTransform other)
other
.other
- the other quaternion-based transform to copy. Not modified.public QuaternionBasedTransform(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
- the rigid-body transform to copy. Not modified.public QuaternionBasedTransform(org.ejml.data.DenseMatrix64F matrix)
The quaternion q is set as follows:
/ qx = matrix.get(0, 0) \ q = | qy = matrix.get(1, 0) | | qz = matrix.get(2, 0) | \ qs = matrix.get(3, 0) /The translation part T is set as follows:
/ matrix.get(4, 0) \ T = | matrix.get(5, 0) | \ matrix.get(6, 0) /
matrix
- the column vector containing the values of the 7 components of this transform. Not
modified.public QuaternionBasedTransform(double[] array)
The quaternion q is set as follows:
/ qx = array[0] \ q = | qy = array[1] | | qz = array[2] | \ qs = array[3] /The translation part T is set as follows:
/ array[4] \ T = | array[5] | \ array[6] /
array
- the array containing the values of the 7 components of this transform. Not modified.public QuaternionBasedTransform(RotationMatrixReadOnly rotationMatrix, Tuple3DReadOnly translation)
rotationMatrix
- the rotation matrix used to initialize the quaternion of this transform.
Not modified.translation
- the tuple used to initialize the translation part of this transform. Not
modified.public QuaternionBasedTransform(QuaternionReadOnly quaternion, Tuple3DReadOnly translation)
quaternion
- the quaternion used to initialize the quaternion of this transform. Not
modified.translation
- the tuple used to initialize the translation part of this transform. Not
modified.public QuaternionBasedTransform(AxisAngleReadOnly axisAngle, Tuple3DReadOnly translation)
axisAngle
- the axis-angle used to initialize the quaternion of this transform. Not
modified.translation
- the tuple used to initialize the translation part of this transform. Not
modified.public void setIdentity()
When set to zero, this transform has no effect when transforming a geometry object.
public void setToZero()
When set to zero, this transform has no effect when transforming a geometry object.
public void setRotationToZero()
public void setTranslationToZero()
public void setToNaN()
public void setRotationToNaN()
Double.NaN
.
public void setTranslationToNaN()
Double.NaN
.
public boolean containsNaN()
containsNaN
in interface Clearable
true
if at least one element of this transform is equal to
Double.NaN, false
otherwise.public void set(double qx, double qy, double qz, double qs, double x, double y, double z)
The quaternion part will be normalized.
qx
- the x-component of the quaternion's vector part.qy
- the y-component of the quaternion's vector part.qz
- the z-component of the quaternion's vector part.qs
- the scalar component of the quaternion.x
- the x-component of the translation.y
- the y-component of the translation.z
- the z-component of the translation.public void setUnsafe(double qx, double qy, double qz, double qs, double x, double y, double z)
Prefer using the method set(double, double, double, double, double, double, double)
as
it normalizes the quaternion part.
qx
- the x-component of the quaternion's vector part.qy
- the y-component of the quaternion's vector part.qz
- the z-component of the quaternion's vector part.qs
- the scalar component of the quaternion.x
- the x-component of the translation.y
- the y-component of the translation.z
- the z-component of the translation.public void set(QuaternionBasedTransform other)
other
.set
in interface Settable<QuaternionBasedTransform>
other
- the other quaternion-based transform. Not modified.public void set(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
- the rigid-body transform to copy the values from. Not modified.public void set(org.ejml.data.DenseMatrix64F matrix)
The quaternion q is set as follows:
/ qx = matrix.get(0, 0) \ q = | qy = matrix.get(1, 0) | | qz = matrix.get(2, 0) | \ qs = matrix.get(3, 0) /The translation part T is set as follows:
/ matrix.get(4, 0) \ T = | matrix.get(5, 0) | \ matrix.get(6, 0) /
matrix
- the column vector containing the values of the 7 components of this transform. Not
modified.public void set(double[] array)
The quaternion q is set as follows:
/ qx = array[0] \ q = | qy = array[1] | | qz = array[2] | \ qs = array[3] /The translation part T is set as follows:
/ array[4] \ T = | array[5] | \ array[6] /
array
- the array containing the values of the 7 components of this transform. Not modified.public void set(RotationMatrixReadOnly rotationMatrix, Tuple3DReadOnly translation)
rotationMatrix
- the rotation matrix used to set the quaternion of this transform. Not
modified.translation
- the tuple used to set the translation part of this transform. Not modified.public void set(QuaternionReadOnly quaternion, Tuple3DReadOnly translation)
quaternion
- the quaternion used to set the quaternion of this transform. Not modified.translation
- the tuple used to set the translation part of this transform. Not modified.public void set(AxisAngleReadOnly axisAngle, Tuple3DReadOnly translation)
axisAngle
- the axis-angle used to set the quaternion of this transform. Not modified.translation
- the tuple used to set the translation part of this transform. Not modified.public void setRotation(AxisAngleReadOnly axisAngle)
This method does not affect the translation part of this transform.
axisAngle
- the axis-angle used to set the quaternion of this transform. Not modified.public void setRotation(QuaternionReadOnly quaternion)
This method does not affect the translation part of this transform.
quaternion
- the quaternion used to set the quaternion of this transform. Not modified.public void setRotation(RotationMatrixReadOnly rotationMatrix)
This method does not affect the translation part of this transform.
rotationMatrix
- the rotation matrix used to set the quaternion of this transform. Not
modified.public void setRotation(Vector3DReadOnly rotationVector)
This method does not affect the translation part of this transform.
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 used to set the quaternion of this transform. Not
modified.public void setRotationYaw(double yaw)
yaw
.
/ qx = 0 \ q = | qy = 0 | | qz = sin(yaw/2) | \ qs = cos(yaw/2) /
This method does not affect the translation part of this transform.
yaw
- the angle to rotate about the z-axis.public void setRotationPitch(double pitch)
pitch
.
/ qx = 0 \ q = | qy = sin(pitch/2) | | qz = 0 | \ qs = cos(pitch/2) /
This method does not affect the translation part of this transform.
pitch
- the angle to rotate about the y-axis.public void setRotationRoll(double roll)
roll
.
/ qx = sin(roll/2) \ q = | qy = 0 | | qz = 0 | \ qs = cos(roll/2) /
This method does not affect the translation part of this transform.
roll
- the angle to rotate about the x-axis.public void setRotationYawPitchRoll(double[] yawPitchRoll)
yaw
, pitch
, and roll
.
/ qx = 0 \ / qx = 0 \ / qx = sin(roll/2) \ q = | qy = 0 | * | qy = sin(pitch/2) | * | qy = 0 | | qz = sin(yaw/2) | | qz = 0 | | qz = 0 | \ qs = cos(yaw/2) / \ qs = cos(pitch/2) / \ qs = cos(roll/2) /
This method does not affect the translation part of this transform.
yawPitchRoll
- array containing the yaw-pitch-roll angles. Not modified.public void setRotationYawPitchRoll(double yaw, double pitch, double roll)
yaw
, pitch
, and roll
.
/ qx = 0 \ / qx = 0 \ / qx = sin(roll/2) \ q = | qy = 0 | * | qy = sin(pitch/2) | * | qy = 0 | | qz = sin(yaw/2) | | qz = 0 | | qz = 0 | \ qs = cos(yaw/2) / \ qs = cos(pitch/2) / \ qs = cos(roll/2) /
This method does not affect the translation part of this transform.
yaw
- the angle to rotate about the z-axis.pitch
- the angle to rotate about the y-axis.roll
- the angle to rotate about the x-axis.public void setRotationEuler(Vector3DReadOnly eulerAngles)
eulerAngles
.
/ qx = 0 \ / qx = 0 \ / qx = sin(eulerAngles.x/2) \ q = | qy = 0 | * | qy = sin(eulerAngles.y/2) | * | qy = 0 | | qz = sin(eulerAngles.z/2) | | qz = 0 | | qz = 0 | \ qs = cos(eulerAngles.z/2) / \ qs = cos(eulerAngles.y/2) / \ qs = cos(eulerAngles.x/2) /
This method does not affect the translation part of this transform.
This is equivalent to
this.setRotationYawPitchRoll(eulerAngles.getZ(), eulerAngles.getY(), eulerAngles.getX())
.
eulerAngles
- the Euler angles to copy the orientation from. Not modified.public void setRotationEuler(double rotX, double rotY, double rotZ)
rotX
, rotY
, and rotZ
.
/ qx = 0 \ / qx = 0 \ / qx = sin(rotX/2) \ q = | qy = 0 | * | qy = sin(rotY/2) | * | qy = 0 | | qz = sin(rotZ/2) | | qz = 0 | | qz = 0 | \ qs = cos(rotZ/2) / \ qs = cos(rotY/2) / \ qs = cos(rotX/2) /
This method does not affect the translation part of this transform.
This is equivalent to this.setRotationYawPitchRoll(rotZ, rotY, rotX)
.
rotX
- the angle to rotate about the x-axis.rotY
- the angle to rotate about the y-axis.rotZ
- the angle to rotate about the z-axis.public void setTranslationX(double x)
This method does not affect the rotation part of this transform.
x
- the x-component of the translation part.public void setTranslationY(double y)
This method does not affect the rotation part of this transform.
y
- the y-component of the translation part.public void setTranslationZ(double z)
This method does not affect the rotation part of this transform.
z
- the z-component of the translation part.public void setTranslation(double x, double y, double z)
This method does not affect the rotation part of this transform.
x
- the x-component of the translation part.y
- the y-component of the translation part.z
- the z-component of the translation part.public void setTranslation(Tuple3DReadOnly translation)
This method does not affect the rotation part of this transform.
translation
- tuple used to set the translation part of this transform. Not modified.public void invert()
public void invertRotation()
public void interpolate(QuaternionBasedTransform other, double alpha)
other
given the percentage
alpha
.
The interpolation is done on the rotation part and translation part separately.
this = (1.0 - alpha) * this + alpha * other
other
- the other transform used for the interpolation. Not modified.alpha
- the percentage used for the interpolation. A value of 0 will result in not modifying
this transform, while a value of 1 is equivalent to setting this transform to
other
.public void interpolate(QuaternionBasedTransform firstTransform, QuaternionBasedTransform secondTransform, double alpha)
firstTransform
to secondTransform
given the
percentage alpha
.
The interpolation is done on the rotation part and translation part separately.
this = (1.0 - alpha) * firstTransform + alpha * secondTransform
firstTransform
- the first transform used in the interpolation. Not modified.secondTransform
- the second transform used in the interpolation. Not modified.alpha
- the percentage to use for the interpolation. A value of 0 will result in setting
this transform to tuple1
, while a value of 1 is equivalent to setting this
transform to tuple2
.public void multiply(QuaternionBasedTransform other)
other
.
this = this * other
other
- the other transform to multiply this with. Not modified.public void multiply(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
.
this = this * Q(rigidBodyTransform)
where Q(rigidBodyTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void multiply(AffineTransform affineTransform)
affineTransform
.
Note: the scale part of the given affine transform is not used when performing the multiplication to conserve a proper quaternion-based transform describing only a rotation and a translation.
this = this * Q(affineTransform)
where Q(affineTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
affineTransform
- the affine transform to multiply this with. Not modified.public void multiplyInvertThis(QuaternionBasedTransform other)
other
.
this = this-1 * other
other
- the other transform to multiply this with. Not modified.public void multiplyInvertOther(QuaternionBasedTransform other)
other
.
this = this * other-1
other
- the other transform to multiply this with. Not modified.public void multiplyInvertThis(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
.
this = this-1 * Q(rigidBodyTransform)
where Q(rigidBodyTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void multiplyInvertOther(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
.
this = this * Q(rigidBodyTransform)-1
where Q(rigidBodyTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void multiplyInvertThis(AffineTransform affineTransform)
affineTransform
.
Note: the scale part of the given affine transform is not used when performing the multiplication to conserve a proper quaternion-based transform describing only a rotation and a translation.
this = this-1 * Q(affineTransform)
where Q(affineTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
affineTransform
- the affine transform to multiply this with. Not modified.public void multiplyInvertOther(AffineTransform affineTransform)
affineTransform
.
Note: the scale part of the given affine transform is not used when performing the multiplication to conserve a proper quaternion-based transform describing only a rotation and a translation.
this = this * Q(affineTransform)-1
where Q(affineTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
affineTransform
- the affine transform to multiply this with. Not modified.public void appendTranslation(Tuple3DReadOnly translation)
/ 1 0 0 translation.x \ this = this * | 0 1 0 translation.y | | 0 0 1 translation.z | \ 0 0 0 1 /
This method does not affect the rotation part of this transform.
translation
- the translation to append to this transform. Not modified.public void appendTranslation(double x, double y, double z)
/ 1 0 0 x \ this = this * | 0 1 0 y | | 0 0 1 z | \ 0 0 0 1 /
This method does not affect the rotation part of this transform.
x
- the translation along the x-axis to apply.y
- the translation along the y-axis to apply.z
- the translation along the z-axis to apply.public void appendYawRotation(double yaw)
/ qx = 0 \ q = q * | qy = 0 | | qz = sin(yaw/2) | \ qs = cos(yaw/2) /
yaw
- the angle to rotate about the z-axis.public void appendPitchRotation(double pitch)
/ qx = 0 \ q = q * | qy = sin(pitch/2) | | qz = 0 | \ qs = cos(pitch/2) /
pitch
- the angle to rotate about the y-axis.public void appendRollRotation(double roll)
/ qx = sin(roll/2) \ q = q * | qy = 0 | | qz = 0 | \ qs = cos(roll/2) /
roll
- the angle to rotate about the x-axis.public void preMultiply(QuaternionBasedTransform other)
other
with this transform.
this = other * this
other
- the other transform to multiply this with. Not modified.public void preMultiply(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
with this transform.
this = Q(rigidBodyTransform) * this
where Q(rigidBodyTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void preMultiply(AffineTransform affineTransform)
affineTransform
with this transform.
Note: the scale part of the given affine transform is not used when performing the multiplication to conserve a proper quaternion-based transform describing only a rotation and a translation.
this = Q(affineTransform) * this
where Q(affineTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
affineTransform
- the rigid-body transform to multiply this with. Not modified.public void preMultiplyInvertThis(QuaternionBasedTransform other)
other
with the inverse of this transform.
this = other * this-1
other
- the other transform to multiply this with. Not modified.public void preMultiplyInvertOther(QuaternionBasedTransform other)
other
with this transform.
this = other-1 * this
other
- the other transform to multiply this with. Not modified.public void preMultiplyInvertThis(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
with the inverse of this transform.
this = Q(rigidBodyTransform) * this-1
where Q(rigidBodyTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void preMultiplyInvertOther(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
with this transform.
this = Q(rigidBodyTransform)-1 * this
where Q(rigidBodyTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void preMultiplyInvertThis(AffineTransform affineTransform)
affineTransform
with the inverse of this transform.
Note: the scale part of the given affine transform is not used when performing the multiplication to conserve a proper quaternion-based transform describing only a rotation and a translation.
this = Q(affineTransform) * this-1
where Q(affineTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
affineTransform
- the affine transform to multiply this with. Not modified.public void preMultiplyInvertOther(AffineTransform affineTransform)
affineTransform
with this transform.
Note: the scale part of the given affine transform is not used when performing the multiplication to conserve a proper quaternion-based transform describing only a rotation and a translation.
this = Q(affineTransform)-1 * this
where Q(affineTransform) is the function that converts a 4-by-4 transformation matrix into a
quaternion-based transform.
affineTransform
- the affine transform to multiply this with. Not modified.public void prependTranslation(Tuple3DReadOnly translation)
/ 1 0 0 translation.x \ this = | 0 1 0 translation.y | * this | 0 0 1 translation.z | \ 0 0 0 1 /
This method does not affect the rotation part of this transform.
translation
- the translation to prepend to this transform. Not modified.public void prependTranslation(double x, double y, double z)
/ 1 0 0 x \ this = | 0 1 0 y | * this | 0 0 1 z | \ 0 0 0 1 /
This method does not affect the rotation part of this transform.
x
- the translation along the x-axis to apply.y
- the translation along the y-axis to apply.z
- the translation along the z-axis to apply.public void prependYawRotation(double yaw)
This method first rotates the translation part 't' and then prepend the yaw-rotation to the rotation part 'q' of this transform.
t = q(yaw) * t q = q(yaw) * qwhere:
/ qx = 0 \ q(yaw) = | qy = 0 | | qz = sin(yaw/2) | \ qs = cos(yaw/2) /
yaw
- the angle to rotate about the z-axis.public void prependPitchRotation(double pitch)
This method first rotates the translation part 't' and then prepend the pitch-rotation to the rotation part 'q' of this transform.
t = q(pitch) * t q = q(pitch) * qwhere:
/ qx = 0 \ q(pitch) = | qy = sin(pitch/2) | | qz = 0 | \ qs = cos(pitch/2) /
pitch
- the angle to rotate about the y-axis.public void prependRollRotation(double roll)
This method first rotates the translation part 't' and then prepend the roll-rotation to the rotation part 'q' of this transform.
t = q(roll) * t q = q(roll) * qwhere:
/ qx = sin(roll/2) \ q(roll) = | qy = 0 | | qz = 0 | \ qs = cos(roll/2) /
roll
- the angle to rotate about the x-axis.public void transform(Point3DReadOnly pointOriginal, Point3DBasics pointTransformed)
pointOriginal
by this transform and stores the result in
pointTransformed
.
Note: transforming a point differs from transforming a vector in the way that the point can be translated, whereas the vector can be only rotated and scaled.
The transformation depends on the implementation of the transform, here are a few examples:
RigidBodyTransform
rotates then translates a point.
QuaternionBasedTransform
rotates then translates a point.
AffineTransform
scales, rotates, then translates a point.
public void transform(Vector3DReadOnly vectorOriginal, Vector3DBasics vectorTransformed)
vectorOriginal
by this transform and stores the result in
vectorTransformed
.
Note: transforming a point differs from transforming a vector in the way that the point can be translated, whereas the vector only rotated and scaled.
The transformation depends on the implementation of the transform, here are a few examples:
RigidBodyTransform
rotates a vector.
QuaternionBasedTransform
rotates a vector.
AffineTransform
scales then rotates a vector.
public void transform(QuaternionReadOnly quaternionOriginal, QuaternionBasics quaternionTransformed)
quaternionOriginal
by this transform and stores the result in
quaternionTransformed
.
RigidBodyTransform
, QuaternionBasedTransform
, and AffineTransform
prepend their rotation part the given quaternion. No scale or translation is applied to the
quaternion such that the output of this method is still a unit-quaternion.
public void transform(Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
vector4DOriginal
as a 3D vector and
translates it by s
times the translation part of the transform. The scalar part (s)
remains unchanged.
Note that for s = 0
, a 4D vector behaves as a 3D vector, and for s = 1
it
behaves as a 3D point.
RigidBodyTransform
rotates then translates a vector.
QuaternionBasedTransform
rotates then translates a vector.
AffineTransform
scales, rotates, then translates a vector.
public void transform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
by this transform and stores the result in
matrixTransformed
.
WARNING: This is different from concatenating orientations.
The transformation depends on the implementation of the transform, here are a few examples:
RigidBodyTransform
rotates a matrix.
QuaternionBasedTransform
rotates a matrix.
AffineTransform
scales then rotates a matrix.
public void transform(RotationMatrixReadOnly matrixOriginal, RotationMatrix matrixTransformed)
matrixOriginal
by this transform and stores the result in
matrixTransformed
.
RigidBodyTransform
, QuaternionBasedTransform
, and AffineTransform
prepend their rotation part the given rotation matrix. No scale or translation is applied to
the rotation matrix such that the output of this method is still a proper rotation matrix.
public void transform(Point2DReadOnly pointOriginal, Point2DBasics pointTransformed, boolean checkIfTransformInXYPlane)
point2DOriginal
by this transform and stores the result in
point2DTransformed
.
Note: transforming a point differs from transforming a vector in the way that the point can be translated, whereas the vector can be only rotated and scaled.
The transformation depends on the implementation of the transform, here are a few examples:
RigidBodyTransform
rotates then translates a point.
QuaternionBasedTransform
rotates then translates a point.
AffineTransform
scales, rotates, then translates a point.
transform
in interface Transform
pointOriginal
- the point to transform. Not modified.pointTransformed
- the point in which the result is stored. Modified.checkIfTransformInXYPlane
- whether this method should assert that the rotation part of
this transform represents a transformation in the XY plane.public void transform(Vector2DReadOnly vectorOriginal, Vector2DBasics vectorTransformed, boolean checkIfTransformInXYPlane)
vector2DOriginal
by this transform and stores the result in
vector2DTransformed
.
Note: transforming a point differs from transforming a vector in the way that the point can be translated, whereas the vector can be only rotated and scaled.
The transformation depends on the implementation of the transform, here are a few examples:
RigidBodyTransform
rotates then translates a point.
QuaternionBasedTransform
rotates then translates a point.
AffineTransform
scales, rotates, then translates a point.
transform
in interface Transform
vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.checkIfTransformInXYPlane
- whether this method should assert that the rotation part of
this transform represents a transformation in the XY plane.public void transform(RigidBodyTransform original, RigidBodyTransform transformed)
original
by this transform and stores the result in
transformed
.
The given transform is only rotated and translated, no scaling is applied.
public void transform(QuaternionBasedTransform original, QuaternionBasedTransform transformed)
original
by this transform and stores the result in
transformed
.
The given transform is only rotated and translated, no scaling is applied.
public void transform(AffineTransform original, AffineTransform transformed)
original
by this transform and stores the result in
transformed
.
The given transform is only rotated and translated, no scaling is applied.
public void inverseTransform(Point3DReadOnly pointOriginal, Point3DBasics pointTransformed)
pointOriginal
and stores the
result in pointTransformed
.
This is equivalent to calling Transform.transform(Point3DReadOnly, Point3DBasics)
with the
inverse of this transform.
inverseTransform
in interface Transform
pointOriginal
- the point to transform. Not modified.pointTransformed
- the point in which the result is stored. Modified.public void inverseTransform(Vector3DReadOnly vectorOriginal, Vector3DBasics vectorTransformed)
vectorOriginal
and stores
the result in vectorTransformed
.
This is equivalent to calling Transform.transform(Vector3DReadOnly, Vector3DBasics)
with the
inverse of this transform.
inverseTransform
in interface Transform
vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.public void inverseTransform(QuaternionReadOnly quaternionOriginal, QuaternionBasics quaternionTransformed)
quaternionOriginal
and
stores the result in quaternionTransformed
.
This is equivalent to calling Transform.transform(QuaternionReadOnly, QuaternionBasics)
with
the inverse of this transform.
inverseTransform
in interface Transform
quaternionOriginal
- the quaternion to transform. Not modified.quaternionTransformed
- the quaternion in which the result is stored. Modified.public void inverseTransform(Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
vectorOriginal
and stores
the result in vectorTransformed
.
This is equivalent to calling Transform.transform(Vector4DReadOnly, Vector4DBasics)
with the
inverse of this transform.
inverseTransform
in interface Transform
vectorOriginal
- the 4D vector to transform. Not modified.vectorTransformed
- the 4D vector in which the result is stored. Modified.public void inverseTransform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
and stores
the result in matrixTransformed
.
This is equivalent to calling Transform.transform(Matrix3DReadOnly, Matrix3D)
with the inverse
of this transform.
inverseTransform
in interface Transform
matrixOriginal
- the matrix to transform. Not modified.matrixTransformed
- the matrix in which the result in stored. Modified.public void inverseTransform(RotationMatrixReadOnly matrixOriginal, RotationMatrix matrixTransformed)
matrixOriginal
and stores
the result in matrixTransformed
.
This is equivalent to calling Transform.transform(RotationMatrixReadOnly, RotationMatrix)
with
the inverse of this transform.
inverseTransform
in interface Transform
matrixOriginal
- the rotation matrix to transform. Not modified.matrixTransformed
- the rotation matrix in which the result is stored. Modified.public void inverseTransform(Point2DReadOnly pointOriginal, Point2DBasics pointTransformed, boolean checkIfTransformInXYPlane)
pointOriginal
and stores the
result in pointTransformed
.
This is equivalent to calling Transform.transform(Point2DReadOnly, Point2DBasics, boolean)
with
the inverse of this transform.
inverseTransform
in interface Transform
pointOriginal
- the point to transform. Not modified.pointTransformed
- the point in which the result is stored. Modified.checkIfTransformInXYPlane
- whether this method should assert that the rotation part of
this transform represents a transformation in the XY plane.public void inverseTransform(Vector2DReadOnly vectorOriginal, Vector2DBasics vectorTransformed, boolean checkIfTransformInXYPlane)
vectorOriginal
and stores
the result in vectorTransformed
.
This is equivalent to calling Transform.transform(Vector2DReadOnly, Vector2DBasics, boolean)
with the inverse of this transform.
inverseTransform
in interface Transform
vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.checkIfTransformInXYPlane
- whether this method should assert that the rotation part of
this transform represents a transformation in the XY plane.public void inverseTransform(RigidBodyTransform original, RigidBodyTransform transformed)
original
and stores the result in
transformed
.
This is equivalent to calling Transform.transform(RigidBodyTransform, RigidBodyTransform)
with
the inverse of this transform.
The given transform is only rotated and translated, no scaling is applied.
inverseTransform
in interface Transform
original
- the rigid-body transform to transform. Not modified.transformed
- the rigid-body transform in which the result is stored. Modified.public void inverseTransform(QuaternionBasedTransform original, QuaternionBasedTransform transformed)
original
stores the result in
transformed
.
This is equivalent to calling
Transform.transform(QuaternionBasedTransform, QuaternionBasedTransform)
with the inverse of
this transform.
The given transform is only rotated and translated, no scaling is applied.
inverseTransform
in interface Transform
original
- the quaternion based transform to transform. Not modified.transformed
- the quaternion based transform in which the result is stored. Modified.public void inverseTransform(AffineTransform original, AffineTransform transformed)
original
and stores the result in
transformed
.
This is equivalent to calling Transform.transform(AffineTransform, AffineTransform)
with the
inverse of this transform.
The given transform is only rotated and translated, no scaling is applied.
inverseTransform
in interface Transform
original
- the affine transform to transform. Not modified.transformed
- the affine transform in which the result is stored. Modified.public void get(org.ejml.data.DenseMatrix64F matrixToPack)
/ qx \ | qy | | qz | H = | qs | | tx | | ty | \ tz /where (qx, qy, qz, qs) is the quaternion and (tx, ty, tz) the translation of this transform.
matrixToPack
- the column vector in which this transform is stored. Modified.public void get(int startRow, int column, org.ejml.data.DenseMatrix64F matrixToPack)
/ qx \ | qy | | qz | H = | qs | | tx | | ty | \ tz /where (qx, qy, qz, qs) is the quaternion and (tx, ty, tz) the translation of this transform.
startRow
- the first row index to start writing in matrixToPack
.column
- the column index to write in matrixToPack
.matrixToPack
- the column vector in which this transform is stored. Modified.public void get(double[] transformArrayToPack)
/ qx \ | qy | | qz | H = | qs | | tx | | ty | \ tz /where (qx, qy, qz, qs) is the quaternion and (tx, ty, tz) the translation of this transform.
transformArrayToPack
- the array in which this transform is packed. Modified.public void get(QuaternionBasics quaternionToPack, Tuple3DBasics translationToPack)
quaternionToPack
- the quaternion in which this transform's quaternion is stored. Modified.translationToPack
- the tuple in which this transform's translation is stored. Modified.public void get(RotationMatrix rotationMarixToPack, Tuple3DBasics translationToPack)
rotationMarixToPack
- the rotation matrix that is set to this transform's quaternion.
ModifiedtranslationToPack
- the tuple in which this transform's translation is stored. Modified.public void get(RotationScaleMatrix rotationMarixToPack, Tuple3DBasics translationToPack)
rotationMarixToPack
- the rotation-scale matrix that is set to this transform's quaternion.
The scale part is reset. Modified.translationToPack
- the tuple in which this transform's translation is stored. Modified.public QuaternionReadOnly getQuaternion()
public void getRotation(RotationMatrix rotationMatrixToPack)
rotationMatrixToPack
- the matrix in which the rotation part of this transform is stored.
Modified.public void getRotation(QuaternionBasics quaternionToPack)
quaternionToPack
- the quaternion that is set to the rotation part of this transform.
Modified.public void getRotation(AxisAngleBasics axisAngleToPack)
axisAngleToPack
- the axis-angle that is set to the rotation part of this transform.
Modified.public void getRotation(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.
rotationVectorToPack
- the rotation vector that is set to the rotation part of this
transform. Modified.public void getRotationYawPitchRoll(double[] yawPitchRollToPack)
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
yawPitchRollToPack
- the array in which the yaw-pitch-roll angles are stored. Modified.public void getRotationEuler(Vector3DBasics eulerAnglesToPack)
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
eulerAnglesToPack
- the tuple in which the Euler angles are stored. Modified.public Vector3DReadOnly getTranslationVector()
public void getTranslation(Tuple3DBasics translationToPack)
translationToPack
- the tuple in which the translation part of this transform is stored.
Modified.public double getTranslationX()
public double getTranslationY()
public double getTranslationZ()
public boolean epsilonEquals(QuaternionBasedTransform other, double epsilon)
other
are equal to an epsilon
.epsilonEquals
in interface EpsilonComparable<QuaternionBasedTransform>
other
- the other quaternion-based transform to compare against this. Not modified.epsilon
- tolerance to use when comparing each component.true
if the two objects are equal component-wise, false
otherwise.public boolean equals(java.lang.Object object)
object
's class is the same as this, in which case the method returns
equals(QuaternionBasedTransform)
, it returns false
otherwise or if the
object
is null
.equals
in class java.lang.Object
object
- the object to compare against this. Not modified.true
if object
and this are exactly equal, false
otherwise.public boolean equals(QuaternionBasedTransform other)
other
are exactly equal.
The method returns false
if the given transform is null
.
other
- the other transform to compare against this. Not modified.true
if the two transforms are exactly equal, false
otherwise.public boolean geometricallyEquals(QuaternionBasedTransform other, double epsilon)
geometricallyEquals
in interface GeometricallyComparable<QuaternionBasedTransform>
other
- the other quaternion based transform to compare against this. Not modified.epsilon
- the tolerance to use when comparing each component.true
if the two quaternion based transforms are equal, false
otherwise.public java.lang.String toString()
String
representation of this transform as follows: toString
in class java.lang.Object
String
representing this transform.public int hashCode()
hashCode
in class java.lang.Object