org.grinvin.gred.transformations
Class AffineTransformation
- Transformation
public class AffineTransformation
Affine transformation from n-space to 2-space. Such a
transformation is represented by a matrix
[ a00 a01 a02 ... b0 ]
[ a10 a11 a12 ... b1 ]
and transforms source coordinates (c0,c1,...) to destination
coordinates (x,y) as follows:
x = a00 c0 + a01 c1 + a02 c2 + ... + b0
y = a10 c0 + a11 c1 + a12 c2 + ... + b1
@Override | boolean isInvertible() - Is this transformation invertible?
|
@Override | double[] transform(double[] src, double[] dest)
|
@Override | int getDimension()
|
void | moveOrigin(double tx, double ty) - Concatenate a translation (in destination space) with this transformation.
|
void | rotate(double angle) - Perform a rotation over the given angle around the origin in destination
space.
|
@Override | void inverseTransform(double x, double y, double[] dest) - Perform an inverse transformation from destination space back to
source space.
|
void | zoom(double factor) - Zoom by the given factor in destination space.
|
AffineTransformation
public AffineTransformation()
Create an identity transform for two-dimensional space.
AffineTransformation
public AffineTransformation(double[][] matrix)
Create a new affine transformation with given transformation matrix.
matrix
- transformation matrix
boolean isInvertible
public @Override boolean isInvertible()
Is this transformation invertible?
- true if invertible, false if not
double[] transform
public @Override double[] transform(double[] src,
double[] dest)
int getDimension
public @Override int getDimension()
moveOrigin
public void moveOrigin(double tx,
double ty)
Concatenate a translation (in destination space) with this transformation.
rotate
public void rotate(double angle)
Perform a rotation over the given angle around the origin in destination
space.
void inverseTransform
public @Override void inverseTransform(double x,
double y,
double[] dest)
throws IllegalStateException
Perform an inverse transformation from destination space back to
source space.
zoom
public void zoom(double factor)
Zoom by the given factor in destination space.