maspack.matrix
Class ScaledRigidTransform3d

java.lang.Object
  extended by maspack.matrix.MatrixBase
      extended by maspack.matrix.DenseMatrixBase
          extended by maspack.matrix.AffineTransform3dBase
              extended by maspack.matrix.ScaledRigidTransform3d
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, DenseMatrix, LinearTransformNd, Matrix, Clonable

public class ScaledRigidTransform3d
extends AffineTransform3dBase
implements Clonable

A specialized 4 x 4 matrix that implements a three-dimensional rigid body transformation with scaling in homogeneous coordinates.

A rigid body transformation is used to transform a point from one spatial coordinate frame into another. If x0 and x1 denote the point in the orginal frame 0 and target frame 1, respectively, then the transformation is computed according to

 x1 = s R x0 + p
 
where R is a 3 x 3 rotation matrix and p is a translation vector. In homogenous coordinates, this operation can be represented as
 [ x1 ]   [ sR p ] [ x0 ]
 [    ] = [      ] [    ]
 [  1 ]   [ 0  1 ] [  1 ]
 

The inverse of such a transformation is given by by

         [  T      T    ]
  (-1)   [ R/s   -R p/s ]
 A     = [              ]
         [ 0      1     ]
 

In this class, the fields R, s, and p are exposed, and users can manipulate them as desired. For example, specifying a rotation using Euler angles would be done using the setEuler method in R. This allows us to minimize the number of methods in the RigidTransform3d class itself.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface maspack.matrix.Matrix
Matrix.Partition, Matrix.WriteFormat
 
Field Summary
static int AXIS_ANGLE_STRING
          Specifies a string representation of this transformation as an 8-tuple consisting of a translation vector followed by a rotation axis and the corresponding angle (in degrees) followed by the scale
static ScaledRigidTransform3d IDENTITY
          Global identity transform.
static int MATRIX_3X4_STRING
          Specifies a string representation of this transformation as a 3 x 4 matrix (i.e., with the 4th row ommitted).
static int MATRIX_4X4_STRING
          Specifies a string representation of this transformation as a 4 x 4 matrix.
 Vector3d p
          Translation vector associated with this transformation.
 RotationMatrix3d R
          Rotation matrix associated with this transformation.
 double s
          Scale factor associated with this transform
 
Fields inherited from interface maspack.matrix.Matrix
INDEFINITE, POSITIVE_DEFINITE, SPD, SYMMETRIC
 
Constructor Summary
ScaledRigidTransform3d()
          Creates a new transformation initialized to the identity.
ScaledRigidTransform3d(double px, double py, double pz)
          Creates a new transformation with the specified translation vector.
ScaledRigidTransform3d(double px, double py, double pz, double roll, double pitch, double yaw)
          Creates a new transformation with the specified translation and rotation.
ScaledRigidTransform3d(double px, double py, double pz, double ux, double uy, double uz, double ang)
          Creates a new transformation with the specified translation and rotation.
ScaledRigidTransform3d(ScaledRigidTransform3d X)
          Creates a new transformation which is a copy of an existing one.
ScaledRigidTransform3d(Vector3d p, AxisAngle axisAng)
          Creates a new transformation with the specified translation vector and rotation.
ScaledRigidTransform3d(Vector3d p, RotationMatrix3d R)
          Creates a new transformation with the specified translation vector and rotation matrix.
 
