multigraph
Class Matrix3x3

java.lang.Object
  extended bymultigraph.Matrix3x3

public class Matrix3x3
extends java.lang.Object

This class represents a 3x3 matrix, with a few operations that are commonly needed in 2D computer graphics applications.

Version:
$Id: Matrix3x3.java,v 1.1.1.1 2004/11/30 22:30:41 mphillips Exp $
Author:
Mark Phillips
See Also:
R3Vector

Field Summary
 double[][] M
          A 3x3 array that actually holds the matrix
 
Constructor Summary
Matrix3x3()
          Create a new Matrix3x3; the newly created matrix is not necessarily initialized to anything.
 
Method Summary
 void copyFrom(Matrix3x3 src)
          Copy the contents of a matrix to this one.
 void identity()
          Set this matrix to the identity.
static Matrix3x3 Identity()
          Return a new matrix initialized to the identity matrix.
 Matrix3x3 inverse()
          Return a new matrix which is the inverse of this one.
static Matrix3x3 multiply(Matrix3x3 A, Matrix3x3 B)
          Multiply two matrices A and B, returning a new matrix which is the product A*B.
 R3Vector multiply(R3Vector v)
          Multiply a vector v by this matrix (on the left), returning the resulting vector this*v.
 java.lang.String toString()
          Return a string representation of this matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

M

public double[][] M
A 3x3 array that actually holds the matrix

Constructor Detail

Matrix3x3

public Matrix3x3()
Create a new Matrix3x3; the newly created matrix is not necessarily initialized to anything.

Method Detail

Identity

public static Matrix3x3 Identity()
Return a new matrix initialized to the identity matrix.


identity

public void identity()
Set this matrix to the identity.


multiply

public static Matrix3x3 multiply(Matrix3x3 A,
                                 Matrix3x3 B)
Multiply two matrices A and B, returning a new matrix which is the product A*B.


copyFrom

public void copyFrom(Matrix3x3 src)
Copy the contents of a matrix to this one.


inverse

public Matrix3x3 inverse()
Return a new matrix which is the inverse of this one. Results are undefined (probably will raise a division by 0 exception?) if this matrix is not invertible.


multiply

public R3Vector multiply(R3Vector v)
Multiply a vector v by this matrix (on the left), returning the resulting vector this*v.


toString

public java.lang.String toString()
Return a string representation of this matrix.