raytracer.internal
Class Matrix

java.lang.Object
  |
  +--raytracer.internal.Matrix

public class Matrix
extends java.lang.Object

A 4x4 matrix for operations with homogenous coordinates in three dimensions


Constructor Summary
Matrix()
          Creates an empty (not unified!)
Matrix(float a, float b, float c, float d, float e, float f, float g, float h, float i, float j, float k, float l, float m, float n, float o, float p)
          Creates a matrix with the given paramters. a-d are the elements in the first row, e-h second row...
 
Method Summary
 float get(int row, int col)
          Returns an entry from the matrix
 Matrix mulLeft(Matrix a)
          Returns a new matrix object which is A*THIS
 Matrix mulLeftTrans(Matrix a)
          Returns a new matrix object which is At*THIS
 Matrix mulRight(Matrix a)
          Returns a new matrix object which is THIS*A
 Matrix mulRightTrans(Matrix a)
          Returns a new matrix object which is THIS*At
 void unify()
          Initializes the matrix as a unit matrix
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matrix

public Matrix()
Creates an empty (not unified!) matrix


Matrix

public Matrix(float a,
              float b,
              float c,
              float d,
              float e,
              float f,
              float g,
              float h,
              float i,
              float j,
              float k,
              float l,
              float m,
              float n,
              float o,
              float p)
Creates a matrix with the given paramters. a-d are the elements in the first row, e-h second row...

Method Detail

get

public float get(int row,
                 int col)
Returns an entry from the matrix

Parameters:
row - Row of the requested entry
col - Column of the requested entry
Returns:
Matrix entry

unify

public void unify()
Initializes the matrix as a unit matrix


mulLeft

public Matrix mulLeft(Matrix a)
Returns a new matrix object which is A*THIS


mulRight

public Matrix mulRight(Matrix a)
Returns a new matrix object which is THIS*A


mulLeftTrans

public Matrix mulLeftTrans(Matrix a)
Returns a new matrix object which is At*THIS


mulRightTrans

public Matrix mulRightTrans(Matrix a)
Returns a new matrix object which is THIS*At