net.paulhertz.geom
Class Matrix3

java.lang.Object
  extended by net.paulhertz.geom.Matrix3

public class Matrix3
extends Object

Maintains a 3 x 3 matrix for accumulating affine transforms (translate, scale, rotate, shear). The matrix is used as a CTM or current transformation matrix for 2D graphics state. Also provides static utility methods for operations with 3 x 3 matrices. Parts of Matrix3 are adapted from the 2d and 3d Vector C Library by Andrew Glassner from "Graphics Gems", Academic Press, 1990. See http://www.graphicsgems.org/.


Constructor Summary
Matrix3()
          instantiates this Matrix3 as a unit matrix, i.e.:
Matrix3(double[][] element)
          instantiates a Matrix3 from a 3 x 3 array of doubles
Matrix3(Matrix3 matx)
          instantiates a Matrix3 from the element array of another matrix3
 
Method Summary
static double[][] copyMatrix3(double[][] min, double[][] mout)
          Copies one matrix to another matrix.
static Matrix3 copyMatrix3(Matrix3 min, Matrix3 mout)
          Copies one matrix to another matrix.
 double[][] getCTM()
          Returns a copy of the internal matrix of this Matrix3.
 double[][] getElements()
          Returns a copy of the internal matrix of this Matrix3 as a 3x3 array.
 void initCTM()
          Sets the internal matrix of this CTM to the unit matrix.
static double[][] initMatrix3(double[][] anyM3)
          Initializes a matrix (3x3 array) to the unit matrix.
static Matrix3 initMatrix3(Matrix3 anyM3)
          Initializes a matrix (Matrix3) to the unit matrix.
 void initMatxGlobals()
          High level method to initialize internal matrix to unit matrix.
 boolean isNormalCTM()
          Checks whether the internal matrix of this Matrix3 is normal, sets gIsNormal.
static boolean isNormalMatrix3(double[][] anyM3)
          Checks whether a matrix is normal (column 3 is 0 0 1).
static boolean isNormalMatrix3(Matrix3 anyM3)
          Checks whether a matrix is normal (column 3 is 0 0 1).
static double[][] matrixMultiply(double[][] a, double[][] b, double[][] c)
          Multiplies together matrices a and b, returns the result in c.
static Matrix3 matrixMultiply(Matrix3 a, Matrix3 b, Matrix3 c)
          Multiplies together matrices a and b, returns the result in c.
 void multiplyInRotation()
          Low level method to concatenate rotation operation gAng into internal matrix.
 void multiplyInScale()
          Low level method to concatenate scaling operations gSX and gSY into internal matrix.
 void multiplyInShear()
          Low level method to concatenate shearing operations gShX and gShY into internal matrix.
 void multiplyInTranslation()
          Low level method to concatenate translation operations gTX and gTY into internal matrix.
 Point2D.Double multiplyPointByNormalCTM(double x, double y, Point2D.Double pout)
          Multiplies point (x, y) by the internal matrix of this Matrix3, returns result in pout.
 Point2D.Double multiplyPointByNormalCTM(Point2D.Double pin, Point2D.Double pout)
          Multiplies point pin by the internal matrix of this Matrix3, returns result in pout.
static Point2D.Double multiplyPointByNormalMatrix3(double x, double y, Point2D.Double pout, double[][] anyM3)
          Multiplies a point by a normal matrix.
static Point2D.Double multiplyPointByNormalMatrix3(double x, double y, Point2D.Double pout, Matrix3 anyM3)
          Multiplies a point by a normal matrix.
static Point2D.Double multiplyPointByNormalMatrix3(Point2D.Double pin, Point2D.Double pout, double[][] anyM3)
          Multiplies a point by a normal matrix.
static Point2D.Double multiplyPointByNormalMatrix3(Point2D.Double pin, Point2D.Double pout, Matrix3 anyM3)
          Multiplies a point by a normal matrix.
 Point2D.Double multiplyPointByProjCTM(double x, double y, Point2D.Double pout)
          Multiplies point (x, y) by the internal matrix of this Matrix3, returns result in pout.
 Point2D.Double multiplyPointByProjCTM(Point2D.Double pin, Point2D.Double pout)
          Multiplies point pin by the internal matrix of this Matrix3, returns result in pout.
static Point2D.Double multiplyPointByProjMatrix3(double x, double y, Point2D.Double pout, double[][] anyM3)
          Multiplies a point by a projective matrix.