Method Summary
 ScaledRigidTransform3d clone()
           
 void fit(java.util.ArrayList<Point3d> p, java.util.ArrayList<Point3d> q)
          Sets this rigid transform to one that provides the best fit of q to p in the least-squares sense: p ~ X q
 RigidTransform3d getRigidPart(RigidTransform3d trans)
           
 void getRotation(RotationMatrix3d R)
           
 double getScale()
          Returns the scale factor
 boolean invert()
          Inverts this transform in place.
 boolean invert(ScaledRigidTransform3d X)
          Inverts transform X and places the result in this transform.
 void leftRigidFactor(AffineTransform3d XS, RigidTransform3d XR)
          Factors this affine transform into the product of a stretch-shear transform (with no translation) and a rigid transform:
 void mul(ScaledRigidTransform3d X)
          Post-multiplies this transformation by another and places the result in this transformation.
 void mul(ScaledRigidTransform3d X1, ScaledRigidTransform3d X2)
          Multiplies transformation X1 by X2 and places the result in this transformation.
 void mulAffineLeft(AffineTransform3dBase Xa, Matrix3d Sa)
          Premultiplies this transform by an affine transform, and places the rigid body component in this transform and the stretch and shear component in S.
 void mulAxisAngle(AxisAngle axisAng)
          Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, expressed as an axis-angle, and places the result in this transformation.
 void mulAxisAngle(double ux, double uy, double uz, double ang)
          Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, expressed as an axis-angle, and places the result in this transformation.
 void mulEuler(double phi, double theta, double psi)
          Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, expressed by Euler angles, and places the result in this transformation.
 void mulInverse(ScaledRigidTransform3d X)
          Post-multiplies this transformation by the inverse of transformation X and places the result in this transformation.
 boolean mulInverse(Vector4d vr, Vector4d v1)
          Multiplies the column vector v1 by the inverse of this transform and places the result in vr.
 void mulInverseBoth(ScaledRigidTransform3d X1, ScaledRigidTransform3d X2)
          Multiplies the inverse of transformation X1 by the inverse of transformation X2 and places the result in this transformation.
 void mulInverseLeft(ScaledRigidTransform3d X1, ScaledRigidTransform3d X2)
          Multiplies the inverse of transformation X1 by transformation X2 and places the result in this transformation.
 void mulInverseRight(ScaledRigidTransform3d X1, ScaledRigidTransform3d X2)
          Multiplies transformation X1 by the inverse of transformation X2 and places the result in this transformation.
 void mulRotation(RotationMatrix3d R2)
          Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, and places the result in this transformation.
 void mulRotX(double ang)
          Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation about the x axis, and places the result in this transformation.
 void mulRotY(double ang)
          Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation about the y axis, and places the result in this transformation.
 void mulRotZ(double ang)
          Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation about the z axis, and places the result in this transformation.
 void mulRpy(double roll, double pitch, double yaw)
          Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, expressed by roll-pitch-yaw angles, and places the result in this transformation.
 void mulXyz(double x, double y, double z)
          Post-multiplies this transformation by an implicit second transformation consisting of a pure translation, and places the result in this transformation.
 void scale(double s)
          Post-multiplies this transform by a uniform scaling transform: [ sI 0 ] [ 0 1 ]
 void scan(ReaderTokenizer rtok)
          Reads the contents of this transformation from a ReaderTokenizer.
 void setRandom()
          Sets the elements of this matrix to uniformly distributed random values in the range -0.5 (inclusive) to 0.5 (exclusive).
 void setRotation(AxisAngle axisAng)
          Sets the matrix component of this affine transform to an explicit rotation.
 void setRotation(Quaternion quat)
          Sets the matrix component of this affine transform to an explicit rotation.
 void setRotation(RotationMatrix3d R)
          Sets the matrix component of this affine transform to an explicit rotation.
 void setScale(double s)
          Sets the scale factor to use in this transform
 java.lang.String toString()
          Returns a string representation of this transformation as a 4 x 4 matrix.
 java.lang.String toString(NumberFormat numberFmt, int outputCode)
          Returns a specified string representation of this transformation, with each number formatted according to the a supplied numeric format.
 java.lang.String toString(java.lang.String numberFmtStr)
          Returns a string representation of this transformation as a 4 x 4 matrix, with each number formatted according to a supplied numeric format.
 java.lang.String toString(java.lang.String numberFmtStr, int outputCode)
          Returns a specified string representation of this transformation, with each number formatted according to the a supplied numeric format.
 void updateInternalMatrix()
           
 
Methods inherited from class maspack.matrix.AffineTransform3dBase
colSize, epsilonEquals, equals, get, get, getColumn, getColumn, getMatrix, getMatrixComponents, getOffset, getRow, getRow, isIdentity, mul, mul, mulInverse, rowSize, set, set, set, setColumn, setIdentity, setRow, setTranslation
 
