mpicbg.util
Class Matrix3x3

java.lang.Object
  extended by mpicbg.util.Matrix3x3
All Implemented Interfaces:
Serializable

public final class Matrix3x3
extends Object
implements Serializable

Basic operations on 3x3 double matrices.

 m00 m01 m02
 m10 m11 m12
 m20 m21 m22
 
The class provides most of the methods as static variants for matrices passed as double[]. They are always meant to be in a row after row sequence:
 m00, m01, m02, m10, m11, m12, m20, m21, m22
 

Author:
Stephan Saalfeld
See Also:
Serialized Form

Field Summary
 double m00
           
 double m01
           
 double m02
           
 double m10
           
 double m11
           
 double m12
           
 double m20
           
 double m21
           
 double m22
           
 
Constructor Summary
Matrix3x3()
          Initialize and identity matrix.
Matrix3x3(double[] m)
          Initialize a matrix with a double[].
Matrix3x3(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
          Initialize a matrix.
 
Method Summary
 Matrix3x3 clone()
           
 void concatenate(Matrix3x3 m)
          Concatenate a matrix: this = this × m
static double[] createInverse(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
           
static float[] createInverse(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
           
 double det()
          Calculate the determinant.
static double det(double[] a)
          Calculate the determinant of a matrix given as a double[] (row after row).
static double det(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
          Calculate the determinant of a matrix given by values.
static float det(float[] a)
          Calculate the determinant of a matrix given as a float[] (row after row).
static float det(float m00, float m01, float m02, float m10, float m11, float m12, float m20, float m21, float m22)
          Calculate the determinant of a matrix given by values.
 void invert()
           
static void invert(double[] m)
           
static void invert(float[] m)
           
 void preConcatenate(Matrix3x3 m)
          Pre-concatenate a matrix: this = m × this
 void reset()
          Set to identity.
 void set(Matrix3x3 m)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m00

public double m00

m01

public double m01

m02

public double m02

m10

public double m10

m11

public double m11

m12

public double m12

m20

public double m20

m21

public double m21

m22

public double m22
Constructor Detail

Matrix3x3

public Matrix3x3()
Initialize and identity matrix.


Matrix3x3

public Matrix3x3(double m00,
                 double m01,
                 double m02,
                 double m10,
                 double m11,
                 double m12,
                 double m20,
                 double m21,
                 double m22)
Initialize a matrix.

Parameters:
m00 -
m01 -
m02 -
m10 -
m11 -
m12 -
m20 -
m21 -
m22 -

Matrix3x3

public Matrix3x3(double[] m)
Initialize a matrix with a double[]. Note that the double[] elements do not reflect the content of the matrix when performing operations. They are just used to initialize it. For performing operations on the double[] directly, use the static methods of Matrix3x3.

Parameters:
m -
Method Detail

det

public final double det()
Calculate the determinant.

Returns:
determinant

det

public static final double det(double[] a)
Calculate the determinant of a matrix given as a double[] (row after row).

Parameters:
a - matrix given row by row
Returns:
determinant

det

public static final float det(float[] a)
Calculate the determinant of a matrix given as a float[] (row after row).

Parameters:
a - matrix given row by row
Returns:
determinant

det

public static final double det(double m00,
                               double m01,
                               double m02,
                               double m10,
                               double m11,
                               double m12,
                               double m20,
                               double m21,
                               double m22)
Calculate the determinant of a matrix given by values.

Parameters:
m00 -
m01 -
m02 -
m10 -
m11 -
m12 -
m20 -
m21 -
m22 -
Returns:

det

public static final float det(float m00,
                              float m01,
                              float m02,
                              float m10,
                              float m11,
                              float m12,
                              float m20,
                              float m21,
                              float m22)
Calculate the determinant of a matrix given by values.

Parameters:
m00 -
m01 -
m02 -
m10 -
m11 -
m12 -
m20 -
m21 -
m22 -
Returns:

invert

public final void invert()
                  throws NoninvertibleModelException
Throws:
NoninvertibleModelException

invert

public static final void invert(double[] m)
                         throws NoninvertibleModelException
Throws:
NoninvertibleModelException

invert

public static final void invert(float[] m)
                         throws NoninvertibleModelException
Throws:
NoninvertibleModelException

createInverse

public static final double[] createInverse(double m00,
                                           double m01,
                                           double m02,
                                           double m10,
                                           double m11,
                                           double m12,
                                           double m20,
                                           double m21,
                                           double m22)
                                    throws NoninvertibleModelException
Throws:
NoninvertibleModelException

createInverse

public static final float[] createInverse(float m00,
                                          float m01,
                                          float m02,
                                          float m10,
                                          float m11,
                                          float m12,
                                          float m20,
                                          float m21,
                                          float m22)
                                   throws NoninvertibleModelException
Throws:
NoninvertibleModelException

concatenate

public final void concatenate(Matrix3x3 m)
Concatenate a matrix: this = this × m

Parameters:
m -

preConcatenate

public final void preConcatenate(Matrix3x3 m)
Pre-concatenate a matrix: this = m × this

Parameters:
m -

set

public final void set(Matrix3x3 m)

reset

public final void reset()
Set to identity.


clone

public final Matrix3x3 clone()
Overrides:
clone in class Object


Copyright © 2007-2016 Fiji. All Rights Reserved.