Index: trunk/src/lib/math/matrix.cc
===================================================================
--- trunk/src/lib/math/matrix.cc	(revision 5663)
+++ trunk/src/lib/math/matrix.cc	(revision 5664)
@@ -4,12 +4,4 @@
 #include "matrix.h"
 
-
-class Vector
-{
-  public:
-    Vector (float x, float y, float z) { this->x=x; this->y = y; this->z = z; };
-  float x, y, z;
-  inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); }
-};
 
 void Matrix::eigVl(const Matrix& mat)
@@ -79,7 +71,33 @@
   }
 
-  Matrix M = *this -  Matrix::identity() * eigValue[0];
 
-  float u11, u12, u13, u22, u23, u33;
+  // EigenVectors
+  for (int i = 0; i < 3; ++i)
+  {
+    printf (":: i = %d\n", i);
+    Matrix M = *this -  Matrix::identity() * eigValue[i];
+    Vector m1, m2, m3;
+
+    M.getTransposed().toVectors(m1, m2, m3);
+
+    Vector u1, u2, u3;
+
+    u1 = m2.cross(m3); u1 /= u1.len();
+    u2 = m3.cross(m1); u2 /= u2.len();
+    u3 = m1.cross(m2); u3 /= u3.len();
+
+    printf("%f, %f, %f\n", u1.x, u1.y, u1.z);
+    printf("%f, %f, %f\n", u2.x, u2.y, u2.z);
+    printf("%f, %f, %f\n", u3.x, u3.y, u3.z);
+
+//     u1 = M*u1;
+//     u2 = M*u2;
+//     u3 = M*u3;
+//
+//     printf("%f, %f, %f\n", u1.x, u1.y, u1.z);
+//     printf("%f, %f, %f\n", u2.x, u2.y, u2.z);
+//     printf("%f, %f, %f\n", u3.x, u3.y, u3.z);
+//     printf("\n\n");
+  }
 
   this->debug();
Index: trunk/src/lib/math/matrix.h
===================================================================
--- trunk/src/lib/math/matrix.h	(revision 5663)
+++ trunk/src/lib/math/matrix.h	(revision 5664)
@@ -1,2 +1,16 @@
+#include <math.h>
+
+/// @todo TAKE THIS OUT
+class Vector
+{
+  public:
+    Vector() {this->x = this->y = this->z = 0; };
+    Vector (float x, float y, float z) { this->x=x; this->y = y; this->z = z; };
+    inline const Vector& operator/= (float f) {if ((f == 0.0)) {this->x=0;this->y=0;this->z=0;} else {this->x /= f; this->y /= f; this->z /= f;} return *this; };
+
+    float x, y, z;
+    inline Vector cross (const Vector& v) const { return Vector(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x ); }
+    inline float len() const { return sqrt (x*x+y*y+z*z); }
+};
 
 
@@ -13,8 +27,7 @@
       this->m21 = m21; this->m22 = m22; this->m23 = m23;
       this->m31 = m31; this->m32 = m32; this->m33 = m33;
-    }
+    };
 
-    Matrix operator+ (const Matrix& m)
-    {
+    Matrix operator+ (const Matrix& m) {
       return Matrix (this->m11 + m.m11, this->m12 + m.m12, this->m13 + m.m13,
                      this->m21 + m.m21, this->m22 + m.m22, this->m23 + m.m23,
@@ -22,6 +35,5 @@
     }
 
-    Matrix operator- (const Matrix& m)
-    {
+    Matrix operator- (const Matrix& m) {
       return Matrix (this->m11 - m.m11, this->m12 - m.m12, this->m13 - m.m13,
                      this->m21 - m.m21, this->m22 - m.m22, this->m23 - m.m23,
@@ -29,6 +41,5 @@
     }
 
-    Matrix operator* (float k)
-    {
+    Matrix operator* (float k) {
       return Matrix(this->m11 - k, this->m12 - k, this->m13 - k,
                     this->m21 - k, this->m22 - k, this->m23 - k,
@@ -36,5 +47,27 @@
     }
 
-    static Matrix identity() {  return Matrix (1,0,0, 0,1,0, 0,0,1);    }
+    Vector operator* (const Vector& v) {
+      return Vector (this->m11*v.x + this->m12*v.y + this->m13*v.z,
+                     this->m21*v.x + this->m22*v.y + this->m23*v.z,
+                     this->m31*v.x + this->m32*v.y + this->m33*v.z );
+
+    }
+
+
+    Matrix getTransposed() {
+      return Matrix( this->m11, this->m21, this->m31,
+                     this->m12, this->m22, this->m32,
+                     this->m13, this->m23, this->m33);
+    }
+
+    void toVectors(Vector& m1, Vector& m2, Vector& m3) {
+      m1 = Vector(this->m11, this->m12, this->m13);
+      m2 = Vector(this->m21, this->m22, this->m23);
+      m3 = Vector(this->m31, this->m32, this->m33);
+    }
+
+
+    /// @todo optimize
+    static Matrix identity() { return Matrix (1,0,0, 0,1,0, 0,0,1); }
 
     void eigVl(const Matrix& matrix);