Methods inherited from class maspack.matrix.DenseMatrixBase
add, checkConsistency, set, set, set, set, setCCSValues, setColumn, setCRSValues, setRow, setSubMatrix
 
Methods inherited from class maspack.matrix.MatrixBase
containsNaN, determinant, epsilonEquals, equals, frobeniusNorm, get, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getDefaultFormat, getRow, getSize, getSubMatrix, hasNaN, idString, infinityNorm, isFixedSize, isSymmetric, mul, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, oneNorm, setCRSValues, setDefaultFormat, setSize, toString, trace, write, write, write, write, write, writeToFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface maspack.matrix.Matrix
determinant, epsilonEquals, equals, frobeniusNorm, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getRow, getSize, getSubMatrix, infinityNorm, isFixedSize, isSymmetric, mul, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, oneNorm, setSize, toString, trace, write, write, write
 

Field Detail

AXIS_ANGLE_STRING

public static final int AXIS_ANGLE_STRING
Specifies a string representation of this transformation as an 8-tuple consisting of a translation vector followed by a rotation axis and the corresponding angle (in degrees) followed by the scale

See Also:
Constant Field Values

MATRIX_3X4_STRING

public static final int MATRIX_3X4_STRING
Specifies a string representation of this transformation as a 3 x 4 matrix (i.e., with the 4th row ommitted).

See Also:
Constant Field Values

MATRIX_4X4_STRING

public static final int MATRIX_4X4_STRING
Specifies a string representation of this transformation as a 4 x 4 matrix.

See Also:
Constant Field Values

R

public final RotationMatrix3d R
Rotation matrix associated with this transformation.


s

public double s
Scale factor associated with this transform


p

public final Vector3d p
Translation vector associated with this transformation.


IDENTITY

public static final ScaledRigidTransform3d IDENTITY
Global identity transform. Should not be modified.

Constructor Detail

ScaledRigidTransform3d

public ScaledRigidTransform3d()
Creates a new transformation initialized to the identity.


ScaledRigidTransform3d

public ScaledRigidTransform3d(Vector3d p,
                              RotationMatrix3d R)
Creates a new transformation with the specified translation vector and rotation matrix.

Parameters:
p - translation vector
R - rotation matrix

ScaledRigidTransform3d

public ScaledRigidTransform3d(double px,
                              double py,
                              double pz)
Creates a new transformation with the specified translation vector.

Parameters:
px - x translation coordinate
py - y translation coordinate
pz - z translation coordinate

ScaledRigidTransform3d

public ScaledRigidTransform3d(double px,
                              double py,
                              double pz,
                              double roll,
                              double pitch,
                              double yaw)
Creates a new transformation with the specified translation and rotation.

Parameters:
px - x translation coordinate
py - y translation coordinate
pz - z translation coordinate
roll - roll angle (rotation about z axis, radians)
pitch - pitch angle (rotation about new y axis, radians)
yaw - yaw angle (rotation about new x axis, radians)

ScaledRigidTransform3d

public ScaledRigidTransform3d(double px,
                              double py,
                              double pz,
                              double ux,
                              double uy,
                              double uz,
                              double ang)
Creates a new transformation with the specified translation and rotation.

Parameters:
px - x translation coordinate
py - y translation coordinate
pz - z translation coordinate
ux - x rotation axis coordinate
uy - y rotation axis coordinate
uz - z rotation axis coordinate
ang - angle of rotation about the axis (radians)

ScaledRigidTransform3d

public ScaledRigidTransform3d(ScaledRigidTransform3d X)
Creates a new transformation which is a copy of an existing one.

Parameters:
X - transform to copy

ScaledRigidTransform3d

public ScaledRigidTransform3d(Vector3d p,
                              AxisAngle axisAng)
Creates a new transformation with the specified translation vector and rotation.

Parameters:
p - translation vector
axisAng - axis-angle describing the rotation
Method Detail

mul

public void mul(ScaledRigidTransform3d X)
Post-multiplies this transformation by another and places the result in this transformation.

Parameters:
X - transformation to multiply by

mul