static Point2D.Double multiplyPointByProjMatrix3(double x, double y, Point2D.Double pout, Matrix3 anyM3)
          Multiplies a point by a projective matrix.
static Point2D.Double multiplyPointByProjMatrix3(Point2D.Double pin, Point2D.Double pout, double[][] anyM3)
          Multiplies a point by a projective matrix.
static Point2D.Double multiplyPointByProjMatrix3(Point2D.Double pin, Point2D.Double pout, Matrix3 anyM3)
          Multiplies a point by a projective matrix.
 void reflectCTM(boolean reflectHorizontal)
          Concatenates a reflection on the x- or y-axis into the internal matrix of this Matrix3.
 void reflectCTM(boolean reflectHorizontal, double xTrans, double yTrans)
          High-level method to concatenate a translation followed by a reflection on the x- or y-axis into the internal matrix of this Matrix3.
static double[][] reflectMatrix3(boolean reflectHorizontal, double[][] anyM3)
          Reflects a matrix about the horizontal or vertical axis.
static Matrix3 reflectMatrix3(boolean reflectHorizontal, Matrix3 anyM3)
          Reflects a matrix about the horizontal or vertical axis.
 void rotateCTM(double angle)
          High level method to concatenate rotation by angle radians into the internal matrix of this Matrix3.
static double[][] rotateMatrix3(double angle, double[][] anyM3)
          Concatenates a rotation into a matrix.
static Matrix3 rotateMatrix3(double angle, Matrix3 anyM3)
          Concatenates a rotation into a matrix.
 void scaleCTM(double xScale, double yScale)
          High level method to concatenate scaling in x and y into the internal matrix of this Matrix3.
static double[][] scaleMatrix3(double xScale, double yScale, double[][] anyM3)
          Concatenates scaling on x and y axis into a matrix.
static Matrix3 scaleMatrix3(double xScale, double yScale, Matrix3 anyM3)
          Concatenates scaling on x and y axis into a matrix.
 void setCTM(double[][] elems)
          Copies the values in the 3x3 array elems to the internal matrix of this Matrix3.
 void setCTM(double a, double b, double c, double d, double tx, double ty)
          Sets the values of first two columns of matrix elems.
 void setCTM(Matrix3 newCTM)
          Copies the internal matrix of newCTM to the internal matrix of this Matrix3.
 void setRotation(double theta)
          Low level method to set gAng, used internally.
 void setScale(double xScale, double yScale)
          Low level method to set gSX and gSY, used internally.
 void setShear(double xShear, double yShear)
          Low level method to set gShX and gShY, used internally.
 void setTranslation(double xTrans, double yTrans)
          Low level method to set gTX and gTY, used internally.
 void shearCTM(double xShear, double yShear)
          Concatenates a shear on the x and y axes into the internal matrix of this Matrix3.
static double[][] shearMatrix3(double shX, double shY, double[][] anyM3)
          Shears a matrix.
static Matrix3 shearMatrix3(double shX, double shY, Matrix3 anyM3)
          Shears a matrix.
 ArrayList<Point2D.Double> transformList(ArrayList<Point2D.Double> pts)
          Transforms a list of points by current transformation matrix.
 void translateCTM(double xTrans, double yTrans)
          High level method to concatenate translation in x and y into the internal matrix of this Matrix3.
static double[][] translateMatrix3(double xTrans, double yTrans, double[][] anyM3)
          Concatenates translations on x and y axis into a matrix.
static Matrix3 translateMatrix3(double xTrans, double yTrans, Matrix3 anyM3)
          Concatenates translations on x and y axis into a matrix.
static double[][] transposeMatrix3(double[][] a, double[][] b)
          Transposes matrix a, returns the result in matrix b.
static Matrix3 transposeMatrix3(Matrix3 a, Matrix3 b)
          Transposes matrix a, returns the result in matrix b.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matrix3

public Matrix3(double[][] element)
instantiates a Matrix3 from a 3 x 3 array of doubles

Parameters:
element - a 3 x 3 array of doubles

Matrix3

public Matrix3(Matrix3 matx)
instantiates a Matrix3 from the element array of another matrix3

Parameters:
matx - a Matrix3

Matrix3

public Matrix3()
instantiates this Matrix3 as a unit matrix, i.e.:
    1  0  0
    0  1  0
    0  0  1
 

Method Detail

matrixMultiply

