net.sourceforge.arbaro.transformation
Class Matrix

java.lang.Object
  extended by net.sourceforge.arbaro.transformation.Matrix

public final class Matrix
extends java.lang.Object

A 3x3 matrix class

Author:
Wolfram Diestel

Constructor Summary
Matrix()
           
Matrix(double xx, double xy, double xz, double yx, double yy, double yz, double zx, double zy, double zz)
           
 
Method Summary
 Matrix add(Matrix M)
          Adds the matrix to another
 Vector col(int c)
           
 Matrix div(double factor)
          Divids the matrix by a value
 double get(int r, int c)
           
 Matrix mul(double factor)
           
 Matrix prod(Matrix M)
           
 Vector prod(Vector v)
          Multiplies the matrix with a vector
 Vector row(int r)
           
 void set(int r, int c, double value)
           
 Matrix sub(Matrix M)
          Substracts a matrix
 java.lang.String toString()
           
 Matrix transpose()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Matrix

public Matrix()

Matrix

public Matrix(double xx,
              double xy,
              double xz,
              double yx,
              double yy,
              double yz,
              double zx,
              double zy,
              double zz)
Method Detail

toString

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

row

public Vector row(int r)

col

public Vector col(int c)

get

public double get(int r,
                  int c)

set

public void set(int r,
                int c,
                double value)

transpose

public Matrix transpose()

mul

public Matrix mul(double factor)

prod

public Matrix prod(Matrix M)

add

public Matrix add(Matrix M)
Adds the matrix to another

Parameters:
M - the matrix to be added
Returns:
the sum of the two matrices

prod

public Vector prod(Vector v)
Multiplies the matrix with a vector

Parameters:
v - the vector
Returns:
The product of the matrix and the vector

div

public Matrix div(double factor)
Divids the matrix by a value

Parameters:
factor - the divisor
Returns:
The matrix divided by the value

sub

public Matrix sub(Matrix M)
Substracts a matrix

Parameters:
M - the matrix to be subtracted
Returns:
The result of subtracting another matrix