Clearable
, EpsilonComparable<AffineTransform>
, GeometricallyComparable<AffineTransform>
, Settable<AffineTransform>
, Transform
public class AffineTransform extends java.lang.Object implements Transform, EpsilonComparable<AffineTransform>, GeometricallyComparable<AffineTransform>, Settable<AffineTransform>, Clearable
AffineTransform
represents a 4-by-4 transformation matrix that can scale, rotate, and
translate.
For efficiency and readability, the transform is never stored in a 4-by-4 matrix.
The AffineTransform
is composed of RotationScaleMatrix
to scale and rotate, and a
Vector3D
to translate.
Because the RotationScaleMatrix
is a restrictive type of matrix, the algebra available
with this is somewhat restricted to keep the rotation-scale matrix proper at all time. For
instance, an affine transform cannot be inverted. However, it can still perform the inverse of
the transform it represents on geometry objects.
A few special cases to keep in mind:
QuaternionBasics
, the rotation part of this transform is prepend
to the quaternion, such that the output remains a proper unit-quaternion that still only
describes a rotation.
RotationMatrix
, the rotation part of this transform is prepend to
the rotation matrix, such that the output remains a proper rotation matrix.
Point3DBasics
or Point2DBasics
, this object
is, in order, scaled, rotated, and then translated.
Vector3DBasics
or Vector2DBasics
, this
object is, in order, scaled, and then rotated. It is NOT translated.
Constructor | Description |
---|---|
AffineTransform() |
Creates a new affine transform set to identity.
|
AffineTransform(RotationScaleMatrixReadOnly rotationScaleMatrix,
Tuple3DReadOnly translation) |
Creates a new affine transform and initializes it from the given rotation-scale matrix and the
given translation.
|
AffineTransform(AffineTransform other) |
Creates a new affine transform and sets it to
other . |
AffineTransform(RigidBodyTransform rigidBodyTransform) |
Creates a new affine transform and sets it to
rigidBodyTransform . |
Modifier and Type | Method | Description |
---|---|---|
void |
addTranslation(Tuple3DReadOnly translation) |
Adds the given tuple to the translation part of this transform.
|
void |
appendPitchRotation(double pitch) |
Append a rotation about the y-axis to the rotation part of this transform.
|
void |
appendRollRotation(double roll) |
Append a rotation about the x-axis to the rotation part 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 of this transform.
|
boolean |
containsNaN() |
Tests if at least one element of this transform is equal to Double.NaN.
|
boolean |
epsilonEquals(AffineTransform other,
double epsilon) |
Tests separately and on a per component basis if the rotation part, the scale 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(AffineTransform) , it returns false otherwise or if the object is
null . |
boolean |
equals(AffineTransform other) |
Tests separately and on a per component basis if the rotation part, the scale part, and the
translation part of this transform and
other are exactly equal. |
boolean |
geometricallyEquals(AffineTransform other,
double epsilon) |
Two affine transforms are considered geometrically equal if both the rotation-scale matrices and
translation vectors are equal.
|
void |
get(double[] transformArrayToPack) |
Packs this transform as a 4-by-4 matrix into a 1D row-major array.
|
void |
get(int startRow,
int startColumn,
org.ejml.data.DenseMatrix64F matrixToPack) |
Packs this transform as a 4-by-4 matrix.
|
void |
get(org.ejml.data.DenseMatrix64F matrixToPack) |
Packs this transform as a 4-by-4 matrix.
|
void |
get(Matrix3DBasics rotationScaleMarixToPack,
Tuple3DBasics translationToPack) |
Packs the rotation-scale matrix and the translation vector of this affine transform.
|
void |
get(RotationScaleMatrix rotationScaleMarixToPack,
Tuple3DBasics translationToPack) |
Packs the rotation-scale matrix and the translation vector of this affine transform.
|
double |
getElement(int row,
int column) |
Retrieves and returns a coefficient of this transform given its row and column indices.
|
double |
getM00() |
Gets the 1st row 1st column coefficient of this transform.
|
double |
getM01() |
Gets the 1st row 2nd column coefficient of this transform.
|
double |
getM02() |
Gets the 1st row 3rd column coefficient of this transform.
|
double |
getM03() |
Gets the 1st row 4th column coefficient of this transform.
|
double |
getM10() |
Gets the 2nd row 1st column coefficient of this transform.
|
double |
getM11() |
Gets the 2nd row 2nd column coefficient of this transform.
|
double |
getM12() |
Gets the 2nd row 3rd column coefficient of this transform.
|
double |
getM13() |
Gets the 2nd row 4th column coefficient of this transform.
|
double |
getM20() |
Gets the 3rd row 1st column coefficient of this transform.
|
double |
getM21() |
Gets the 3rd row 2nd column coefficient of this transform.
|
double |
getM22() |
Gets the 3rd row 3rd column coefficient of this transform.
|
double |
getM23() |
Gets the 3rd row 4th column coefficient of this transform.
|
double |
getM30() |
Gets the 4th row 1st column coefficient of this transform.
|
double |
getM31() |
Gets the 4th row 2nd column coefficient of this transform.
|
double |
getM32() |
Gets the 4th row 3rd column coefficient of this transform.
|
double |
getM33() |
Gets the 4th row 4th column coefficient of this transform.
|
void |
getRigidBodyTransform(RigidBodyTransform rigidBodyTransformToPack) |
Packs the rotation and translation parts of this transform in the given rigid-body transform.
|
void |
getRotation(double[] rotationMatrixArrayToPack) |
Packs the rotation part of this affine transform in 1D row-major array.
|
void |
getRotation(org.ejml.data.DenseMatrix64F rotationMatrixToPack) |
Packs the rotation part of this affine transform.
|
void |
getRotation(AxisAngleBasics axisAngleToPack) |
Packs the rotation part of this affine transform as an axis-angle.
|
void |
getRotation(Matrix3DBasics rotationMatrixToPack) |
Packs the rotation part of this affine transform.
|
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(Tuple3DBasics eulerAnglesToPack) |
Packs the orientation described by the rotation part as the Euler angles.
|
RotationMatrixReadOnly |
getRotationMatrix() |
Gets the read-only reference to the rotation part of this transform.
|
void |
getRotationScale(org.ejml.data.DenseMatrix64F rotationScaleMatrixToPack) |
Packs the rotation part of this affine transform.
|
void |
getRotationScale(Matrix3DBasics rotationScaleMatrixToPack) |
Packs the rotation part of this affine transform.
|
void |
getRotationScale(RotationScaleMatrix rotationScaleMatrixToPack) |
Packs the rotation part of this affine transform.
|
RotationScaleMatrixReadOnly |
getRotationScaleMatrix() |
Gets the read-only reference to the rotation-scale part of this transform.
|
void |
getRotationYawPitchRoll(double[] yawPitchRollToPack) |
Packs the orientation described by the rotation part as the yaw-pitch-roll angles.
|
Tuple3DReadOnly |
getScale() |
Gets the read-only reference to the scale part of this transform.
|
void |
getScale(Tuple3DBasics scaleToPack) |
Packs the scale factors in a tuple.
|
double |
getScaleX() |
Returns the current value of the x-axis scale factor of this affine transform.
|
double |
getScaleY() |
Returns the current value of the y-axis scale factor of this affine transform.
|
double |
getScaleZ() |
Returns the current value of the z-axis scale factor of this affine transform.
|
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 |
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 |
multiply(AffineTransform other) |
Performs the multiplication of this with the given
other . |
void |
multiply(QuaternionBasedTransform quaternionBasedTransform) |
Performs the multiplication of this with the given
quaternionBasedTransform . |
void |
multiply(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of this with the given
rigidBodyTransform . |
void |
multiplyInvertOther(AffineTransform other) |
Performs the multiplication of this with the inverse of the given
other . |
void |
multiplyInvertOther(QuaternionBasedTransform quaternionBasedTransform) |
Performs the multiplication of this transform with the inverse of
quaternionBasedTransform . |
void |
multiplyInvertOther(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of this with the inverse of the given
rigidBodyTransform . |
void |
multiplyInvertThis(AffineTransform other) |
Performs the multiplication of the inverse of this with the given
other . |
void |
multiplyInvertThis(QuaternionBasedTransform quaternionBasedTransform) |
Performs the multiplication of the inverse of this transform with
quaternionBasedTransform . |
void |
multiplyInvertThis(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of the inverse of this with the given
rigidBodyTransform . |
void |
normalizeRotationPart() |
Normalize the rotation part of this transform.
|
void |
preMultiply(AffineTransform other) |
Performs the multiplication of
other with this transform. |
void |
preMultiply(QuaternionBasedTransform quaternionBasedTransform) |
Performs the multiplication of
rigidBodyTransform with this transform. |
void |
preMultiply(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of
rigidBodyTransform with this transform. |
void |
preMultiplyInvertOther(AffineTransform other) |
Performs the multiplication of the inverse of
other with this transform. |
void |
preMultiplyInvertOther(QuaternionBasedTransform quaternionBasedTransform) |
Performs the multiplication of the inverse of
quaternionBasedTransform with this
transform. |
void |
preMultiplyInvertOther(RigidBodyTransform rigidBodyTransform) |
Performs the multiplication of the inverse of
rigidBodyTransform with this transform. |
void |
preMultiplyInvertThis(AffineTransform other) |
Performs the multiplication of
other with the inverse of this transform. |
void |
preMultiplyInvertThis(QuaternionBasedTransform quaternionBasedTransform) |
Performs the multiplication of
quaternionBasedTransform 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 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 the rotation part of this transform.
|
void |
resetScale() |
Sets all the scale factors to 1.0.
|
void |
set(double[] transformArray) |
Sets the raw components of this affine transform from the given
transformArray . |
void |
set(double m00,
double m01,
double m02,
double m03,
double m10,
double m11,
double m12,
double m13,
double m20,
double m21,
double m22,
double m23) |
Sets this affine transform from the given 12 coefficients.
|
void |
set(org.ejml.data.DenseMatrix64F matrix) |
Sets the raw components of this affine transform from the given
matrix . |
void |
set(org.ejml.data.DenseMatrix64F matrix,
int startRow,
int startColumn) |
Sets the raw components of this affine transform from the given
matrix . |
void |
set(AxisAngleReadOnly axisAngle,
double scaleX,
double scaleY,
double scaleZ,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(AxisAngleReadOnly axisAngle,
double scale,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(AxisAngleReadOnly axisAngle,
Tuple3DReadOnly scales,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(Matrix3DReadOnly rotationMatrix,
double scaleX,
double scaleY,
double scaleZ,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(Matrix3DReadOnly rotationMatrix,
double scale,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(Matrix3DReadOnly rotationScaleMatrix,
Tuple3DReadOnly translation) |
Sets the rotation-scale and translation parts of this transform separately.
|
void |
set(Matrix3DReadOnly rotationMatrix,
Tuple3DReadOnly scales,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(RotationMatrixReadOnly rotationMatrix,
double scaleX,
double scaleY,
double scaleZ,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(RotationMatrixReadOnly rotationMatrix,
double scale,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(RotationMatrixReadOnly rotationMatrix,
Tuple3DReadOnly scales,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(RotationScaleMatrixReadOnly rotationScaleMatrix,
Tuple3DReadOnly translation) |
Sets the rotation-scale and translation parts of this transform separately.
|
void |
set(AffineTransform other) |
Sets this affine transform to the
other . |
void |
set(RigidBodyTransform rigidBodyTransform) |
Sets this affine transform to the given rigid-body transform.
|
void |
set(QuaternionReadOnly quaternion,
double scaleX,
double scaleY,
double scaleZ,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(QuaternionReadOnly quaternion,
double scale,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
set(QuaternionReadOnly quaternion,
Tuple3DReadOnly scales,
Tuple3DReadOnly translation) |
Sets the rotation, scale, and translation parts of this transform separately.
|
void |
setIdentity() |
Resets this affine transform to identity.
|
void |
setRotation(org.ejml.data.DenseMatrix64F rotationMatrix) |
Sets the rotation part of this transform to the given matrix.
|
void |
setRotation(AxisAngleReadOnly axisAngle) |
Sets the rotation part of this transform to the given axis-angle.
|
void |
setRotation(Matrix3DReadOnly rotationMatrix) |
Sets the rotation part of this transform to the given matrix.
|
void |
setRotation(RotationMatrixReadOnly rotationMatrix) |
Sets the rotation part of this transform to the given 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 rotation-scale matrix 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 |
setScale(double scale) |
Sets each component of the scale part of this transform to
scale . |
void |
setScale(double scaleX,
double scaleY,
double scaleZ) |
Sets the scale part of this transform to
scaleX , scaleY , and scaleZ . |
void |
setScale(Tuple3DReadOnly scales) |
Sets the scale part of this transform to
scales . |
void |
setToNaN() |
Sets all the components of this affine transform making it invalid.
|
void |
setToZero() |
Resets this affine transform to identity.
|
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.
|
java.lang.String |
toString() |
Provides a
String representation of this transform as follows: m00, m01, m02 | m03 m10, m11, m12 | m13 m20, m21, m22 | m23 |
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 AffineTransform()
When set to identity, this transform has no effect when transforming a geometry object.
public AffineTransform(AffineTransform other)
other
.other
- the other affine transform to copy. Not modified.public AffineTransform(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
.
This affine transform has no scaling (1.0, 1.0, 1.0).
rigidBodyTransform
- the rigid-body transform to copy. Not modified.public AffineTransform(RotationScaleMatrixReadOnly rotationScaleMatrix, Tuple3DReadOnly translation)
rotationScaleMatrix
- the rotation-scale matrix to copy. Not modified.translation
- the translation to copy. Not modified.public void setIdentity()
When set to identity, this transform has no effect when transforming a geometry object.
public void setToZero()
When set to identity, this transform has no effect when transforming a geometry object.
public void setRotationToZero()
This method does NOT affect the scale part of this transform.
public void resetScale()
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 normalizeRotationPart()
This method does NOT affect the scale part of this transform.
NotARotationMatrixException
- if the orthonormalization failed.public void set(double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23)
m00
- the 1st row 1st column component of the rotation-scale part of this transform.m01
- the 1st row 2nd column component of the rotation-scale part of this transform.m02
- the 1st row 3rd column component of the rotation-scale part of this transform.m03
- the x-component of the translation part of this transform.m10
- the 2nd row 1st column component of the rotation-scale part of this transform.m11
- the 2nd row 2nd column component of the rotation-scale part of this transform.m12
- the 2nd row 3rd column component of the rotation-scale part of this transform.m13
- the y-component of the translation part of this transform.m20
- the 3rd row 1st column component of the rotation-scale part of this transform.m21
- the 3rd row 2nd column component of the rotation-scale part of this transform.m22
- the 3rd row 3rd column component of the rotation-scale part of this transform.m23
- the z-component of the translation part of this transform.NotARotationScaleMatrixException
- if the components for the rotation-scale part do not
represent a rotation-scale matrix.public void set(AffineTransform other)
other
.set
in interface Settable<AffineTransform>
other
- the other affine transform to copy the values from. Not modified.public void set(RigidBodyTransform rigidBodyTransform)
The scaling part of this transform will be reset.
rigidBodyTransform
- the rigid-body transform to copy the values from. Not modified.public void set(org.ejml.data.DenseMatrix64F matrix)
matrix
.
The rotation-scale part M is set as follows:
/ matrix.get(0, 0) matrix.get(0, 1) matrix.get(0, 2) \ M = | matrix.get(1, 0) matrix.get(1, 1) matrix.get(1, 2) | \ matrix.get(2, 0) matrix.get(2, 1) matrix.get(2, 2) /The translation part T is set as follows:
/ matrix.get(0, 3) \ T = | matrix.get(1, 3) | \ matrix.get(2, 3) /
matrix
- the matrix to get this transform's components from. Not modified.NotARotationScaleMatrixException
- if the resulting matrix for the rotation-scale part of
this transform is not a rotation-scale matrix.public void set(org.ejml.data.DenseMatrix64F matrix, int startRow, int startColumn)
matrix
.
The rotation-scale part M is set as follows:
/ matrix.get(startRow + 0, startColumn + 0) matrix.get(startRow + 0, startColumn + 1) matrix.get(startRow + 0, startColumn + 2) \ M = | matrix.get(startRow + 1, startColumn + 0) matrix.get(startRow + 1, startColumn + 1) matrix.get(startRow + 1, startColumn + 2) | \ matrix.get(startRow + 2, startColumn + 0) matrix.get(startRow + 2, startColumn + 1) matrix.get(startRow + 2, startColumn + 2) /The translation part T is set as follows:
/ matrix.get(startRow + 0, startColumn + 3) \ T = | matrix.get(startRow + 1, startColumn + 3) | \ matrix.get(startRow + 2, startColumn + 3) /
matrix
- the matrix to get this transform's components from. Not modified.startRow
- the row index of the first component to read.startColumn
- the column index of the first component to read.NotARotationScaleMatrixException
- if the resulting matrix for the rotation-scale part of
this transform is not a rotation-scale matrix.public void set(double[] transformArray)
transformArray
.
The rotation-scale part M is set as follows:
/ transformArray[0] transformArray[1] transformArray[ 2] \ M = | transformArray[4] transformArray[5] transformArray[ 6] | \ transformArray[8] transformArray[9] transformArray[10] /The translation part T is set as follows:
/ transformArray[ 3] \ T = | transformArray[ 7] | \ transformArray[11] /
transformArray
- the 1D row-major array to get this transform's components from. Not
modified.NotARotationScaleMatrixException
- if the resulting matrix for the rotation-scale part of
this transform is not a rotation-scale matrix.public void set(Matrix3DReadOnly rotationScaleMatrix, Tuple3DReadOnly translation)
rotationScaleMatrix
- the matrix used to set the rotation-scale part of this transform. Not
modified.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if the given rotationScaleMatrix
is not a
rotation-scale matrix.public void set(RotationScaleMatrixReadOnly rotationScaleMatrix, Tuple3DReadOnly translation)
rotationScaleMatrix
- the matrix used to set the rotation-scale part of this transform. Not
modified.translation
- the tuple used to set the translation part of this transform. Not modified.public void set(Matrix3DReadOnly rotationMatrix, double scale, Tuple3DReadOnly translation)
rotationMatrix
- the matrix used to set the rotation part of this transform. Not modified.scale
- the scalar used to set the scale part of this transform.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationMatrixException
- if the given rotationMatrix
is not a rotation matrix.NotARotationScaleMatrixException
- if scale <= 0.0
.public void set(Matrix3DReadOnly rotationMatrix, double scaleX, double scaleY, double scaleZ, Tuple3DReadOnly translation)
rotationMatrix
- the matrix used to set the rotation part of this transform. Not modified.scaleX
- the new x-component of the scale part of this transform.scaleY
- the new y-component of the scale part of this transform.scaleZ
- the new z-component of the scale part of this transform.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationMatrixException
- if the given rotationMatrix
is not a rotation matrix.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void set(Matrix3DReadOnly rotationMatrix, Tuple3DReadOnly scales, Tuple3DReadOnly translation)
rotationMatrix
- the matrix used to set the rotation part of this transform. Not modified.scales
- the tuple used to set the scale part of this transform. Not modified.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationMatrixException
- if the given rotationMatrix
is not a rotation matrix.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void set(RotationMatrixReadOnly rotationMatrix, double scale, Tuple3DReadOnly translation)
rotationMatrix
- the matrix used to set the rotation part of this transform. Not modified.scale
- the scalar used to set the scale part of this transform.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if scale <= 0.0
.public void set(RotationMatrixReadOnly rotationMatrix, double scaleX, double scaleY, double scaleZ, Tuple3DReadOnly translation)
rotationMatrix
- the matrix used to set the rotation part of this transform. Not modified.scaleX
- the new x-component of the scale part of this transform.scaleY
- the new y-component of the scale part of this transform.scaleZ
- the new z-component of the scale part of this transform.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void set(RotationMatrixReadOnly rotationMatrix, Tuple3DReadOnly scales, Tuple3DReadOnly translation)
rotationMatrix
- the matrix used to set the rotation part of this transform. Not modified.scales
- the tuple used to set the scale part of this transform. Not modified.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void set(AxisAngleReadOnly axisAngle, double scale, Tuple3DReadOnly translation)
axisAngle
- the axis-angle used to set the rotation part of this transform. Not modified.scale
- the scalar used to set the scale part of this transform.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if scale <= 0.0
.public void set(AxisAngleReadOnly axisAngle, double scaleX, double scaleY, double scaleZ, Tuple3DReadOnly translation)
axisAngle
- the axis-angle used to set the rotation part of this transform. Not modified.scaleX
- the new x-component of the scale part of this transform.scaleY
- the new y-component of the scale part of this transform.scaleZ
- the new z-component of the scale part of this transform.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void set(AxisAngleReadOnly axisAngle, Tuple3DReadOnly scales, Tuple3DReadOnly translation)
axisAngle
- the axis-angle used to set the rotation part of this transform. Not modified.scales
- the tuple used to set the scale part of this transform. Not modified.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void set(QuaternionReadOnly quaternion, double scale, Tuple3DReadOnly translation)
quaternion
- the quaternion used to set the rotation part of this transform. Not modified.scale
- the scalar used to set the scale part of this transform.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if scale <= 0.0
.public void set(QuaternionReadOnly quaternion, double scaleX, double scaleY, double scaleZ, Tuple3DReadOnly translation)
quaternion
- the quaternion used to set the rotation part of this transform. Not modified.scaleX
- the new x-component of the scale part of this transform.scaleY
- the new y-component of the scale part of this transform.scaleZ
- the new z-component of the scale part of this transform.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void set(QuaternionReadOnly quaternion, Tuple3DReadOnly scales, Tuple3DReadOnly translation)
quaternion
- the quaternion used to set the rotation part of this transform. Not modified.scales
- the tuple used to set the scale part of this transform. Not modified.translation
- the tuple used to set the translation part of this transform. Not modified.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void setRotation(AxisAngleReadOnly axisAngle)
This method does not affect the scale part nor the translation part of this transform.
axisAngle
- the axis-angle used to set the rotation part of this transform. Not modified.public void setRotation(Vector3DReadOnly rotationVector)
This method does not affect the scale part nor 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 rotation part of this transform. Not
modified.public void setRotation(org.ejml.data.DenseMatrix64F rotationMatrix)
This method does not affect the scale part nor the translation part of this transform.
rotationMatrix
- the matrix used to set the rotation part of this transform. Not modified.NotARotationMatrixException
- if the given rotationMatrix
is not a rotation matrix.public void setRotation(QuaternionReadOnly quaternion)
This method does not affect the scale part nor the translation part of this transform.
quaternion
- the quaternion used to set the rotation part of this transform. Not modified.public void setRotation(Matrix3DReadOnly rotationMatrix)
This method does not affect the scale part nor the translation part of this transform.
rotationMatrix
- the matrix used to set the rotation part of this transform. Not modified.NotARotationMatrixException
- if the given rotationMatrix
is not a rotation matrix.public void setRotation(RotationMatrixReadOnly rotationMatrix)
This method does not affect the scale part nor the translation part of this transform.
rotationMatrix
- the matrix used to set the rotation part of this transform. Not modified.public void setRotationYaw(double yaw)
yaw
.
/ cos(yaw) -sin(yaw) 0 \ R = | sin(yaw) cos(yaw) 0 | \ 0 0 1 /
This method does not affect the scale part nor the translation part of this transform.
yaw
- the angle to rotate about the z-axis.public void setRotationPitch(double pitch)
pitch
.
/ cos(pitch) 0 sin(pitch) \ R = | 0 1 0 | \ -sin(pitch) 0 cos(pitch) /
This method does not affect the scale part nor the translation part of this transform.
pitch
- the angle to rotate about the y-axis.public void setRotationRoll(double roll)
roll
.
/ 1 0 0 \ R = | 0 cos(roll) -sin(roll) | \ 0 sin(roll) cos(roll) /
This method does not affect the scale part nor the translation part of this transform.
roll
- the angle to rotate about the x-axis.public void setRotationYawPitchRoll(double[] yawPitchRoll)
yaw
, pitch
, and roll
.
/ cos(yaw) -sin(yaw) 0 \ / cos(pitch) 0 sin(pitch) \ / 1 0 0 \ R = | sin(yaw) cos(yaw) 0 | * | 0 1 0 | * | 0 cos(roll) -sin(roll) | \ 0 0 1 / \ -sin(pitch) 0 cos(pitch) / \ 0 sin(roll) cos(roll) /
This method does not affect the scale part nor 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
.
/ cos(yaw) -sin(yaw) 0 \ / cos(pitch) 0 sin(pitch) \ / 1 0 0 \ R = | sin(yaw) cos(yaw) 0 | * | 0 1 0 | * | 0 cos(roll) -sin(roll) | \ 0 0 1 / \ -sin(pitch) 0 cos(pitch) / \ 0 sin(roll) cos(roll) /
This method does not affect the scale part nor 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
.
/ cos(eulerAngles.z) -sin(eulerAngles.z) 0 \ / cos(eulerAngles.y) 0 sin(eulerAngles.y) \ / 1 0 0 \ R = | sin(eulerAngles.z) cos(eulerAngles.z) 0 | * | 0 1 0 | * | 0 cos(eulerAngles.x) -sin(eulerAngles.x) | \ 0 0 1 / \ -sin(eulerAngles.y) 0 cos(eulerAngles.y) / \ 0 sin(eulerAngles.x) cos(eulerAngles.x) /
This method does not affect the scale part nor 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
.
/ cos(rotZ) -sin(rotZ) 0 \ / cos(rotY) 0 sin(rotY) \ / 1 0 0 \ R = | sin(rotZ) cos(rotZ) 0 | * | 0 1 0 | * | 0 cos(rotX) -sin(rotX) | \ 0 0 1 / \ -sin(rotY) 0 cos(rotY) / \ 0 sin(rotX) cos(rotX) /
This method does not affect the scale part nor 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 setScale(double scale)
scale
.
This method does not affect the rotation part nor the translation part of this transform.
scale
- the scalar used to set the scale part of this transform.NotARotationScaleMatrixException
- if scale <= 0.0
.public void setScale(double scaleX, double scaleY, double scaleZ)
scaleX
, scaleY
, and scaleZ
.
This method does not affect the rotation part nor the translation part of this transform.
scaleX
- the new x-component of the scale part of this transform.scaleY
- the new y-component of the scale part of this transform.scaleZ
- the new z-component of the scale part of this transform.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void setScale(Tuple3DReadOnly scales)
scales
.
This method does not affect the rotation part nor the translation part of this transform.
scales
- the tuple used to set the scale part of this transform. Not modified.NotARotationScaleMatrixException
- if any of the scale factors is less or equal to zero.public void setTranslationX(double x)
This method does not affect the rotation part nor the scale 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 nor the scale 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 nor the scale 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 nor the scale 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 nor the scale part of this transform.
translation
- tuple used to set the translation part of this transform. Not modified.public void addTranslation(Tuple3DReadOnly translation)
This method does not affect the rotation part nor the scale part of this transform.
translation
- tuple used to add to the translation part of this transform. Not modified.public void multiply(AffineTransform other)
other
.
Note: the scale part of either affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = this * other
other
- the other transform to multiply this with. Not modified.public void multiply(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
.
Note: the scale part of this affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = this * rigidBodyTransform
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void multiply(QuaternionBasedTransform quaternionBasedTransform)
quaternionBasedTransform
.
Note: the scale part of this affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = this * H(quaternionBasedTransform)
where H(q) is the function converting a quaternion-based transform into a 4-by-4 transformation
matrix.
quaternionBasedTransform
- the quaternion-based transform to multiply this with. Not
modified.public void multiplyInvertThis(AffineTransform other)
other
.
Note: the scale part of the either affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = this-1 * other
other
- the other transform to multiply this with. Not modified.public void multiplyInvertOther(AffineTransform other)
other
.
Note: the scale part of the either affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = this * other-1
other
- the other transform to multiply this with. Not modified.public void multiplyInvertThis(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
.
Note: the scale part of this affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = this-1 * rigidBodyTransform
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void multiplyInvertOther(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
.
Note: the scale part of this affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = this * rigidBodyTransform-1
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void multiplyInvertThis(QuaternionBasedTransform quaternionBasedTransform)
quaternionBasedTransform
.
Note: the scale part of this affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = this-1 * H(quaternionBasedTransform)
where H(q) is the function converting a quaternion-based transform into a 4-by-4 transformation
matrix.
quaternionBasedTransform
- the quaternion-based transform to multiply this with. Not
modified.public void multiplyInvertOther(QuaternionBasedTransform quaternionBasedTransform)
quaternionBasedTransform
.
Note: the scale part of this affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = this * H(quaternionBasedTransform)-1
where H(q) is the function converting a quaternion-based transform into a 4-by-4 transformation
matrix.
quaternionBasedTransform
- the quaternion-based transform to multiply this with. Not
modified.public void appendTranslation(Tuple3DReadOnly translation)
Note: the scale part of this affine transform is not used when performing the multiplication.
/ 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 nor the scale part of this transform.
translation
- the translation to append to this transform. Not modified.public void appendTranslation(double x, double y, double z)
Note: the scale part of this affine transform is not used when performing the multiplication.
/ 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 nor the scale 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)
/ cos(yaw) -sin(yaw) 0 \ R = R * | sin(yaw) cos(yaw) 0 | \ 0 0 1 /
This method does not affect the scale part nor the translation part of this transform.
yaw
- the angle to rotate about the z-axis.public void appendPitchRotation(double pitch)
/ cos(pitch) 0 sin(pitch) \ R = R * | 0 1 0 | \ -sin(pitch) 0 cos(pitch) /
This method does not affect the scale part nor the translation part of this transform.
pitch
- the angle to rotate about the y-axis.public void appendRollRotation(double roll)
/ 1 0 0 \ R = R * | 0 cos(roll) -sin(roll) | \ 0 sin(roll) cos(roll) /
This method does not affect the scale part nor the translation part of this transform.
roll
- the angle to rotate about the x-axis.public void preMultiply(AffineTransform other)
other
with this transform.
Note: the scale part of either affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = other * this
other
- the other transform to multiply this with. Not modified.public void preMultiply(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
with this transform.
Note: this operation does not affect the scale of this transform.
this = rigidBodyTransform * this
rigidBodyTransform
- the other transform to multiply this with. Not modified.public void preMultiply(QuaternionBasedTransform quaternionBasedTransform)
rigidBodyTransform
with this transform.
Note: this operation does not affect the scale of this transform.
this = H(quaternionBasedTransform) * this
where H(q) is the function converting a quaternion-based transform into a 4-by-4 transformation
matrix.
quaternionBasedTransform
- the quaternion-based transform to multiply this with. Not
modified.public void preMultiplyInvertThis(AffineTransform other)
other
with the inverse of this transform.
Note: the scale part of either affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = other * this-1
other
- the other transform to multiply this with. Not modified.public void preMultiplyInvertOther(AffineTransform other)
other
with this transform.
Note: the scale part of either affine transform is not used when performing the multiplication. This operation does not affect the scale of 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.
Note: the scale part of this affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = rigidBodyTransform * this-1
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void preMultiplyInvertOther(RigidBodyTransform rigidBodyTransform)
rigidBodyTransform
with this transform.
Note: this operation does not affect the scale of this transform.
this = rigidBodyTransform-1 * this
rigidBodyTransform
- the rigid-body transform to multiply this with. Not modified.public void preMultiplyInvertThis(QuaternionBasedTransform quaternionBasedTransform)
quaternionBasedTransform
with the inverse of this
transform.
Note: the scale part of this affine transform is not used when performing the multiplication. This operation does not affect the scale of this transform.
this = H(quaternionBasedTransform) * this-1
where H(q) is the function converting a quaternion-based transform into a 4-by-4 transformation
matrix.
quaternionBasedTransform
- the quaternion-based transform to multiply this with. Not
modified.public void preMultiplyInvertOther(QuaternionBasedTransform quaternionBasedTransform)
quaternionBasedTransform
with this
transform.
Note: this operation does not affect the scale of this transform.
this = H(quaternionBasedTransform)-1 * this
where H(q) is the function converting a quaternion-based transform into a 4-by-4 transformation
matrix.
quaternionBasedTransform
- the quaternion-based 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 nor the scale 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 nor the scale 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)
Note that the scale part of this transform is not used for this operation.
This method first rotates the translation part and then prepend the yaw-rotation to the rotation part of this transform.
/ cos(yaw) -sin(yaw) 0 0 \ this = | sin(yaw) cos(yaw) 0 0 | * this | 0 0 1 0 | \ 0 0 0 1 /
yaw
- the angle to rotate about the z-axis.public void prependPitchRotation(double pitch)
Note that the scale part of this transform is not used for this operation.
This method first rotates the translation part and then prepend the pitch-rotation to the rotation part of this transform.
/ cos(pitch) 0 sin(pitch) 0 \ this = | 0 1 0 0 | * this | -sin(pitch) 0 cos(pitch) 0 | \ 0 0 0 1 /
pitch
- the angle to rotate about the y-axis.public void prependRollRotation(double roll)
Note that the scale part of this transform is not used for this operation.
This method first rotates the translation part and then prepend the roll-rotation to the rotation part of this transform.
/ 1 0 0 0 \ this = | 0 cos(roll) -sin(roll) 0 | * this | 0 sin(roll) cos(roll) 0 | \ 0 0 0 1 /
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(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(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(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(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(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(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 getRigidBodyTransform(RigidBodyTransform rigidBodyTransformToPack)
rigidBodyTransformToPack
- the transform in which the rotation and translation parts of this
affine transform are stored. Modified.public void get(org.ejml.data.DenseMatrix64F matrixToPack)
/ M(0, 0) M(0, 1) M(0, 2) Tx \ H = | M(1, 0) M(1, 1) M(1, 2) Ty | | M(2, 0) M(2, 1) M(2, 2) Tz | \ 0 0 0 1 /where M is the 3-by-3 rotation-scale matrix and (Tx, Ty, Tz) is the translation part of this transform.
matrixToPack
- the matrix in which this transform is stored. Modified.public void get(int startRow, int startColumn, org.ejml.data.DenseMatrix64F matrixToPack)
/ M(0, 0) M(0, 1) M(0, 2) Tx \ H = | M(1, 0) M(1, 1) M(1, 2) Ty | | M(2, 0) M(2, 1) M(2, 2) Tz | \ 0 0 0 1 /where M is the 3-by-3 rotation-scale matrix and (Tx, Ty, Tz) is the translation part of this transform.
startRow
- the first row index to start writing in matrixToPack
.startColumn
- the first column index to start writing in matrixToPack
.matrixToPack
- the matrix in which this transform is stored. Modified.public void get(double[] transformArrayToPack)
/ M(0, 0) M(0, 1) M(0, 2) Tx \ H = | M(1, 0) M(1, 1) M(1, 2) Ty | | M(2, 0) M(2, 1) M(2, 2) Tz | \ 0 0 0 1 /where M is the 3-by-3 rotation-scale matrix and (Tx, Ty, Tz) is the translation part of this transform.
transformArrayToPack
- the array in which this transform is stored. Modified.public void get(Matrix3DBasics rotationScaleMarixToPack, Tuple3DBasics translationToPack)
rotationScaleMarixToPack
- matrix in which the rotation-scale matrix of this affine
transform is stored. Modified.translationToPack
- tuple in which the translation vector of this affine transform is
stored. Modified.public void get(RotationScaleMatrix rotationScaleMarixToPack, Tuple3DBasics translationToPack)
rotationScaleMarixToPack
- matrix in which the rotation-scale matrix of this affine
transform is stored. Modified.translationToPack
- tuple in which the translation vector of this affine transform is
stored. Modified.public RotationMatrixReadOnly getRotationMatrix()
public void getRotation(Matrix3DBasics rotationMatrixToPack)
rotationMatrixToPack
- the matrix in which the rotation part of this transform is stored.
Modified.public void getRotation(RotationMatrix rotationMatrixToPack)
rotationMatrixToPack
- the matrix in which the rotation part of this transform is stored.
Modified.public void getRotation(org.ejml.data.DenseMatrix64F rotationMatrixToPack)
rotationMatrixToPack
- the matrix in which the rotation part of this transform is stored.
Modified.public void getRotation(double[] rotationMatrixArrayToPack)
rotationMatrixArrayToPack
- the array 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 getRotationEuler(Tuple3DBasics 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 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 Tuple3DReadOnly getScale()
public double getScaleX()
public double getScaleY()
public double getScaleZ()
public void getScale(Tuple3DBasics scaleToPack)
scaleToPack
- the tuple in which the scale factors are stored. Modified.public RotationScaleMatrixReadOnly getRotationScaleMatrix()
public void getRotationScale(Matrix3DBasics rotationScaleMatrixToPack)
rotationScaleMatrixToPack
- the matrix in which the rotation-scale part of this transform is
stored. Modified.public void getRotationScale(RotationScaleMatrix rotationScaleMatrixToPack)
rotationScaleMatrixToPack
- the matrix in which the rotation-scale part of this transform is
stored. Modified.public void getRotationScale(org.ejml.data.DenseMatrix64F rotationScaleMatrixToPack)
rotationScaleMatrixToPack
- the matrix in which the rotation-scale part of this transform is
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 double getElement(int row, int column)
row
- the row of the coefficient to return.column
- the column of the coefficient to return.java.lang.ArrayIndexOutOfBoundsException
- if either row
∉ [0, 3] or column
∉ [0, 3].public double getM00()
public double getM01()
public double getM02()
public double getM03()
public double getM10()
public double getM11()
public double getM12()
public double getM13()
public double getM20()
public double getM21()
public double getM22()
public double getM23()
public double getM30()
Note: m30 = 0.0
.
public double getM31()
Note: m31 = 0.0
.
public double getM32()
Note: m32 = 0.0
.
public double getM33()
Note: m33 = 1.0
.
public boolean epsilonEquals(AffineTransform other, double epsilon)
other
are equal to an epsilon
.epsilonEquals
in interface EpsilonComparable<AffineTransform>
other
- the other affine 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(AffineTransform)
, 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(AffineTransform 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(AffineTransform other, double epsilon)
geometricallyEquals
in interface GeometricallyComparable<AffineTransform>
other
- the other affine transform to compare against this. Not modified.epsilon
- the tolerance to use when comparing each component.true
if the two rigid body 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