public final class Matrix extends Object
These objects are immutable.
| Modifier and Type | Field and Description |
|---|---|
double |
a |
double |
b |
double |
c |
double |
d |
static Matrix |
IDENTITY_MATRIX
a constant Matrix representing the identity transformation
|
double |
tx |
double |
ty |
| Constructor and Description |
|---|
Matrix(double[] matrix)
Creates a matrix from either a 4 or 6 element array representing a matrix.
|
Matrix(double a,
double b,
double c,
double d,
double tx,
double ty) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyToPoint(Point p)
computes p * this and returns the result in p
|
double |
applyToXYGetX(double x,
double y)
computes [x y] * this and returns the resulting x value
|
double |
applyToXYGetY(double x,
double y)
computes [x y] * this and returns the resulting y value
|
boolean |
isIdentity()
Returns true iff this is very close to representing the identity transformation.
|
boolean |
isInverse(Matrix inverse)
Checks whether 'inverse' is the inverse of this matrix.
|
Matrix |
multiply(double multiplier)
Computes this * multiplier and returns the resulting matrix.
|
Matrix |
multiply(Matrix multiplier)
Computes this * multiplier and returns the resulting matrix.
|
public static final Matrix IDENTITY_MATRIX
public final double a
public final double b
public final double c
public final double d
public final double tx
public final double ty
public Matrix(double[] matrix)
matrix - contains the matrix elements in the following order: a, b, c, d, tx, typublic Matrix(double a,
double b,
double c,
double d,
double tx,
double ty)
public boolean isIdentity()
public boolean isInverse(Matrix inverse)
inverse - the matrix to be comparedpublic Matrix multiply(Matrix multiplier)
public Matrix multiply(double multiplier)
public void applyToPoint(Point p)
public double applyToXYGetX(double x,
double y)
public double applyToXYGetY(double x,
double y)
Copyright © 2010 - 2020 Adobe. All Rights Reserved