public static Matrix3 matrixMultiply(Matrix3 a,
                                     Matrix3 b,
                                     Matrix3 c)
Multiplies together matrices a and b, returns the result in c. Note that c must not point to either of the input matrices.

Parameters:
a - a Matrix3
b - a Matrix3
c - a Matrix that will contain result of multiplying a and b
Returns:
a Matrix3 (c)

matrixMultiply

public static double[][] matrixMultiply(double[][] a,
                                        double[][] b,
                                        double[][] c)
Multiplies together matrices a and b, returns the result in c. Note that c must not point to either of the input matrices.

Parameters:
a - a 3 x 3 array of doubles
b - a 3 x 3 array of doubles
c - a 3 x 3 array of doubles that will contain result of multiplying a and b
Returns:
a 3 x 3 array of doubles (c)

transposeMatrix3

public static Matrix3 transposeMatrix3(Matrix3 a,
                                       Matrix3 b)
Transposes matrix a, returns the result in matrix b.

Parameters:
a - a Matrix3
b - a Matrix3 that receives the transpose of a
Returns:
a Matrix3 (b)

transposeMatrix3

public static double[][] transposeMatrix3(double[][] a,
                                          double[][] b)
Transposes matrix a, returns the result in matrix b.

Parameters:
a - a 3 x 3 array of doubles
b - a 3 x 3 array of doubles that receives the transpose of a
Returns:
a 3 x 3 array of doubles

setScale

public void setScale(double xScale,
                     double yScale)
Low level method to set gSX and gSY, used internally. Call scaleCTM to set CTM and gSX, gSY.

Parameters:
xScale - scaling on x-axis
yScale - scaling on y-axis

setTranslation

public void setTranslation(double xTrans,
                           double yTrans)
Low level method to set gTX and gTY, used internally. Call translateCTM to set CTM and gTX, gTY.

Parameters:
xTrans - translation along x-axis
yTrans - translatiion along y-axis

setRotation

public void setRotation(double theta)
Low level method to set gAng, used internally. Call rotateCTM to set CTM and gAng.

Parameters:
theta - angle to rotate, in radians

setShear

public void setShear(double xShear,
                     double yShear)
Low level method to set gShX and gShY, used internally. Call shearCTM to set CTM and gShX, gShY.

Parameters:
xShear -
yShear -

multiplyInScale

public void multiplyInScale()
Low level method to concatenate scaling operations gSX and gSY into internal matrix. Generally, you should call translateCTM instead.


multiplyInTranslation

public void multiplyInTranslation()
Low level method to concatenate translation operations gTX and gTY into internal matrix. Generally, you should call translateCTM instead.


multiplyInRotation

public void multiplyInRotation()
Low level method to concatenate rotation operation gAng into internal matrix. Generally, you should call rotateCTM instead.


multiplyInShear

public void multiplyInShear()
Low level method to concatenate shearing operations gShX and gShY into internal matrix. Generally, you should call shearCTM instead.


initMatxGlobals

public void initMatxGlobals()
High level method to initialize internal matrix to unit matrix. Sets gAng, gTX and gTY to 0. Sets gTX and gTY to 1.


setCTM

public void setCTM(Matrix3 newCTM)
Copies the internal matrix of newCTM to the internal matrix of this Matrix3. Values of gTX, gTY, gAng, gSX, gSY, gShX and gShY remain unchanged.

Parameters:
newCTM - a Matrix3

setCTM

public void setCTM(double[][] elems)
Copies the values in the 3x3 array elems to the internal matrix of this Matrix3. Values of gTX, gTY, gAng, gSX, gSY, gShX and gShY remain unchanged.

Parameters:
elems - a 3 x 3 array of double

setCTM

public void setCTM(double a,
                   double b,
                   double c,
                   double d,
                   double tx,
                   double ty)
Sets the values of first two columns of matrix elems. Values of gTX, gTY, gAng, gSX, gSY, gShX and gShY remain unchanged. This 6 value format is typical of Adobe Illustrator, and similar to Processing's 3x2 matrix structure PMatrix2D.

Parameters:
a - value for element[0][0], scaling on x-axis
b - value for element[0][1]
c - value for element[1][0]
d - value for element[1][1], scaling on y-axis
tx - value for element[2][0], translation on x-axis
ty - value for element[2][1], translation on y-axis

getCTM

public double[][] getCTM()
Returns a copy of the internal matrix of this Matrix3.

Returns:
a copy of the internal matrix of this Matrix3

initCTM

public void initCTM()
Sets the internal matrix of this CTM to the unit matrix. Values of gTX, gTY, gAng, gSX, gSY, gShX and gShY remain unchanged.


getElements

public double[][] getElements()
Returns a copy of the internal matrix of this Matrix3 as a 3x3 array.

Returns:
a copy of the internal matrix of this Matrix3

isNormalCTM

public boolean isNormalCTM()
Checks whether the internal matrix of this Matrix3 is normal, sets gIsNormal.

Returns:
true if the internal matrix of this Matrix3 is normal (column 3 is 0 0 1), false otherwise.

translateCTM

public void translateCTM(double xTrans,
                         double yTrans)
High level method to concatenate translation in x and y into the internal matrix of this Matrix3. Sets the values of gTX and gTY.

Parameters:
xTrans - translation on the x-axis
yTrans - translation on the y-axis

scaleCTM

public void scaleCTM(double xScale,
                     double yScale)
High level method to concatenate scaling in x and y into the internal matrix of this Matrix3. Sets the values of gSX and gSY.

Parameters:
xScale - scaling on the x-axis
yScale - scaling on the y-axis

rotateCTM

public void rotateCTM(double angle)
High level method to concatenate rotation by angle radians into the internal matrix of this Matrix3. Sets the value of gAng.

Parameters:
angle - the angle to rotate

reflectCTM

public void reflectCTM(boolean reflectHorizontal,
                       double xTrans,
                       double yTrans)
High-level method to concatenate a translation followed by a reflection on the x- or y-axis into the internal matrix of this Matrix3. Changes values of gSX, gSY, gTX and gTY.

Parameters:
reflectHorizontal - true if reflection in on x-axis, false if reflection in on y-axis
xTrans - displacement on x-axis applied prior to reflection
yTrans - displacement on y-axis applied prior to reflection

reflectCTM

public void reflectCTM(boolean reflectHorizontal)
Concatenates a reflection on the x- or y-axis into the internal matrix of this Matrix3. Changes values of gSX and gSY.

Parameters:
reflectHorizontal - true if reflection is on x-axis, false if reflection is on y-axis

shearCTM

public void shearCTM(double xShear,
                     double yShear)
Concatenates a shear on the x and y axes into the internal matrix of this Matrix3. Sets gShX and gShY to xShear and yShear.

Parameters:
xShear - shearing on x-axis
yShear - shearing on y-axis

multiplyPointByNormalCTM

public Point2D.Double multiplyPointByNormalCTM(Point2D.Double pin,
                                               Point2D.Double pout)
Multiplies point pin by the internal matrix of this Matrix3, returns result in pout. It is the user's responsibility to ensure the the internal matrix is normal.

Parameters:
pin - point to transform by current transformation matrix
pout - stores value of point that results from transform
Returns:
the transformed point

multiplyPointByNormalCTM

public Point2D.Double multiplyPointByNormalCTM(double x,
                                               double y,
                                               Point2D.Double pout)
Multiplies point (x, y) by the internal matrix of this Matrix3, returns result in pout. It is the user's responsibility to ensure the the internal matrix is normal.

Parameters:
x - x-coordinate of point
y - y-coordinate of point
pout - stores value of point that results from transform
Returns:
the transformed point

multiplyPointByProjCTM

public Point2D.Double multiplyPointByProjCTM(Point2D.Double pin,
                                             Point2D.Double pout)
Multiplies point pin by the internal matrix of this Matrix3, returns result in pout. Column 3 of internal matrix will affect results if it is not normal (0 0 1).

Parameters:
pin - point to transform by current transformation matrix
pout - stores value of point that results from transform
Returns:
the transformed point

multiplyPointByProjCTM

public Point2D.Double multiplyPointByProjCTM(double x,
                                             double y,
                                             Point2D.Double pout)
Multiplies point (x, y) by the internal matrix of this Matrix3, returns result in pout. Column 3 of internal matrix will affect results if it is not normal (0 0 1).

Parameters:
x - x-coordinate of point
y - y-coordinate of point
pout - stores value of point that results from transform
Returns:
the transformed point

transformList

public ArrayList<Point2D.Double> transformList(ArrayList<Point2D.Double> pts)
Transforms a list of points by current transformation matrix. User does not need to determine if the CTM is normal, the methods checks and performs the appropriate transform.

Parameters:
pts - an ArrayList of points
Returns:
the list with its points transformed

copyMatrix3

public static Matrix3 copyMatrix3(Matrix3 min,
                                  Matrix3 mout)
Copies one matrix to another matrix. Matrices are represented as Matrix3.

Parameters:
min - the source matrix
mout - the target matrix
Returns:
the copied matrix (mout)

copyMatrix3

public static double[][] copyMatrix3(double[][] min,
                                     double[][] mout)
Copies one matrix to another matrix. Matrices are represented as 3x3 arrays.

Parameters:
min - the source matrix, 3x3 array of double
mout - the target matrix, 3x3 array of double
Returns:
the copied matrix, 3x3 array of double (mout)

initMatrix3

public static Matrix3 initMatrix3(Matrix3 anyM3)
Initializes a matrix (Matrix3) to the unit matrix.

Parameters:
anyM3 - the matrix to be initialized
Returns:
the initialized matrix

initMatrix3

public static double[][] initMatrix3(double[][] anyM3)
Initializes a matrix (3x3 array) to the unit matrix.

Parameters:
anyM3 - the matrix to be initialized, a 3x3 array of double
Returns:
the initialized matrix, a 3x3 array of double

isNormalMatrix3

public static boolean isNormalMatrix3(Matrix3 anyM3)
Checks whether a matrix is normal (column 3 is 0 0 1).

Parameters:
anyM3 - a Matrix3
Returns:
true if matrix is normal, false otherwise.

isNormalMatrix3

public static boolean isNormalMatrix3(double[][] anyM3)
Checks whether a matrix is normal (column 3 is 0 0 1).

Parameters:
anyM3 - a 3x3 array of double
Returns:
true if matrix is normal, false otherwise.

translateMatrix3

public static Matrix3 translateMatrix3(double xTrans,
                                       double yTrans,
                                       Matrix3 anyM3)
Concatenates translations on x and y axis into a matrix. Does not set globals gTX, gTY.

Parameters:
xTrans - translation on x-axis
yTrans - translation on y-axis
anyM3 - matrix into which translations are concatenated
Returns:
the transformed matrix

translateMatrix3

public static double[][] translateMatrix3(double xTrans,
                                          double yTrans,
                                          double[][] anyM3)
Concatenates translations on x and y axis into a matrix. Does not set globals gTX, gTY.

Parameters:
xTrans - translation on x-axis
yTrans - translation on y-axis
anyM3 - matrix into which translations are concatenated, a 3x3 array of double
Returns:
the transformed matrix, a 3x3 array of double

scaleMatrix3

public static Matrix3 scaleMatrix3(double xScale,
                                   double yScale,
                                   Matrix3 anyM3)
Concatenates scaling on x and y axis into a matrix. Does not set globals gSX and gSY.

Parameters:
xScale - scaling on x-axis
yScale - scaling on y-axis
anyM3 - matrix into which scalings are concatenated
Returns:
the transformed matrix

scaleMatrix3

public static double[][] scaleMatrix3(double xScale,
                                      double yScale,
                                      double[][] anyM3)
Concatenates scaling on x and y axis into a matrix. Does not set globals gSX and gSY.

Parameters:
xScale - scaling on x-axis
yScale - scaling on y-axis
anyM3 - matrix into which scalings are concatenated, a 3x3 arry of double
Returns:
the transformed matrix, a 3x3 arry of double

rotateMatrix3

public static Matrix3 rotateMatrix3(double angle,
                                    Matrix3 anyM3)
Concatenates a rotation into a matrix. Does not set global gAng.

Parameters:
angle - angle of rotation in radians
anyM3 - the matrix to transform
Returns:
the transformed matrix

rotateMatrix3

public static double[][] rotateMatrix3(double angle,
                                       double[][] anyM3)
Concatenates a rotation into a matrix. Does not set global gAng.

Parameters:
angle - angle of rotation in radians
anyM3 - the matrix to transform, a 3x3 array of double
Returns:
the transformed matrix, a 3x3 array of double

reflectMatrix3

public static Matrix3 reflectMatrix3(boolean reflectHorizontal,
                                     Matrix3 anyM3)
Reflects a matrix about the horizontal or vertical axis. Does not set globals gSX and gSY.

Parameters:
reflectHorizontal - true if reflection is around the x-axis, false if it's around the y-axis
anyM3 - a matrix encapsulated as a Matrix3.
Returns:
the resulting matrix

reflectMatrix3

