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.
-
Matrix3()
- Identity matrix constructor.
-
Matrix3(float[])
-
-
Matrix3(Matrix3)
-
-
Matrix3(Point2)
-
-
Matrix3(Vector2)
-
-
clear()
-
-
clone()
-
-
copy(Copyable)
-
-
decompose(Vector2)
- Decompose the matrix into a rotation.
-
decompose(Vector2, Point2)
- Decompose the matrix into a rotation and translation.
-
decompose(Vector2, Point2, Vector2)
- Decompose the matrix into a rotation, translation, and scaling.
-
determinant()
- Return the determinant of the matrix.
-
equals(Matrix3)
-
-
equals(Object)
-
-
getElements(float[])
-
-
getRows(Vector2, Vector2)
-
-
getRows(Vector2, Vector2, Point2)
-
-
identity()
- Load the identity transformation.
-
inverse(Matrix3)
- Set the matrix to the inverse of m
-
invert()
- Invert the matrix.
-
isAffine()
- Return true if the matrix represents a 2D affine transformation.
-
isIdentity()
- Return true if the matrix is the identity matrix.
-
isLengthPreserving()
- Return true if the matrix represents a length-preserving (rigid)
transformation in 2D space.
-
isLinear()
- Return true if the matrix represents a 2D linear transformation.
-
multiply(Matrix3, Matrix3)
- Set the matrix to the product of matrices m1 and m2
-
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.
-
postMultiply(Matrix3)
- Post-multiply with another matrix.
-
preMultiply(Matrix3)
- Pre-multiply with another matrix.
-
rotate(float)
- Apply a rotation of angle radians about the origin.
-
rotate(Matrix3, float)
-
-
rotate(Matrix3, Vector2)
-
-
rotate(Vector2)
- Apply the rotation about the origin represented by the vector V.
-
scale(float)
- Scale the matrix isotropically by premultiplying with S(s, s)
-
scale(float, float)
- Scale the matrix by premultiplying with S(sx, sy)
-
scale(Matrix3, float)
- Set the matrix to S(s, s) M
-
scale(Matrix3, float, float)
- Set the matrix to S(sx, sy)
-
setElements(float[])
-
-
translate(float, float)
- Translate the matrix by premultiplying with T(dx, dy)
-
translate(Matrix3, float, float)
- Set the matrix to T(dx, dy) M
-
translate(Matrix3, Point2)
- Set the matrix to T(P) M
-
translate(Point2)
- Translate the matrix by premultiplying with T(P)
-
transpose()
- Compute the transpose of the matrix.
-
transpose(Matrix3)
- Set the matrix to the transpose of m.
Matrix3
public Matrix3()
- Identity matrix constructor.
Matrix3
public Matrix3(float m[])
Matrix3
public Matrix3(Vector2 v)
Matrix3
public Matrix3(Point2 p)
Matrix3
public Matrix3(Matrix3 m)
clear
public void clear()
identity
public synchronized void identity()
- Load the identity transformation.
translate
public final void translate(float dx,
float dy)
- Translate the matrix by premultiplying with T(dx, dy)
translate
public final void translate(Matrix3 m,
float dx,
float dy)
- Set the matrix to T(dx, dy) M
translate
public final void translate(Point2 p)
- Translate the matrix by premultiplying with T(P)
translate
public final void translate(Matrix3 m,
Point2 p)
- Set the matrix to T(P) M
scale
public final void scale(float s)
- Scale the matrix isotropically by premultiplying with S(s, s)
scale
public final void scale(Matrix3 m,
float s)
- Set the matrix to S(s, s) M
scale
public final void scale(float sx,
float sy)
- Scale the matrix by premultiplying with S(sx, sy)
scale
public final void scale(Matrix3 m,
float sx,
float sy)
- Set the matrix to S(sx, sy)
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?
rotate
public final void rotate(Matrix3 m,
Vector2 v)
rotate
public void rotate(float angle)
- Apply a rotation of angle radians about the origin.
rotate
public void rotate(Matrix3 m,
float angle)
preMultiply
public synchronized void preMultiply(Matrix3 m)
- Pre-multiply with another matrix.
postMultiply
public synchronized void postMultiply(Matrix3 m)
- Post-multiply with another matrix.
multiply
public synchronized void multiply(Matrix3 m1,
Matrix3 m2)
- Set the matrix to the product of matrices m1 and m2
transpose
public void transpose()
- Compute the transpose of the matrix.
transpose
public void transpose(Matrix3 m)
- Set the matrix to the transpose of m.
invert
public synchronized void invert() throws MatrixInversionException
- Invert the matrix.
@exception MatrixInversionException if the matrix is singular.
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.
determinant
public synchronized float determinant()
- Return the determinant of the matrix.
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.)
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.
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.
isIdentity
public final boolean isIdentity()
- Return true if the matrix is the identity matrix.
isLinear
public final boolean isLinear()
- Return true if the matrix represents a 2D linear transformation.
isAffine
public final boolean isAffine()
- Return true if the matrix represents a 2D affine transformation.
isLengthPreserving
public final boolean isLengthPreserving()
- Return true if the matrix represents a length-preserving (rigid)
transformation in 2D space.
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
setElements
public void setElements(float m[])
getElements
public void getElements(float m[])
getRows
public void getRows(Vector2 row0,
Vector2 row1)
getRows
public void getRows(Vector2 row0,
Vector2 row1,
Point2 row2)
equals
public boolean equals(Matrix3 m)
equals
public boolean equals(Object o)
- Overrides:
- equals in class Object
copy
public void copy(Copyable cop)
clone
public Object clone()
- Overrides:
- clone in class Object
All Packages Class Hierarchy This Package Previous Next Index