net.java.dev.joode.util
Class Matrix2

java.lang.Object
  extended by net.java.dev.joode.util.Matrix2

public class Matrix2
extends java.lang.Object

A two dimensional vector

Author:
Kevin Glass

Field Summary
 Vector2 col1
          The first column of the matrix
 Vector2 col2
          The second column of the matrix
 
Constructor Summary
Matrix2()
          Create an empty matrix
Matrix2(float angle)
          Create a matrix with a rotation
Matrix2(Vector2 col1, Vector2 col2)
          Create a matrix
 
Method Summary
 Matrix2 invert()
          Transpose the invert
 void set(Matrix3 matrix)
          takes the x & y components of the 3D matrix to represent the 2D matrix i.e.
 Matrix2 transpose()
          Transpose the matrix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

col1

public Vector2 col1
The first column of the matrix


col2

public Vector2 col2
The second column of the matrix

Constructor Detail

Matrix2

public Matrix2()
Create an empty matrix


Matrix2

public Matrix2(float angle)
Create a matrix with a rotation

Parameters:
angle - The angle of the rotation decribed by the matrix

Matrix2

public Matrix2(Vector2 col1,
               Vector2 col2)
Create a matrix

Parameters:
col1 - The first column
col2 - The second column
Method Detail

set

public void set(Matrix3 matrix)
takes the x & y components of the 3D matrix to represent the 2D matrix i.e. the top left 2x2 submatrix of the 3x3 matrix, note: if the 3D matrix really is a 3D matrix with a z component that is not the unit z vector, then this will set the 2D matrix to a garbage rotation, so only use in situations where the 3D matrix is really operating in 2D, X-Y plane conditions


transpose

public Matrix2 transpose()
Transpose the matrix

Returns:
A newly created matrix containing the transpose of this matrix

invert

public Matrix2 invert()
Transpose the invert

Returns:
A newly created matrix containing the invert of this matrix