public void mul(ScaledRigidTransform3d X1,
                ScaledRigidTransform3d X2)
Multiplies transformation X1 by X2 and places the result in this transformation.

Parameters:
X1 - first transformation
X2 - second transformation

updateInternalMatrix

public void updateInternalMatrix()

mulInverse

public void mulInverse(ScaledRigidTransform3d X)
Post-multiplies this transformation by the inverse of transformation X and places the result in this transformation.

Parameters:
X - right-hand transformation

mulInverseRight

public void mulInverseRight(ScaledRigidTransform3d X1,
                            ScaledRigidTransform3d X2)
Multiplies transformation X1 by the inverse of transformation X2 and places the result in this transformation.

Parameters:
X1 - left-hand transformation
X2 - right-hand transformation

mulInverseLeft

public void mulInverseLeft(ScaledRigidTransform3d X1,
                           ScaledRigidTransform3d X2)
Multiplies the inverse of transformation X1 by transformation X2 and places the result in this transformation.

Parameters:
X1 - left-hand transformation
X2 - right-hand transformation

mulInverseBoth

public void mulInverseBoth(ScaledRigidTransform3d X1,
                           ScaledRigidTransform3d X2)
Multiplies the inverse of transformation X1 by the inverse of transformation X2 and places the result in this transformation.

Parameters:
X1 - left-hand transformation
X2 - right-hand transformation

mulXyz

public void mulXyz(double x,
                   double y,
                   double z)
Post-multiplies this transformation by an implicit second transformation consisting of a pure translation, and places the result in this transformation. If p2 is the translation vector of the second transformation, then this is the equivalent of adding R p2 to this transformations translation vector.

Parameters:
x - translation component of the second transformation
y - translation component of the second transformation
z - translation component of the second transformation

mulRotX

public void mulRotX(double ang)
Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation about the x axis, and places the result in this transformation. If R2 is the rotation matrix of the second transformation, then this is the equivalent of multiplying R by R2.

Parameters:
ang - rotation about the x axis (in radians) for the second transform

mulRotY

public void mulRotY(double ang)
Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation about the y axis, and places the result in this transformation. If R2 is the rotation matrix of the second transformation, then this is the equivalent of multiplying R by R2.

Parameters:
ang - rotation about the y axis (in radians) for the second transform

mulRotZ

public void mulRotZ(double ang)
Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation about the z axis, and places the result in this transformation. If R2 is the rotation matrix of the second transformation, then this is the equivalent of multiplying R by R2.

Parameters:
ang - rotation about the z axis (in radians) for the second transform

mulAxisAngle

public void mulAxisAngle(double ux,
                         double uy,
                         double uz,
                         double ang)
Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, expressed as an axis-angle, and places the result in this transformation. If R2 is the rotation matrix of the second transformation, then this is the equivalent of multiplying R by R2.

Parameters:
ux - rotation axis x component
uy - rotation axis y component
uz - rotation axis z component
ang - rotation angle (in radians)

mulAxisAngle

public void mulAxisAngle(AxisAngle axisAng)
Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, expressed as an axis-angle, and places the result in this transformation. If R2 is the rotation matrix of the second transformation, then this is the equivalent of multiplying R by R2.

Parameters:
axisAng - axis-angle representation of the rotation

mulRotation

public void mulRotation(RotationMatrix3d R2)
Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, and places the result in this transformation. If R2 is the rotation matrix of the second transformation, then this is the equivalent of multiplying R by R2.

Parameters:
R2 - rotation for the second transformation

mulRpy

public void mulRpy(double roll,
                   double pitch,
                   double yaw)
Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, expressed by roll-pitch-yaw angles, and places the result in this transformation. If R2 is the rotation matrix of the second transformation, then this is the equivalent of multiplying R by R2. See RotationMatrix3d.setRpy for a description of roll-pitch-yaw angles.

Parameters:
roll - first angle (radians)
pitch - second angle (radians)
yaw - third angle (radians)

mulEuler

public void mulEuler(double phi,
                     double theta,
                     double psi)
