org.metasyntactic.graphics.primitives
Class Matrix

java.lang.Object
  |
  +--org.metasyntactic.graphics.primitives.Matrix

public class Matrix
extends java.lang.Object


Field Summary
static Matrix IDENTITY
           
 
Constructor Summary
Matrix()
           
Matrix(double[] cells)
           
Matrix(double[][] cells)
          Creates a new instance of Matrix
 
Method Summary
 Matrix add(Matrix m)
           
 double getCell(int row, int column)
           
 Matrix inverse()
           
static void main(java.lang.String[] args)
           
 Matrix multiply(Matrix m)
           
 Point multiply(Point p)
           
 Vector multiply(Vector v)
           
static Matrix rotation(Vector v, double theta)
           
static Matrix scaling(double x, double y, double z)
           
 java.lang.String toString()
           
static Matrix translation(double x, double y, double z)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IDENTITY

public static final Matrix IDENTITY
Constructor Detail

Matrix

public Matrix()

Matrix

public Matrix(double[][] cells)
Creates a new instance of Matrix


Matrix

public Matrix(double[] cells)
Method Detail

getCell

public double getCell(int row,
                      int column)

translation

public static Matrix translation(double x,
                                 double y,
                                 double z)

inverse

public Matrix inverse()

add

public Matrix add(Matrix m)

multiply

public Matrix multiply(Matrix m)

multiply

public Vector multiply(Vector v)

multiply

public Point multiply(Point p)

rotation

public static Matrix rotation(Vector v,
                              double theta)

scaling

public static Matrix scaling(double x,
                             double y,
                             double z)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)