maspack.matrix
Class RotationMatrix2d
java.lang.Object
maspack.matrix.MatrixBase
maspack.matrix.DenseMatrixBase
maspack.matrix.Matrix2dBase
maspack.matrix.RotationMatrix2d
- All Implemented Interfaces:
- java.lang.Cloneable, DenseMatrix, LinearTransformNd, Matrix, Clonable
public class RotationMatrix2d
- extends Matrix2dBase
Method Summary |
double |
getAngle()
|
void |
inverseTransform(Vector2d vr)
|
void |
inverseTransform(Vector2d vr,
Vector2d v1)
|
boolean |
invert()
Inverts this matrix in place, returning false if the matrix is detected to
be singular. |
boolean |
invert(RotationMatrix2d r1)
|
void |
mul(RotationMatrix2d r1)
|
void |
mul(RotationMatrix2d r1,
RotationMatrix2d r2)
|
void |
mulAngle(double ang)
|
void |
mulInverse(RotationMatrix2d r1)
|
boolean |
mulInverse(Vector2d vr)
Multiplies the column vector vr by the inverse of this matrix and places
the result back in vr. |
boolean |
mulInverse(Vector2d vr,
Vector2d v1)
Multiplies the column vector v1 by the inverse of this matrix and places
the result in vr. |
void |
mulInverseBoth(RotationMatrix2d r1,
RotationMatrix2d r2)
|
void |
mulInverseLeft(RotationMatrix2d r1,
RotationMatrix2d r2)
|
void |
mulInverseRight(RotationMatrix2d r1,
RotationMatrix2d r2)
|
boolean |
mulInverseTranspose(Vector2d vr)
Multiplies vector vr by the inverse transpose of this matrix, in place. |
boolean |
mulInverseTranspose(Vector2d vr,
Vector2d v1)
Multiplies the column vector v1 by the inverse transpose of this matrix
and places the result in vr. |
void |
setAngle(double ang)
|
void |
setRandom()
Sets the elements of this matrix to uniformly distributed random values in
the range -0.5 (inclusive) to 0.5 (exclusive). |
void |
setRandom(java.util.Random generator)
|
void |
transform(Vector2d vr)
|
void |
transform(Vector2d vr,
Vector2d v1)
|
Methods inherited from class maspack.matrix.Matrix2dBase |
clone, colSize, determinant, epsilonEquals, equals, frobeniusNorm, get, get, getColumn, getColumn, getColumn, getRow, getRow, getRow, infinityNorm, mul, mul, mul, mulAdd, mulTranspose, mulTranspose, negate, oneNorm, rowSize, set, set, set, set, setColumn, setColumn, setIdentity, setRow, setRow, transpose |
Methods inherited from class maspack.matrix.MatrixBase |
containsNaN, epsilonEquals, equals, get, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getDefaultFormat, getRow, getSize, getSubMatrix, hasNaN, idString, isFixedSize, isSymmetric, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, 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 |
epsilonEquals, equals, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getRow, getSize, getSubMatrix, isFixedSize, isSymmetric, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, numNonZeroVals, numNonZeroVals, scan, setSize, toString, trace, write, write, write |
IDENTITY
public static final RotationMatrix2d IDENTITY
- Global identity rotation. Should not be modified.
RotationMatrix2d
public RotationMatrix2d()
RotationMatrix2d
public RotationMatrix2d(double ang)
RotationMatrix2d
public RotationMatrix2d(RotationMatrix2d R)
mul
public void mul(RotationMatrix2d r1)
mul
public void mul(RotationMatrix2d r1,
RotationMatrix2d r2)
mulInverse
public void mulInverse(RotationMatrix2d r1)
mulInverseLeft
public void mulInverseLeft(RotationMatrix2d r1,
RotationMatrix2d r2)
mulInverseRight
public void mulInverseRight(RotationMatrix2d r1,
RotationMatrix2d r2)
mulInverseBoth
public void mulInverseBoth(RotationMatrix2d r1,
RotationMatrix2d r2)
mulInverse
public boolean mulInverse(Vector2d vr,
Vector2d v1)
- Multiplies the column vector v1 by the inverse of this matrix and places
the result in vr.
- Overrides:
mulInverse
in class Matrix2dBase
- Parameters:
vr
- result vectorv1
- vector to multiply by
- Returns:
- true (matrix is never singular)
mulInverse
public boolean mulInverse(Vector2d vr)
- Multiplies the column vector vr by the inverse of this matrix and places
the result back in vr.
- Overrides:
mulInverse
in class Matrix2dBase
- Parameters:
vr
- vector to multiply by (in place)
- Returns:
- true (matrix is never singular)
mulInverseTranspose
public boolean mulInverseTranspose(Vector2d vr,
Vector2d v1)
- Multiplies the column vector v1 by the inverse transpose of this matrix
and places the result in vr. For a rotation matrix, this is equivalent to
simply multiplying by the matrix.
- Overrides:
mulInverseTranspose
in class Matrix2dBase
- Parameters:
vr
- result vectorv1
- vector to multiply by
- Returns:
- true (matrix is never singular)
mulInverseTranspose
public boolean mulInverseTranspose(Vector2d vr)
- Multiplies vector vr by the inverse transpose of this matrix, in place.
For a rotation matrix, this is equivalent to simply multiplying by the
matrix.
- Overrides:
mulInverseTranspose
in class Matrix2dBase
- Parameters:
vr
- vector to multiply
- Returns:
- true (matrix is never singular)
invert
public boolean invert()
- Description copied from class:
Matrix2dBase
- Inverts this matrix in place, returning false if the matrix is detected to
be singular.
- Overrides:
invert
in class Matrix2dBase
invert
public boolean invert(RotationMatrix2d r1)
transform
public void transform(Vector2d vr,
Vector2d v1)
transform
public void transform(Vector2d vr)
inverseTransform
public void inverseTransform(Vector2d vr,
Vector2d v1)
inverseTransform
public void inverseTransform(Vector2d vr)
setAngle
public void setAngle(double ang)
mulAngle
public void mulAngle(double ang)
getAngle
public double getAngle()
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).
setRandom
public void setRandom(java.util.Random generator)