public abstract class AffineTransform3dBase extends DenseMatrixBase implements VectorTransformer3d, java.io.Serializable
[ A p ] M = [ ] [ 0 1 ]
Matrix.Partition, Matrix.WriteFormat
INDEFINITE, POSITIVE_DEFINITE, SPD, SYMMETRIC
Constructor and Description |
---|
AffineTransform3dBase() |
Modifier and Type | Method and Description |
---|---|
void |
addTranslation(double tx,
double ty,
double tz)
Sets the translation component of this affine transform.
|
void |
addTranslation(Vector3d p)
Sets the translation component of this affine transform.
|
AffineTransform3dBase |
clone() |
int |
colSize()
Returns the number of columns in this matrix (which is always 4).
|
abstract AffineTransform3dBase |
copy()
Creates and returns a copy of this transformer.
|
boolean |
epsilonEquals(AffineTransform3dBase X,
double epsilon)
Returns true if the elements of this transformation equal those of
transform
X1 within a prescribed tolerance
epsilon . |
boolean |
equals(AffineTransform3dBase X)
Returns true if the elements of this transformation exactly equal those of
transform
X1 . |
void |
get(double[] values)
Copies the elements of this matrix into an array of doubles.
|
double |
get(int i,
int j)
Gets a single element of this matrix.
|
void |
getColumn(int j,
double[] values)
Copies a column of this matrix into an array of doubles.
|
void |
getColumn(int j,
double[] values,
int off)
Copies a column of this matrix into an array of doubles, starting at a
specified offset.
|
Matrix3dBase |
getMatrix()
Returns the matrix assiciated with this affine transform.
|
void |
getMatrixComponents(RotationMatrix3d R,
Vector3d s,
Matrix3d X)
Returns the shear, scaling, and rotational components of this
AffineTransform.
|
Vector3d |
getOffset()
Returns the offset vector assiciated with this affine transform.
|
void |
getRow(int i,
double[] values)
Copies a row of this matrix into an array of doubles.
|
void |
getRow(int i,
double[] values,
int off)
Copies a row of this matrix into an array of doubles, starting at a
specified offset.
|
void |
inverseTransformCovec(Vector3d nr,
Vector3d n0)
Applies an inverse transform to covector
c0 and places the
result in cr . |
void |
inverseTransformPnt(Vector3d pr,
Vector3d p0)
Applies an inverse transform to point
p0 and places the
result in pr . |
void |
inverseTransformVec(Vector3d vr,
Vector3d v0)
Applies an inverse transform to vector
v0 and places the
result in vr . |
boolean |
invert()
Inverts this transform in place.
|
boolean |
isAffine()
Returns
true if this transformer implements a linear affine
transform. |
boolean |
isIdentity()
Returns true if this transform equals the identity.
|
boolean |
isRigid()
Returns
true if this transformer implements a linear
rigid transform. |
void |
mul(RigidTransform3d X2) |
void |
mul(Vector4d vr)
Multiplies the column vector vr by this transform and places the result
back in vr.
|
void |
mul(Vector4d vr,
Vector4d v1)
Multiplies the column vector v1 by this transform and places the result in
vr.
|
void |
mulInverse(RigidTransform3d T)
Post-multiplies this transformation by the inverse of the rigid
transformation T and places the result in this transformation.
|
boolean |
mulInverse(Vector4d vr)
Multiplies the column vector vr by the inverse of this transform and
places the result back in vr.
|
boolean |
mulInverse(Vector4d vr,
Vector4d v1)
Multiplies the column vector v1 by the inverse of this transform and
places the result in vr.
|
void |
mulInverseLeft(RigidTransform3d T1,
AffineTransform3dBase X2)
Multiplies the inverse of the rigid transformation T1 by the
transformation X2 and places the result in this transformation.
|
void |
mulInverseRight(AffineTransform3dBase X1,
RigidTransform3d T2)
Multiplies transformation X1 by the inverse of the rigid transformation
T2 and places the result in this transformation.
|
int |
rowSize()
Returns the number of rows in this matrix (which is always 4).
|
void |
set(AffineTransform3dBase A) |
void |
set(double[] vals)
Sets the elements of this matrix from an array of doubles.
|
void |
set(int i,
int j,
double value)
Sets a single element of this matrix.
|
void |
setColumn(int j,
double[] values)
Sets a column of this matrix from an array of doubles.
|
void |
setIdentity()
Sets the transformation to the identity.
|
abstract 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 |
setRow(int i,
double[] values)
Set a row of this matrix from an array of doubles.
|
void |
setTranslation(double tx,
double ty,
double tz)
Sets the translation component of this affine transform.
|
void |
setTranslation(Vector3d p)
Sets the translation component of this affine transform.
|
void |
transformCovec(Vector3d nr,
Vector3d n0)
Transforms a covector
c0 and places the result in
cr . |
void |
transformPnt(Vector3d pr,
Vector3d p0)
Transforms point
p0 and places the result in
pr . |
void |
transformVec(Vector3d vr,
Vector3d v0)
Transforms vector
v0 and places the result in
vr . |
add, checkConsistency, set, set, set, set, setCCSValues, setColumn, setCRSValues, setRow, setSubMatrix
containsNaN, determinant, epsilonEquals, equals, frobeniusNorm, frobeniusNormSquared, get, getCCSIndices, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getCRSValues, getDefaultFormat, getRow, getSize, getSubMatrix, hasNaN, idString, infinityNorm, isFixedSize, isSymmetric, isWritable, maxNorm, mul, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, oneNorm, scan, scan, setCRSValues, setDefaultFormat, setSize, toString, toString, toString, trace, write, write, write, write, write, write, write, writeToFile
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
toString
determinant, epsilonEquals, equals, frobeniusNorm, frobeniusNormSquared, getCCSIndices, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getCRSValues, getRow, getSize, getSubMatrix, infinityNorm, isFixedSize, isSymmetric, maxNorm, mul, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, oneNorm, scan, setSize, toString, toString, trace, write, write, write
public Matrix3dBase getMatrix()
public Vector3d getOffset()
public int colSize()
colSize
in interface LinearTransformNd
colSize
in interface Matrix
colSize
in class MatrixBase
public int rowSize()
rowSize
in interface LinearTransformNd
rowSize
in interface Matrix
rowSize
in class MatrixBase
public double get(int i, int j)
get
in interface Matrix
get
in class MatrixBase
i
- element row indexj
- element column indexpublic void get(double[] values)
(i,j)
is
stored at location i*colSize()+j
.get
in interface Matrix
get
in class MatrixBase
values
- array into which values are copiedpublic void getColumn(int j, double[] values)
getColumn
in interface Matrix
getColumn
in class MatrixBase
j
- column indexvalues
- array into which the column is copiedpublic void getColumn(int j, double[] values, int off)
getColumn
in interface Matrix
getColumn
in class MatrixBase
j
- column indexvalues
- array into which the column is copiedoff
- offset in values where copying should beginpublic void getRow(int i, double[] values)
getRow
in interface Matrix
getRow
in class MatrixBase
i
- row indexvalues
- array into which the row is copiedpublic void getRow(int i, double[] values, int off)
getRow
in interface Matrix
getRow
in class MatrixBase
i
- row indexvalues
- array into which the row is copiedoff
- offset in values where copying should beginpublic void set(AffineTransform3dBase A)
public void set(int i, int j, double value)
set
in interface DenseMatrix
set
in class DenseMatrixBase
i
- element row indexj
- element column indexvalue
- element valuepublic void set(double[] vals)
(i,j)
is stored at location i*colSize()+j
.set
in interface DenseMatrix
set
in class DenseMatrixBase
vals
- array from which values are copiedpublic void setColumn(int j, double[] values)
setColumn
in interface DenseMatrix
setColumn
in class DenseMatrixBase
j
- column indexvalues
- array from which column values are copiedpublic void setRow(int i, double[] values)
setRow
in interface DenseMatrix
setRow
in class DenseMatrixBase
i
- row indexvalues
- array from which the row is copiedpublic void setTranslation(Vector3d p)
p
- translation vectorpublic void addTranslation(Vector3d p)
p
- translation vectorpublic void setTranslation(double tx, double ty, double tz)
tx
- x-component of translationty
- y-component of translationtz
- z-component of translationpublic void addTranslation(double tx, double ty, double tz)
tx
- x-component of translationty
- y-component of translationtz
- z-component of translationpublic void setRotation(AxisAngle axisAng)
axisAng
- axis-angle describing the rotationpublic void setRotation(Quaternion quat)
quat
- quaternion describing the rotationpublic void setRotation(RotationMatrix3d R)
R
- rotation matrixpublic void setIdentity()
public void mulInverse(RigidTransform3d T)
T
- right-hand rigid transformationpublic void mulInverseRight(AffineTransform3dBase X1, RigidTransform3d T2)
X1
- left-hand transformationT2
- right-hand rigid transformationpublic void mulInverseLeft(RigidTransform3d T1, AffineTransform3dBase X2)
T1
- left-hand rigid transformationX2
- right-hand transformationpublic void mul(Vector4d vr, Vector4d v1)
vr
- result vectorv1
- vector to multiplypublic void mul(Vector4d vr)
vr
- vector to multiply (in place)public void mul(RigidTransform3d X2)
public boolean mulInverse(Vector4d vr, Vector4d v1)
vr
- result vectorv1
- vector to multiplypublic boolean mulInverse(Vector4d vr)
vr
- vector to multiply (in place)public boolean invert()
public boolean epsilonEquals(AffineTransform3dBase X, double epsilon)
X1
within a prescribed tolerance
epsilon
.X
- transform to compare withepsilon
- comparison tolerancepublic boolean equals(AffineTransform3dBase X)
X1
.X
- transform to compare withpublic void getMatrixComponents(RotationMatrix3d R, Vector3d s, Matrix3d X)
M = U S V'The rotation is then set to U, the scale factors are set to the diagonal elements of S, and the shear is set to U'.
R
- returns the rotation matrixs
- returns the three scaling factorsX
- returns the shearing transformpublic void transformPnt(Vector3d pr, Vector3d p0)
p0
and places the result in
pr
.transformPnt
in interface VectorTransformer3d
pr
- returns the transformed pointp0
- point to be transformedpublic void transformVec(Vector3d vr, Vector3d v0)
v0
and places the result in
vr
.transformVec
in interface VectorTransformer3d
vr
- returns the transformed vectorv0
- vector to be transformedpublic void transformCovec(Vector3d nr, Vector3d n0)
c0
and places the result in
cr
. If a vector is transformed linearly according to
vr = A v0,then the covector will be transformed according to
-1 T cr = A c0,Normal vectors and gradients are generally transformed as covectors. In the case of normals, the application will need to normalize the result if this transformation is not rigid.
transformCovec
in interface VectorTransformer3d
nr
- returns the transformed covectorn0
- normal to be transformedpublic void inverseTransformPnt(Vector3d pr, Vector3d p0)
p0
and places the
result in pr
.inverseTransformPnt
in interface VectorTransformer3d
pr
- returns the transformed pointp0
- point to be transformedpublic void inverseTransformVec(Vector3d vr, Vector3d v0)
v0
and places the
result in vr
.inverseTransformVec
in interface VectorTransformer3d
vr
- returns the transformed vectorv0
- vector to be transformedpublic void inverseTransformCovec(Vector3d nr, Vector3d n0)
c0
and places the
result in cr
. See VectorTransformer3d.transformCovec(maspack.matrix.Vector3d, maspack.matrix.Vector3d)
for more
details about covector transformation.inverseTransformCovec
in interface VectorTransformer3d
nr
- returns the transformed normaln0
- normal to be transformedpublic boolean isAffine()
true
if this transformer implements a linear affine
transform.isAffine
in interface VectorTransformer3d
public boolean isRigid()
true
if this transformer implements a linear
rigid transform.isRigid
in interface VectorTransformer3d
public boolean isIdentity()
public abstract void setRandom()
DenseMatrixBase
setRandom
in class DenseMatrixBase
public abstract AffineTransform3dBase copy()
VectorTransformer3d
copy
in interface VectorTransformer3d
public AffineTransform3dBase clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException