vooga.physicsEngine.geometry.mathUtils
Class Matrix2f

java.lang.Object
  extended by vooga.physicsEngine.geometry.mathUtils.Matrix2f

public class Matrix2f
extends java.lang.Object

A utility class representing a 2 by 2 matrix. The main use is to create rotation matrices. Some of this code is copied from an open source implementation by Kevin Glass.

Author:
Peng Shi

Field Summary
 Vector2f col1
          The first column of the matrix
 Vector2f col2
          The second column of the matrix
 
Constructor Summary
Matrix2f()
          Create an empty matrix
Matrix2f(double angle)
          Create a matrix with a rotation
Matrix2f(Vector2f col1, Vector2f col2)
          Create a matrix
 
Method Summary
 Matrix2f invert()
          Transpose the invert
 Vector2f multiply(Vector2f vec)
          Multiply this matrix with a given vector
 Matrix2f 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 Vector2f col1
The first column of the matrix


col2

public Vector2f col2
The second column of the matrix

Constructor Detail

Matrix2f

public Matrix2f()
Create an empty matrix


Matrix2f

public Matrix2f(double angle)
Create a matrix with a rotation

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

Matrix2f

public Matrix2f(Vector2f col1,
                Vector2f col2)
Create a matrix

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

multiply

public Vector2f multiply(Vector2f vec)
Multiply this matrix with a given vector

Parameters:
vec -
Returns:

transpose

public Matrix2f transpose()
Transpose the matrix

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

invert

public Matrix2f invert()
Transpose the invert

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