Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/math/matrix.h @ 10030

Last change on this file since 10030 was 9110, checked in by bensch, 18 years ago

orxonox/trunk: merged the Presentation back

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