|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensourcephysics.numerics.Matrix2DTransformation
public class Matrix2DTransformation
Matrix2DTransformation implements 2D affine transformations
Nested Class Summary | |
---|---|
protected static class |
Matrix2DTransformation.Matrix2DTransformationLoader
|
Constructor Summary | |
---|---|
Matrix2DTransformation(java.awt.geom.AffineTransform transform)
Constructor Matrix2DTransformation |
|
Matrix2DTransformation(double[][] matrix)
Constructs a 2D transformation using the given matrix. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Provides a copy of this transformation. |
static Matrix2DTransformation |
createAlignmentTransformation(double[] v1,
double[] v2)
Instantiates a rotation that aligns the first vector with the second vector. |
double[] |
direct(double[] point)
Transforms the given point+. |
double[] |
getFlatMatrix(double[] mat)
Gets the direct homogeneous affine transformation flattened into a 1-d arrray. |
static XML.ObjectLoader |
getLoader()
|
java.awt.geom.AffineTransform |
getTotalTransform()
|
double[] |
inverse(double[] point)
Transforms the given point using the inverse transformation (if it exists). |
void |
multiply(double[][] mat)
Multiplies this rotation matrix by the given matrix. |
void |
multiply(Matrix2DTransformation trans)
Multiplies (concatenates) this transformation matrix with the given transformation. |
static Matrix2DTransformation |
rotation(double theta)
Creates a 2D transformation representing a rotation about the origin by the given angle. |
static Matrix2DTransformation |
rotation(double theta,
double anchorx,
double anchory)
Creates a 2D transformation representing a rotation about the origin by the given angle around the given axis. |
double[] |
setOrigin(double[] origin)
Sets the origin for this rotation. |
void |
setOrigin(double ox,
double oy)
Sets the origin for this rotation. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Matrix2DTransformation(double[][] matrix)
matrix
- double[][]public Matrix2DTransformation(java.awt.geom.AffineTransform transform)
transform
- Method Detail |
---|
public static Matrix2DTransformation rotation(double theta)
theta
- double
public static Matrix2DTransformation rotation(double theta, double anchorx, double anchory)
theta
- doubleanchorx
- doubleanchory
- double
public java.awt.geom.AffineTransform getTotalTransform()
public java.lang.Object clone()
clone
in interface Transformation
clone
in class java.lang.Object
public final double[] getFlatMatrix(double[] mat)
getFlatMatrix
in interface MatrixTransformation
mat
- double[] optional matrix
public static Matrix2DTransformation createAlignmentTransformation(double[] v1, double[] v2)
v1
- double[]v2
- double[]
public void setOrigin(double ox, double oy)
ox
- doubleoy
- doublepublic double[] setOrigin(double[] origin)
origin
- double[] the new origin
public final void multiply(Matrix2DTransformation trans)
trans
- Matrix2DTransformationpublic final void multiply(double[][] mat)
mat
- double[][]public double[] direct(double[] point)
direct
in interface Transformation
point
- the coordinates to be transformed
public double[] inverse(double[] point) throws java.lang.UnsupportedOperationException
inverse
in interface Transformation
point
- the coordinates to be transformed
java.lang.UnsupportedOperationException
- If the transformation is
not invertiblepublic static XML.ObjectLoader getLoader()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |