Class dnx.geom.Matrix3
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.geom.Matrix3

java.lang.Object
   |
   +----dnx.geom.Matrix3

public class Matrix3
extends Object
implements Cloneable, Copyable
A Matrix3 is a 3x3 matrix. Pilfered from Matrix4.java.

Constructor Index

 o Matrix3()
Identity matrix constructor.
 o Matrix3(float[])
 o Matrix3(Matrix3)
 o Matrix3(Point2)
 o Matrix3(Vector2)

Method Index

 o clear()
 o clone()
 o copy(Copyable)
 o decompose(Vector2)
Decompose the matrix into a rotation.
 o decompose(Vector2, Point2)
Decompose the matrix into a rotation and translation.
 o decompose(Vector2, Point2, Vector2)
Decompose the matrix into a rotation, translation, and scaling.
 o determinant()
Return the determinant of the matrix.
 o equals(Matrix3)
 o equals(Object)
 o getElements(float[])
 o getRows(Vector2, Vector2)
 o getRows(Vector2, Vector2, Point2)
 o identity()
Load the identity transformation.
 o inverse(Matrix3)
Set the matrix to the inverse of m
 o invert()
Invert the matrix.
 o isAffine()
Return true if the matrix represents a 2D affine transformation.
 o isIdentity()
Return true if the matrix is the identity matrix.
 o isLengthPreserving()
Return true if the matrix represents a length-preserving (rigid) transformation in 2D space.
 o isLinear()
Return true if the matrix represents a 2D linear transformation.
 o multiply(Matrix3, Matrix3)
Set the matrix to the product of matrices m1 and m2
 o optimize()
This method attempts to classify the matrix as a member one of of several special categories so that further computations involving it are more efficient.
 o postMultiply(Matrix3)
Post-multiply with another matrix.
 o preMultiply(Matrix3)
Pre-multiply with another matrix.
 o rotate(float)
Apply a rotation of angle radians about the origin.
 o rotate(Matrix3, float)
 o rotate(Matrix3, Vector2)
 o rotate(Vector2)
Apply the rotation about the origin represented by the vector V.
 o scale(float)
Scale the matrix isotropically by premultiplying with S(s, s)
 o scale(float, float)
Scale the matrix by premultiplying with S(sx, sy)
 o scale(Matrix3, float)
Set the matrix to S(s, s) M
 o scale(Matrix3, float, float)
Set the matrix to S(sx, sy)
 o setElements(float[])
 o translate(float, float)
Translate the matrix by premultiplying with T(dx, dy)
 o translate(Matrix3, float, float)
Set the matrix to T(dx, dy) M
 o translate(Matrix3, Point2)
Set the matrix to T(P) M
 o translate(Point2)
Translate the matrix by premultiplying with T(P)
 o transpose()
Compute the transpose of the matrix.
 o transpose(Matrix3)
Set the matrix to the transpose of m.

Constructors

 o Matrix3
  public Matrix3()
Identity matrix constructor.
 o Matrix3
  public Matrix3(float m[])
 o Matrix3
  public Matrix3(Vector2 v)
 o Matrix3
  public Matrix3(Point2 p)
 o Matrix3
  public Matrix3(Matrix3 m)

Methods

 o clear
  public void clear()
 o identity
  public synchronized void identity()
Load the identity transformation.
 o translate
  public final void translate(float dx,
                              float dy)
Translate the matrix by premultiplying with T(dx, dy)
 o translate
  public final void translate(Matrix3 m,
                              float dx,
                              float dy)
Set the matrix to T(dx, dy) M
 o translate
  public final void translate(Point2 p)
Translate the matrix by premultiplying with T(P)
 o translate
  public final void translate(Matrix3 m,
                              Point2 p)
Set the matrix to T(P) M
 o scale
  public final void scale(float s)
Scale the matrix isotropically by premultiplying with S(s, s)
 o scale
  public final void scale(Matrix3 m,
                          float s)
Set the matrix to S(s, s) M
 o scale
  public final void scale(float sx,
                          float sy)
Scale the matrix by premultiplying with S(sx, sy)
 o scale
  public final void scale(Matrix3 m,
                          float sx,
                          float sy)
Set the matrix to S(sx, sy)
 o rotate
  public final void rotate(Vector2 v)
Apply the rotation about the origin represented by the vector V. #### Does this need to be a unit vector?
 o rotate
  public final void rotate(Matrix3 m,
                           Vector2 v)
 o rotate
  public void rotate(float angle)
Apply a rotation of angle radians about the origin.
 o rotate
  public void rotate(Matrix3 m,
                     float angle)
 o preMultiply
  public synchronized void preMultiply(Matrix3 m)
Pre-multiply with another matrix.
 o postMultiply
  public synchronized void postMultiply(Matrix3 m)
Post-multiply with another matrix.
 o multiply
  public synchronized void multiply(Matrix3 m1,
                                    Matrix3 m2)
Set the matrix to the product of matrices m1 and m2
 o transpose
  public void transpose()
Compute the transpose of the matrix.
 o transpose
  public void transpose(Matrix3 m)
Set the matrix to the transpose of m.
 o invert
  public synchronized void invert() throws MatrixInversionException
Invert the matrix. @exception MatrixInversionException if the matrix is singular.
 o inverse
  public synchronized void inverse(Matrix3 m) throws MatrixInversionException
Set the matrix to the inverse of m @param m m is a non-singular matrix. @exception MatrixInversionException if m is singular.
 o determinant
  public synchronized float determinant()
Return the determinant of the matrix.
 o decompose
  public final boolean decompose(Vector2 rotation)
Decompose the matrix into a rotation. Return whether or not the decomposition was successful (i.e. if the matrix represents a pure rotation.)
 o decompose
  public final boolean decompose(Vector2 rotation,
                                 Point2 translation)
Decompose the matrix into a rotation and translation. Return whether or not the decomposition was successful.
 o decompose
  public final boolean decompose(Vector2 rotation,
                                 Point2 translation,
                                 Vector2 scale)
Decompose the matrix into a rotation, translation, and scaling. Return whether or not the decomposition was successful.
 o isIdentity
  public final boolean isIdentity()
Return true if the matrix is the identity matrix.
 o isLinear
  public final boolean isLinear()
Return true if the matrix represents a 2D linear transformation.
 o isAffine
  public final boolean isAffine()
Return true if the matrix represents a 2D affine transformation.
 o isLengthPreserving
  public final boolean isLengthPreserving()
Return true if the matrix represents a length-preserving (rigid) transformation in 2D space.
 o optimize
  public void optimize()
This method attempts to classify the matrix as a member one of of several special categories so that further computations involving it are more efficient. Optimizing a matrix requires a significant amount of computation and should only be done if the matrix will be used often. If the matrix is to be used in rendering, it's generally a good idea to optimize it first. Also, matrix inversion can be sped up a great deal if the matrix can be classified. Finally, a matrix only needs to be optimized if it wasn't constructed with the identity constructor or if the setValue method has been used; all the other methods keep track of any special matrix properties. #### I haven't thought enough about this to verify whether it's really correct for 2D. It needs to be reviewed. --ben
 o setElements
  public void setElements(float m[])
 o getElements
  public void getElements(float m[])
 o getRows
  public void getRows(Vector2 row0,
                      Vector2 row1)
 o getRows
  public void getRows(Vector2 row0,
                      Vector2 row1,
                      Point2 row2)
 o equals
  public boolean equals(Matrix3 m)
 o equals
  public boolean equals(Object o)
Overrides:
equals in class Object
 o copy
  public void copy(Copyable cop)
 o clone
  public Object clone()
Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index