Post-multiplies this transformation by an implicit second transformation consisting of a pure rotation, expressed by Euler angles, and places the result in this transformation. If R2 is the rotation matrix of the second transformation, then this is the equivalent of multiplying R by R2. See RotationMatrix3d.setEuler for a complete description of Euler angles.

Parameters:
phi - first Euler angle (radians)
theta - second Euler angle (radians)
psi - third Euler angle (radians)

mulInverse

public boolean mulInverse(Vector4d vr,
                          Vector4d v1)
Multiplies the column vector v1 by the inverse of this transform and places the result in vr.

Overrides:
mulInverse in class AffineTransform3dBase
Parameters:
vr - result vector
v1 - vector to multiply
Returns:
false if this transform is singular

invert

public boolean invert()
Inverts this transform in place.

Overrides:
invert in class AffineTransform3dBase
Returns:
true (transform is never singular)

invert

public boolean invert(ScaledRigidTransform3d X)
Inverts transform X and places the result in this transform.

Parameters:
X - transform to invert
Returns:
true (transform is never singular)

toString

public java.lang.String toString()
Returns a string representation of this transformation as a 4 x 4 matrix.

Overrides:
toString in class MatrixBase
Returns:
String representation of this matrix
See Also:
MatrixBase.toString(String)

toString

public java.lang.String toString(java.lang.String numberFmtStr)
Returns a string representation of this transformation as a 4 x 4 matrix, with each number formatted according to a supplied numeric format.

Overrides:
toString in class MatrixBase
Parameters:
numberFmtStr - numeric format string (see NumberFormat)
Returns:
String representation of this vector

toString

public java.lang.String toString(java.lang.String numberFmtStr,
                                 int outputCode)
Returns a specified string representation of this transformation, with each number formatted according to the a supplied numeric format.

Parameters:
numberFmtStr - numeric format string (see NumberFormat)
outputCode - desired representation, which should be either AXIS_ANGLE_STRING, MATRIX_4X4_STRING, or MATRIX_3X4_STRING

toString

public java.lang.String toString(NumberFormat numberFmt,
                                 int outputCode)
Returns a specified string representation of this transformation, with each number formatted according to the a supplied numeric format.

Parameters:
numberFmt - numeric format
outputCode - desired representation, which should be either AXIS_ANGLE_STRING, MATRIX_4X4_STRING, or MATRIX_3X4_STRING

mulAffineLeft

public void mulAffineLeft(AffineTransform3dBase Xa,
                          Matrix3d Sa)
Premultiplies this transform by an affine transform, and places the rigid body component in this transform and the stretch and shear component in S. More specifically, let this transform be originally described by
        [s0 R0  p0  ]
 this = [           ]
        [   0    1  ]
 
and the affine transform be described by
        [  A   pa  ]     [  Sa Ra   pa  ]
 Xa =   [          ]  =  [              ]
        [  0    1  ]     [    0      1  ]
 
where the A component of Xa is factored into Sa Ra using a left polar decomposition with sign adjustment to ensure that Ra is right-handed. Then we form the product
           [  s0 Sa Ra R0   Sa Ra p0 + pa  ]
 Xa this = [                               ]
           [      0               1        ]
 
and then set the rotation and translation of this transform to Ra R0 and Sa Ra p0 + pa. This transform's scale, s0, remains unchanged.

Parameters:
Xa - affine transform to pre-multiply this transform by
Sa - optional argument to return stretch and shear.

leftRigidFactor

public void leftRigidFactor(AffineTransform3d XS,
                            RigidTransform3d XR)
Factors this affine transform into the product of a stretch-shear transform (with no translation) and a rigid transform:
    this = XS XR
 

Overrides:
leftRigidFactor in class AffineTransform3dBase
Parameters:
XS - returns the stretch-shear transform (optional argument)
XR - returns the rigid transform (optional argument)

scan

public void scan(ReaderTokenizer rtok)
          throws java.io.IOException
Reads the contents of this transformation from a ReaderTokenizer. There are four allowed formats, each of which is delimited by square brackets.

