Matrix3DReadOnly
RotationScaleMatrix
public interface RotationScaleMatrixReadOnly extends Matrix3DReadOnly
A rotation-scale matrix M is equal to: M = R * S . Where R is a rotation matrix, and S is a scaling matrix as follows:
/ sx 0 0 \ S = | 0 sy 0 | \ 0 0 sz /where sx, sy, and sz three non-zero positive scale factors.
Note: To conserve the form M = R * S , the algebra with a rotation-scale matrix is rather restrictive. For instance, an rotation-scale matrix cannot be inverted. However, it can still perform the inverse of the transform it represents on geometry objects.
Modifier and Type | Method | Description |
---|---|---|
default void |
addTransform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the given tuple
tupleOriginal by this matrix and add the result to
tupleTransformed . |
default boolean |
epsilonEquals(RotationScaleMatrixReadOnly other,
double epsilon) |
Tests the rotation parts and scales of both matrices are equal to an
epsilon . |
default boolean |
geometricallyEquals(RotationScaleMatrixReadOnly other,
double epsilon) |
Tests if
this and other represent the same rotation-scale to an epsilon . |
default double |
getM00() |
Gets the 1st row 1st column coefficient of this matrix.
|
default double |
getM01() |
Gets the 1st row 2nd column coefficient of this matrix.
|
default double |
getM02() |
Gets the 1st row 3rd column coefficient of this matrix.
|
default double |
getM10() |
Gets the 2nd row 1st column coefficient of this matrix.
|
default double |
getM11() |
Gets the 2nd row 2nd column coefficient of this matrix.
|
default double |
getM12() |
Gets the 2nd row 3rd column coefficient of this matrix.
|
default double |
getM20() |
Gets the 3rd row 1st column coefficient of this matrix.
|
default double |
getM21() |
Gets the 3rd row 2nd column coefficient of this matrix.
|
default double |
getM22() |
Gets the 3rd row 3rd column coefficient of this matrix.
|
default double |
getMaxScale() |
Retrieves the scale factor with the maximum value and returns it.
|
default void |
getRotation(double[] rotationMatrixArrayToPack) |
Packs the rotation part as a rotation matrix and stores it into a row-major 1D array.
|
default void |
getRotation(org.ejml.data.DenseMatrix64F rotationMatrixToPack) |
Packs the rotation part as a rotation matrix.
|
default void |
getRotation(Orientation3DBasics orientationToPack) |
Packs the rotation part.
|
default void |
getRotation(Vector3DBasics rotationVectorToPack) |
Packs the rotation part as an rotation vector.
|
default void |
getRotationEuler(Tuple3DBasics eulerAnglesToPack) |
Packs the orientation described by the rotation part as the Euler angles.
|
RotationMatrixReadOnly |
getRotationMatrix() |
Returns the read-only reference to the rotation matrix used to compose this rotation-scale
matrix.
|
default double |
getRotationPitch() |
Computes and returns the pitch angle from the yaw-pitch-roll representation of the rotation part.
|
default double |
getRotationRoll() |
Computes and returns the roll angle from the yaw-pitch-roll representation of the rotation part.
|
default double |
getRotationYaw() |
Computes and returns the yaw angle from the yaw-pitch-roll representation of the rotation part.
|
default void |
getRotationYawPitchRoll(double[] yawPitchRollToPack) |
Packs the orientation described by the rotation part as the yaw-pitch-roll angles.
|
Vector3DReadOnly |
getScale() |
Returns the read-only reference to the scale factors used to compose this rotation-scale matrix.
|
default void |
getScale(Tuple3DBasics scaleToPack) |
Packs the scale factors in a tuple.
|
default double |
getScaleX() |
Returns the current value of the first scale factor of this rotation-scale matrix.
|
default double |
getScaleY() |
Returns the current value of the second scale factor of this rotation-scale matrix.
|
default double |
getScaleZ() |
Returns the current value of the third scale factor of this rotation-scale matrix.
|
default void |
inverseTransform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Performs the inverse of the transforms to the given 3D matrix
matrixOriginal by this
matrix and stores the result in matrixTransformed . |
default void |
inverseTransform(RotationMatrixReadOnly matrixOriginal,
RotationMatrix matrixTransformed) |
Transforms the given rotation matrix
matrixOriginal by the rotation part of this
rotation-scale matrix and stores the result in matrixTransformed . |
default void |
inverseTransform(RotationMatrix matrixToTransform) |
Performs the inverse of the transform to the given rotation matrix by the rotation part of this
rotation-scale matrix.
|
default void |
inverseTransform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfTransformInXYPlane) |
Performs the inverse of the transform to the given tuple
tupleOriginal by this matrix and
stores the result in tupleTransformed . |
default void |
inverseTransform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Performs the inverse of the transform to the given tuple
tupleOriginal by this matrix and
stores the result in tupleTransformed . |
default void |
inverseTransform(QuaternionBasics quaternionToTransform) |
Performs the inverse of the transform to the given quaternion by the rotation part of this
rotation-scale matrix.
|
default void |
inverseTransform(QuaternionReadOnly quaternionOriginal,
QuaternionBasics quaternionTransformed) |
Performs the inverse of the transform to the given quaternion
quaternionOriginal and
stores the result into quaternionTransformed . |
default void |
inverseTransform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Performs the inverse of the transform to the vector part the given 4D vector
vectorOriginal by this matrix and stores the result in vectorTransformed . |
default void |
transform(Matrix3DReadOnly matrixOriginal,
Matrix3D matrixTransformed) |
Transforms the given 3D matrix
matrixOriginal by this matrix and stores the result in
matrixTransformed . |
default void |
transform(RotationMatrixReadOnly matrixOriginal,
RotationMatrix matrixTransformed) |
Transforms the given rotation matrix
matrixOriginal by the rotation part of this
rotation-scale matrix and stores the result in matrixTransformed . |
default void |
transform(RotationMatrix matrixToTransform) |
Transforms the given rotation matrix by the rotation part of this rotation-scale matrix.
|
default void |
transform(Tuple2DReadOnly tupleOriginal,
Tuple2DBasics tupleTransformed,
boolean checkIfTransformInXYPlane) |
Transforms the given tuple
tupleOriginal by this matrix and stores the result in
tupleTransformed . |
default void |
transform(Tuple3DReadOnly tupleOriginal,
Tuple3DBasics tupleTransformed) |
Transforms the given tuple
tupleOriginal by this matrix and stores the result in
tupleTransformed . |
default void |
transform(QuaternionBasics quaternionToTransform) |
Transforms the given quaternion by the rotation part of this rotation-scale matrix.
|
default void |
transform(QuaternionReadOnly quaternionOriginal,
QuaternionBasics quaternionTransformed) |
Transforms the given quaternion
quaternionOriginal and stores the result into
quaternionTransformed . |
default void |
transform(Vector4DReadOnly vectorOriginal,
Vector4DBasics vectorTransformed) |
Transforms the vector part of the given 4D vector
vectorOriginal and stores the result
into vectorTransformed . |
addTransform, checkIfMatrix2D, checkIfRotationMatrix, containsNaN, determinant, epsilonEquals, equals, get, get, get, get, getColumn, getColumn, getElement, getRow, getRow, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, inverseTransform, isIdentity, isIdentity, isMatrix2D, isMatrix2D, isMatrixSkewSymmetric, isMatrixSkewSymmetric, isRotationMatrix, isRotationMatrix, transform, transform, transform, transform, transform, transform
RotationMatrixReadOnly getRotationMatrix()
Vector3DReadOnly getScale()
default double getScaleX()
default double getScaleY()
default double getScaleZ()
default double getM00()
getM00
in interface Matrix3DReadOnly
default double getM01()
getM01
in interface Matrix3DReadOnly
default double getM02()
getM02
in interface Matrix3DReadOnly
default double getM10()
getM10
in interface Matrix3DReadOnly
default double getM11()
getM11
in interface Matrix3DReadOnly
default double getM12()
getM12
in interface Matrix3DReadOnly
default double getM20()
getM20
in interface Matrix3DReadOnly
default double getM21()
getM21
in interface Matrix3DReadOnly
default double getM22()
getM22
in interface Matrix3DReadOnly
default double getMaxScale()
default void getRotation(Orientation3DBasics orientationToPack)
orientationToPack
- the orientation in which the rotation part is stored. Modified.default void getRotation(double[] rotationMatrixArrayToPack)
rotationMatrixArrayToPack
- the array in which the coefficients of the rotation part are
stored. Modified.default void getRotation(org.ejml.data.DenseMatrix64F rotationMatrixToPack)
rotationMatrixToPack
- the rotation matrix in which the rotation part is stored. Modified.default 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 in which the rotation part is stored. Modified.default 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.default 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.default double getRotationYaw()
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
default double getRotationPitch()
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
default double getRotationRoll()
WARNING: the Euler angles or yaw-pitch-roll representation is sensitive to gimbal lock and is sometimes undefined.
default void getScale(Tuple3DBasics scaleToPack)
scaleToPack
- the tuple in which the scale factors are stored. Modified.default void transform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this matrix and stores the result in
tupleTransformed
.
tupleTransformed = this * tupleOriginal
transform
in interface Matrix3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple to store the result. Modified.default void addTransform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this matrix and add the result to
tupleTransformed
.
tupleTransformed = tupleTransformed + this * tupleOriginal
addTransform
in interface Matrix3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple to add the result to. Modified.default void transform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed, boolean checkIfTransformInXYPlane)
tupleOriginal
by this matrix and stores the result in
tupleTransformed
.
tupleTransformed = this * tupleOriginal
transform
in interface Matrix3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple to store the result. Modified.checkIfTransformInXYPlane
- whether this method should assert that this matrix represents a
transformation in the XY plane.default void transform(QuaternionBasics quaternionToTransform)
quaternionToTransform = Q(this.getRotationMatrix()) * quaternionToTransform
where Q(this.getRotationMatrix()) is the equivalent quaternion for the rotation part of this
rotation-scale matrix.
quaternionToTransform
- the quaternion to transform. Modified.default void transform(QuaternionReadOnly quaternionOriginal, QuaternionBasics quaternionTransformed)
quaternionOriginal
and stores the result into
quaternionTransformed
.
quaternionToTransform = Q(this.getRotationMatrix()) * quaternionToTransform
where Q(this.getRotationMatrix()) is the equivalent quaternion for the rotation part of this
rotation-scale matrix.
quaternionOriginal
- the quaternion to transform. Not modified.quaternionTransformed
- the quaternion in which the result is stored. Modified.default void transform(Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
vectorOriginal
and stores the result
into vectorTransformed
.
vectorTransformed.s = vectorOriginal.s
vectorTransformed.xyz = this * vectorOriginal.xyz
transform
in interface Matrix3DReadOnly
vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.default void transform(RotationMatrix matrixToTransform)
matrixToTransform = this.getRotationMatrix() * matrixToTransform
matrixToTransform
- the rotation matrix to transform. Modified.default void transform(RotationMatrixReadOnly matrixOriginal, RotationMatrix matrixTransformed)
matrixOriginal
by the rotation part of this
rotation-scale matrix and stores the result in matrixTransformed
.
matrixTransformed = this.getRotationMatrix() * matrixOriginal
matrixOriginal
- the rotation matrix to transform. Not modified.matrixTransformed
- the rotation matrix in which the result is stored. Modified.default void transform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
by this matrix and stores the result in
matrixTransformed
.
matrixTransformed = this * matrixOriginal * this-1
transform
in interface Matrix3DReadOnly
matrixOriginal
- the matrix to transform. Not modified.matrixTransformed
- the matrix in which the result is stored. Modified.default void inverseTransform(Tuple3DReadOnly tupleOriginal, Tuple3DBasics tupleTransformed)
tupleOriginal
by this matrix and
stores the result in tupleTransformed
.
tupleTransformed = this-1 * tupleOriginal
inverseTransform
in interface Matrix3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.default void inverseTransform(Tuple2DReadOnly tupleOriginal, Tuple2DBasics tupleTransformed, boolean checkIfTransformInXYPlane)
tupleOriginal
by this matrix and
stores the result in tupleTransformed
.
tupleTransformed = this-1 * tupleOriginal
inverseTransform
in interface Matrix3DReadOnly
tupleOriginal
- the tuple to transform. Not modified.tupleTransformed
- the tuple in which the result is stored. Modified.checkIfTransformInXYPlane
- whether this method should assert that this matrix represents a
transformation in the XY plane.default void inverseTransform(QuaternionBasics quaternionToTransform)
quaternionToTransform = Q(this.getRotationMatrix()-1) * quaternionToTransform
where Q(this.getRotationMatrix()-1) is the equivalent quaternion for the inverse of
the rotation part of this rotation-scale matrix.
This operation uses the property:
q-1 = conjugate(q)
of a quaternion preventing to actually compute the inverse of the matrix.
quaternionToTransform
- the quaternion to transform. Modified.default void inverseTransform(QuaternionReadOnly quaternionOriginal, QuaternionBasics quaternionTransformed)
quaternionOriginal
and
stores the result into quaternionTransformed
.
quaternionToTransform = Q(this.getRotationMatrix()-1) * quaternionToTransform
where Q(this.getRotationMatrix()-1) is the equivalent quaternion for the inverse of
the rotation part of this rotation-scale matrix.
This operation uses the property:
q-1 = conjugate(q)
of a quaternion preventing to actually compute the inverse of the matrix.
quaternionOriginal
- the quaternion to transform. Not modified.quaternionTransformed
- the quaternion in which the result is stored. Modified.default void inverseTransform(Vector4DReadOnly vectorOriginal, Vector4DBasics vectorTransformed)
vectorOriginal
by this matrix and stores the result in vectorTransformed
.
vectorTransformed.s = vectorOriginal.s
vectorTransformed.xyz = this-1 * vectorOriginal.xyz
inverseTransform
in interface Matrix3DReadOnly
vectorOriginal
- the vector to transform. Not modified.vectorTransformed
- the vector in which the result is stored. Modified.default void inverseTransform(RotationMatrix matrixToTransform)
matrixToTransform = this.getRotationMatrix()-1 * matrixToTransform
This operation uses the property:
R-1 = RT
of a rotation matrix preventing to actually compute the inverse of the matrix.
matrixToTransform
- the rotation matrix to transform. Modified.default void inverseTransform(RotationMatrixReadOnly matrixOriginal, RotationMatrix matrixTransformed)
matrixOriginal
by the rotation part of this
rotation-scale matrix and stores the result in matrixTransformed
.
matrixTransformed = this.getRotationMatrix()-1 * matrixOriginal
This operation uses the property:
R-1 = RT
of a rotation matrix preventing to actually compute the inverse of the matrix.
matrixOriginal
- the rotation matrix to transform. Not modified.matrixTransformed
- the rotation matrix in which the result is stored. Modified.default void inverseTransform(Matrix3DReadOnly matrixOriginal, Matrix3D matrixTransformed)
matrixOriginal
by this
matrix and stores the result in matrixTransformed
.
matrixTransformed = this-1 * matrixOriginal * this-1
inverseTransform
in interface Matrix3DReadOnly
matrixOriginal
- the matrix to transform. Not modified.matrixTransformed
- the matrix in which the result is stored. Modified.default boolean epsilonEquals(RotationScaleMatrixReadOnly other, double epsilon)
epsilon
.other
- the other matrix to compare against this. Not modified.epsilon
- tolerance to use when comparing each component.true
if the two matrix are equal, false
otherwise.default boolean geometricallyEquals(RotationScaleMatrixReadOnly other, double epsilon)
this
and other
represent the same rotation-scale to an epsilon
.
Two rotation-scale matrices are considered geometrically equal if the their respective rotation matrices and scale vectors are geometrically equal.
Note that this.geometricallyEquals(other, epsilon) == true
does not necessarily imply
this.epsilonEquals(other, epsilon)
and vice versa.
other
- the other rotation-scale matrix to compare against this. Not modified.epsilon
- the threshold used when comparing the internal rotation and scale to
other
's rotation and scale.true
if the two rotation-scale matrices represent the same geometry,
false
otherwise.