| [5673] | 1 | /*! | 
|---|
 | 2 |  * @file matrix.h | 
|---|
 | 3 |  * @brief Definition of a 3x3 matrix. | 
|---|
 | 4 |  */ | 
|---|
 | 5 |  | 
|---|
| [5664] | 6 | #include <math.h> | 
|---|
| [5673] | 7 | #include "vector.h" | 
|---|
| [5662] | 8 |  | 
|---|
| [5696] | 9 | //! Matrix is a 3x3 Matrix class with most important functions | 
|---|
| [5662] | 10 | class Matrix | 
|---|
 | 11 | { | 
|---|
 | 12 |   public: | 
|---|
| [5692] | 13 |     Matrix() : m11(0), m12(0), m13(0), m21(0), m22(0), m23(0), m31(0), m32(0), m33(0) { }; | 
|---|
 | 14 |  | 
|---|
| [5663] | 15 |     Matrix ( float m11, float m12, float m13, | 
|---|
 | 16 |              float m21, float m22, float m23, | 
|---|
| [5696] | 17 |              float m31, float m32, float m33 ); | 
|---|
 | 18 |     Matrix(const float m[3][3]); | 
|---|
| [5663] | 19 |  | 
|---|
| [5696] | 20 |     Matrix operator+ (const Matrix& m) const; | 
|---|
 | 21 |     Matrix operator- (const Matrix& m) const; | 
|---|
 | 22 |     Matrix operator* (float k) const; | 
|---|
 | 23 |     Vector operator* (const Vector& v) const; | 
|---|
| [5663] | 24 |  | 
|---|
| [5696] | 25 |     Matrix getTransposed() const; | 
|---|
 | 26 |     void toVectors(Vector& m1, Vector& m2, Vector& m3) const; | 
|---|
| [5663] | 27 |  | 
|---|
| [5696] | 28 |     float getDeterminant() const; | 
|---|
| [5663] | 29 |  | 
|---|
| [5675] | 30 |     int getEigenValues(Vector& eigenVectors) const; | 
|---|
| [5668] | 31 |     void getEigenVectors(Vector& a, Vector& b, Vector& c) const; | 
|---|
| [5664] | 32 |  | 
|---|
| [5697] | 33 |     /** @returns the Identity-Matrix (diagonal 3x3 with 1's everywhere) */ | 
|---|
 | 34 |     static Matrix identity() { return Matrix(1,0,0, 0,1,0, 0,0,1); } | 
|---|
| [5664] | 35 |  | 
|---|
| [5663] | 36 |     void debug() const; | 
|---|
 | 37 |  | 
|---|
 | 38 |   public: | 
|---|
| [5697] | 39 |     float m11;              //!< Matrix Entry [0][0] | 
|---|
 | 40 |           float m12;        //!< Matrix Entry [0][1] | 
|---|
 | 41 |                 float m13;  //!< Matrix Entry [0][2] | 
|---|
 | 42 |     float m21;              //!< Matrix Entry [1][0] | 
|---|
 | 43 |           float m22;        //!< Matrix Entry [1][1] | 
|---|
 | 44 |                 float m23;  //!< Matrix Entry [1][2] | 
|---|
| [5698] | 45 |     float m31;              //!< Matrix Entry [2][0] | 
|---|
 | 46 |           float m32;        //!< Matrix Entry [2][1] | 
|---|
| [5697] | 47 |                 float m33;  //!< Matrix Entry [2][2] | 
|---|
| [5662] | 48 | }; | 
|---|