public static double[][] reflectMatrix3(boolean reflectHorizontal,
                                        double[][] anyM3)
Reflects a matrix about the horizontal or vertical axis. Does not set globals gSX and gSY.

Parameters:
reflectHorizontal - true if reflection is around the x-axis, false if it's around the y-axis
anyM3 - a 3x3 array of double
Returns:
a 3x3 array of double (the supplied matrix)

shearMatrix3

public static Matrix3 shearMatrix3(double shX,
                                   double shY,
                                   Matrix3 anyM3)
Shears a matrix. Does not set the globals gShX and gShY.

Parameters:
shX - x-axis shearing
shY - y-axis shearing
anyM3 - a Matrix3 to which the shearing operation will be concatenated.
Returns:
the sheared matrix

shearMatrix3

public static double[][] shearMatrix3(double shX,
                                      double shY,
                                      double[][] anyM3)
Shears a matrix. Does not set the globals gShX and gShY.

Parameters:
shX - x-axis shearing
shY - y-axis shearing
anyM3 - a 3x3 array to which the shearing operation will be concatenated.
Returns:
the sheared matrix

multiplyPointByNormalMatrix3

public static Point2D.Double multiplyPointByNormalMatrix3(Point2D.Double pin,
                                                          Point2D.Double pout,
                                                          Matrix3 anyM3)
Multiplies a point by a normal matrix.

Parameters:
pin - a point to transform
pout - the transformed point
anyM3 - the matrix performing the transform
Returns:
the transformed point

multiplyPointByNormalMatrix3

public static Point2D.Double multiplyPointByNormalMatrix3(double x,
                                                          double y,
                                                          Point2D.Double pout,
                                                          Matrix3 anyM3)
Multiplies a point by a normal matrix.

Parameters:
x - x-coordinate of point
y - y-coordinate of point
pout - the transformed point
anyM3 - the matrix performing the transform
Returns:
the transformed point

multiplyPointByNormalMatrix3

public static Point2D.Double multiplyPointByNormalMatrix3(Point2D.Double pin,
                                                          Point2D.Double pout,
                                                          double[][] anyM3)
Multiplies a point by a normal matrix.

Parameters:
pin - a point to transform
pout - the transformed point
anyM3 - the matrix performing the transform, a 3x3 array of double
Returns:
the transformed point

multiplyPointByNormalMatrix3

public static Point2D.Double multiplyPointByNormalMatrix3(double x,
                                                          double y,
                                                          Point2D.Double pout,
                                                          double[][] anyM3)
Multiplies a point by a normal matrix.

Parameters:
x - x-coordinate of point
y - y-coordinate of point
pout - the transformed point
anyM3 - the matrix performing the transform, a 3x3 array of double
Returns:
the transformed point

multiplyPointByProjMatrix3

public static Point2D.Double multiplyPointByProjMatrix3(Point2D.Double pin,
                                                        Point2D.Double pout,
                                                        Matrix3 anyM3)
Multiplies a point by a projective matrix.

Parameters:
pin - a point to transform
pout - the transformed point
anyM3 - the matrix performing the transform
Returns:
the transformed point

multiplyPointByProjMatrix3

public static Point2D.Double multiplyPointByProjMatrix3(double x,
                                                        double y,
                                                        Point2D.Double pout,
                                                        Matrix3 anyM3)
Multiplies a point by a projective matrix.

Parameters:
x - x-coordinate of point
y - y-coordinate of point
pout - the transformed point
anyM3 - the matrix performing the transform
Returns:
the transformed point

multiplyPointByProjMatrix3

public static Point2D.Double multiplyPointByProjMatrix3(Point2D.Double pin,
                                                        Point2D.Double pout,
                                                        double[][] anyM3)
Multiplies a point by a projective matrix.

Parameters:
pin - a point to transform
pout - the transformed point
anyM3 - the matrix performing the transform, a 3x3 array of double
Returns:
the transformed point

multiplyPointByProjMatrix3

public static Point2D.Double multiplyPointByProjMatrix3(double x,
                                                        double y,
                                                        Point2D.Double pout,
                                                        double[][] anyM3)
Multiplies a point by a projective matrix.

Parameters:
x - x-coordinate of point
y - y-coordinate of point
pout - the transformed point
anyM3 - the matrix performing the transform, a 3x3 array of double
Returns:
the transformed point


Processing library IgnoCodeLib by Paul Hertz. (C) 2013