com.bramosystems.oss.player.core.client.geom
Class MatrixUtil

java.lang.Object
  extended by com.bramosystems.oss.player.core.client.geom.MatrixUtil

public class MatrixUtil
extends java.lang.Object

Utility class to perform various matrix calculations

Author:
Sikiru Braheem

Constructor Summary
MatrixUtil()
           
 
Method Summary
static Matrix2D add(Matrix2D m, Matrix2D n)
          Returns the addition of matrices m and n
static Matrix3D add(Matrix3D m, Matrix3D n)
          Returns the addition of matrices m and n
static double getDeterminant(Matrix2D m)
          Returns the determinant of matrix m
static double getTrace(Matrix2D m)
          Returns the trace of matrix m
static Matrix2D invert(Matrix2D m)
          Performs a matrix inversion
static Matrix2D multiply(Matrix2D m, Matrix2D n)
          Multiplies matrix m by matrix n.
static Vector multiply(Matrix2D m, Vector n)
          Multiplies matrix m by vector n.
static Matrix3D multiply(Matrix3D m, Matrix3D n)
          Multiplies matrix m by matrix n.
static Vector3D multiply(Matrix3D m, Vector3D n)
          Multiplies matrix m by vector n.
static Matrix2D toCofactor(Matrix2D m)
          Calculates the cofactors of matrix m
static Matrix2D toTranspose(Matrix2D m)
          Returns the transpose matrix of matrix m
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatrixUtil

public MatrixUtil()
Method Detail

multiply

public static Matrix3D multiply(Matrix3D m,
                                Matrix3D n)
Multiplies matrix m by matrix n. The returned value is calculated as:
             x = M x N
 

Parameters:
m - the first matrix
n - the second matrix
Returns:
the resulting vector

multiply

public static Vector3D multiply(Matrix3D m,
                                Vector3D n)
Multiplies matrix m by vector n. The returned value is calculated as:
             x = M x N
 

Parameters:
m - the matrix
n - the vector
Returns:
the resulting vector

multiply

public static Matrix2D multiply(Matrix2D m,
                                Matrix2D n)
Multiplies matrix m by matrix n. The returned value is calculated as:
             x = M x N
 

Parameters:
m - the first matrix
n - the second matrix
Returns:
the resulting matrix

multiply

public static Vector multiply(Matrix2D m,
                              Vector n)
Multiplies matrix m by vector n. The returned value is calculated as:
             x = M x N
 

Parameters:
m - the matrix
n - the vector
Returns:
the resulting vector

add

public static Matrix2D add(Matrix2D m,
                           Matrix2D n)
Returns the addition of matrices m and n

Parameters:
m - the first matrix
n - the second matrix
Returns:
the addition of the two matrices

add

public static Matrix3D add(Matrix3D m,
                           Matrix3D n)
Returns the addition of matrices m and n

Parameters:
m - the first matrix
n - the second matrix
Returns:
the addition of the two matrices

getDeterminant

public static double getDeterminant(Matrix2D m)
Returns the determinant of matrix m

Parameters:
m - the matrix
Returns:
the determinant

getTrace

public static double getTrace(Matrix2D m)
Returns the trace of matrix m

Parameters:
m - the matrix
Returns:
the trace of matrix m

toTranspose

public static Matrix2D toTranspose(Matrix2D m)
Returns the transpose matrix of matrix m

Parameters:
m - the matrix
Returns:
the transpose of the matrix

toCofactor

public static Matrix2D toCofactor(Matrix2D m)
Calculates the cofactors of matrix m

Parameters:
m - the matrix
Returns:
the matrix of cofactors

invert

public static Matrix2D invert(Matrix2D m)
Performs a matrix inversion

Parameters:
m - the matrix to be inverted
Returns:
the inverted matrix


Copyright © 2009-2011. All Rights Reserved.