FEJDMath
Class Matrix22

java.lang.Object
  extended byFEJDMath.Matrix22

class Matrix22
extends java.lang.Object

Used to manipulate 2*2 matrix Note : to compute : vectleft * m * vectright use the following syntax : m.multVectLeft(vectleft).mult(vectright);


Field Summary
private  double[] mat
          The coefficients of the matrix
 
Constructor Summary
Matrix22()
          Makes a new empty matrix
Matrix22(double x, double y, double z, double t)
          Makes a new matrix with the coefficients x,y,z,t
 
Method Summary
 double det()
          Returns the determinant of the matrix
 double getNum(int a, int b)
          Returns the value of the coefficient (a,b) of the matrix (1 based as usual in math)
 Matrix22 inv()
          Returns the invert of the matrix
 Matrix22 mult(Matrix22 m)
          Returns the matrix multiplied by m
 Vector2 multVectLeft(Vector2 v)
          Returns the result of the multiplication of v and the matrix
 Vector2 multVectRight(Vector2 v)
          Returns the result of the multiplication of the matrix and v
 Matrix22 scalMult(double l)
          Returns the matrix multiplied by the scalar value l
 void setNum(int a, int b, double val)
          Sets the coefficient (a,b) of the matrix to val (1 based as usual in math)
 java.lang.String toString()
          Returns the matrix in a mathematical format
 Matrix22 transpose()
          Returns the matrix transposed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mat

private double[] mat
The coefficients of the matrix

Constructor Detail

Matrix22

public Matrix22()
Makes a new empty matrix


Matrix22

public Matrix22(double x,
                double y,
                double z,
                double t)
Makes a new matrix with the coefficients x,y,z,t

Method Detail

getNum

public double getNum(int a,
                     int b)
Returns the value of the coefficient (a,b) of the matrix (1 based as usual in math)


setNum

public void setNum(int a,
                   int b,
                   double val)
Sets the coefficient (a,b) of the matrix to val (1 based as usual in math)


det

public double det()
Returns the determinant of the matrix


inv

public Matrix22 inv()
Returns the invert of the matrix


mult

public Matrix22 mult(Matrix22 m)
Returns the matrix multiplied by m


scalMult

public Matrix22 scalMult(double l)
Returns the matrix multiplied by the scalar value l


transpose

public Matrix22 transpose()
Returns the matrix transposed


multVectLeft

public Vector2 multVectLeft(Vector2 v)
Returns the result of the multiplication of v and the matrix


multVectRight

public Vector2 multVectRight(Vector2 v)
Returns the result of the multiplication of the matrix and v


toString

public java.lang.String toString()
Returns the matrix in a mathematical format