The first format is a set of 8 numbers in which the first three numbers give the x, y, and z coordinates of the translation vector, the next three numbers give the x, y, and z coordinates of a rotation axis, and the next number gives a rotation angle, in degrees, about that axis, and the final number gives the scale factor. For example,

 [ 10 20 30  0 1 0 90  2.0]
 
defines a transformation with a translation of (10, 20, 30), a rotation of 90 degrees about the y axis, and a scale of 2.0

The second format format is a set of 12 numbers describing the first three rows of the transformation matrix in row-major order. For example,

 [ 0  -1  0  10 
   1   0  0  20
   0   0  1  20 ]
 
defines a transformation with a translation of (10,20, 30) and a rotation of 90 degrees about the z axis.

The third format is a set of 16 numbers describing all elements of the transformation matrix in row-major order. The last four numbers, which represent the fourth row, are actually ignored and instead assumed to be 0, 0, 0, 1, in keeping with the structure of the transformation matrix. A transformation with a translation of (30, 40, 50) and a rotation of 180 degrees about the x axis would be represented as

 [  1  0  0  30
    0 -1  0  40
    0  0 -1  50 
    0  0  0  1 ]
 

The fourth format consists of a series of simple translational or rotational transformation, which are the multiplied together to form the final transformation. The following simple transformations may be specified:

trans x y z
A translation with the indicated x, y, and z values;
rotX ang
A rotation of "ang" degrees about the x axis;
rotY ang
A rotation of "ang" degrees about the y axis;
rotZ ang
A rotation of "ang" degrees about the z axis;
rotAxis x y z ang
A rotation of "ang" degrees about an arbitrary axis parallel to x, y, and z.
scale s
A scale of s
For example, the string
 [ rotX 45 trans 0 0 100 rot 1 1 0 90 scale 2]
 
describes a transformation which the product of a rotation of 45 degrees about the y axis, a translation of 100 units along the z axis, a rotation of 90 degrees about the axis (1, 1, 0), and s scaling of 2

Specified by:
scan in interface Matrix
Overrides:
scan in class MatrixBase
Parameters:
rtok - ReaderTokenizer from which to read the transformation. Number Parsing should be enabled
Throws:
java.io.IOException - if an I/O error occured or if the transformation description is not consistent with one of the above formats.

setRandom

public void setRandom()
Description copied from class: MatrixBase
Sets the elements of this matrix to uniformly distributed random values in the range -0.5 (inclusive) to 0.5 (exclusive).


getScale

public double getScale()
Returns the scale factor


setScale

public void setScale(double s)
Sets the scale factor to use in this transform

Parameters:
s -

scale

public void scale(double s)
Post-multiplies this transform by a uniform scaling transform: [ sI 0 ] [ 0 1 ]

Parameters:
s -

setRotation

public void setRotation(AxisAngle axisAng)
Description copied from class: AffineTransform3dBase
Sets the matrix component of this affine transform to an explicit rotation.

Overrides:
setRotation in class AffineTransform3dBase
Parameters:
axisAng - axis-angle describing the rotation

setRotation

public void setRotation(Quaternion quat)
Description copied from class: AffineTransform3dBase
Sets the matrix component of this affine transform to an explicit rotation.

Overrides:
setRotation in class AffineTransform3dBase
Parameters:
quat - quaternion describing the rotation

setRotation

public void setRotation(RotationMatrix3d R)
Description copied from class: AffineTransform3dBase
Sets the matrix component of this affine transform to an explicit rotation.

Overrides:
setRotation in class AffineTransform3dBase
Parameters:
R - rotation matrix

getRotation

public void getRotation(RotationMatrix3d R)

clone

public ScaledRigidTransform3d clone()
Specified by:
clone in interface Clonable
Overrides:
clone in class AffineTransform3dBase

fit

public void fit(java.util.ArrayList<Point3d> p,
                java.util.ArrayList<Point3d> q)
         throws ImproperSizeException
Sets this rigid transform to one that provides the best fit of q to p in the least-squares sense: p ~ X q

Parameters:
p - set of target 3d points
q - set of input 3d points
Throws:
ImproperSizeException

getRigidPart

public RigidTransform3d getRigidPart(RigidTransform3d trans)