|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.matrix.MatrixBase
maspack.matrix.DenseMatrixBase
maspack.matrix.AffineTransform2dBase
maspack.matrix.AffineTransform2d
public class AffineTransform2d
A 3 x 3 matrix which implements general 2D affine transformations. The matrix has the specific form
[ A p ] M = [ ] [ 0 1 ]where A is a 2 x 2 matrix and p is a 2-vector. In homogeneous coordinates, this implements an affine transform of the form
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface maspack.matrix.Matrix |
---|
Matrix.Partition, Matrix.WriteFormat |
Field Summary | |
---|---|
Matrix2d |
A
Matrix component. |
static AffineTransform2d |
IDENTITY
Global identity transform. |
Vector2d |
p
Vector component. |
Fields inherited from interface maspack.matrix.Matrix |
---|
INDEFINITE, POSITIVE_DEFINITE, SPD, SYMMETRIC |
Constructor Summary | |
---|---|
AffineTransform2d()
Creates an AffineTransform2d and initializes it to the identity. |
|
AffineTransform2d(Vector2d p,
Matrix2d A)
Creates an AffineTransform2d and initializes its components to the specified values. |
Method Summary | |
---|---|
void |
fit(java.util.ArrayList<Point2d> p,
java.util.ArrayList<Point2d> q)
Sets this affine transform to one that provides the best fit of q to p in the least-squares sense: p ~ X q |
boolean |
invert()
Inverts this transform in place. |
boolean |
invert(AffineTransform2dBase X)
Inverts transform X and places the result in this transform. |
void |
mul(AffineTransform2dBase X)
Multiplies this transformation transformation X and places the result in this transformation. |
void |
mul(AffineTransform2dBase X1,
AffineTransform2dBase X2)
Multiplies transformation X1 by transformation X2 and places the result in this transformation. |
boolean |
mulInverse(AffineTransform2dBase X)
Multiplies this transformation by the inverse of transformation X and places the result in this transformation. |
boolean |
mulInverseBoth(AffineTransform2dBase X1,
AffineTransform2dBase X2)
Multiplies the inverse of transformation X1 by the inverse of transformation X2 and places the result in this transformation. |
boolean |
mulInverseLeft(AffineTransform2dBase X1,
AffineTransform2dBase X2)
Multiplies the inverse of transformation X1 by transformation X2 and places the result in this transformation. |
boolean |
mulInverseRight(AffineTransform2dBase X1,
AffineTransform2dBase X2)
Multiplies transformation X1 by the inverse of transformation X2 and places the result in this transformation. |
void |
set(RigidTransform2d X)
Sets this affine transform to the rigid body transform described by X. |
void |
setRandom()
Sets the elements of this matrix to uniformly distributed random values in the range -0.5 (inclusive) to 0.5 (exclusive). |
Methods inherited from class maspack.matrix.AffineTransform2dBase |
---|
colSize, epsilonEquals, equals, get, get, getColumn, getColumn, getRow, getRow, mul, mul, mulInverse, mulInverse, rowSize, set, set, setColumn, setIdentity, setRow |
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, scan, setCRSValues, setDefaultFormat, setSize, toString, toString, 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, scan, setSize, toString, trace, write, write, write |
Field Detail |
---|
public static final AffineTransform2d IDENTITY
public final Matrix2d A
public final Vector2d p
Constructor Detail |
---|
public AffineTransform2d()
public AffineTransform2d(Vector2d p, Matrix2d A)
A
- value for the A matrixp
- value for the p vectorMethod Detail |
---|
public void mul(AffineTransform2dBase X)
X
- right-hand transformationpublic void mul(AffineTransform2dBase X1, AffineTransform2dBase X2)
X1
- left-hand transformationX2
- right-hand transformationpublic boolean mulInverse(AffineTransform2dBase X)
X
- right-hand transformation
public boolean mulInverseRight(AffineTransform2dBase X1, AffineTransform2dBase X2)
X1
- left-hand transformationX2
- right-hand transformation
public boolean mulInverseLeft(AffineTransform2dBase X1, AffineTransform2dBase X2)
X1
- left-hand transformationX2
- right-hand transformation
public boolean mulInverseBoth(AffineTransform2dBase X1, AffineTransform2dBase X2)
X1
- left-hand transformationX2
- right-hand transformation
public boolean invert()
invert
in class AffineTransform2dBase
public boolean invert(AffineTransform2dBase X)
X
- transform to invert
public void set(RigidTransform2d X)
set
in class AffineTransform2dBase
X
- rigid body transform to copypublic void fit(java.util.ArrayList<Point2d> p, java.util.ArrayList<Point2d> q) throws ImproperSizeException
p
- set of target 2d pointsq
- set of input 2d points
ImproperSizeException
public void setRandom()
MatrixBase
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |