00001 #ifndef _matrix_hh_ 00002 #define _matrix_hh_ 00003 00004 #include "vector.hh" 00005 00006 // 0 4 8 12 00007 // 1 5 9 13 00008 // 2 6 10 14 00009 // 3 7 11 15 00010 00011 // [0][0] [1][0] [2][0] [3][0] 00012 // [0][1] [1][1] [2][1] [3][1] 00013 // [0][2] [1][2] [2][2] [3][2] 00014 // [0][3] [1][3] [2][3] [3][3] 00015 00016 namespace anoid { 00017 namespace simple { 00018 00019 class Matrix { 00020 private: 00021 double _matrix[4][4]; 00022 void init(const char *s); 00023 void zero(); 00024 void identity(); 00025 public: 00029 Matrix(); 00030 00035 Matrix(const Vector &v); 00036 00042 Matrix(const Vector &a, const Vector &b, const Vector &c); 00043 Matrix(double m[4][4]); 00044 Matrix(Matrix &m); 00045 00046 Matrix(std::string &s); 00047 Matrix(char* s); 00048 00049 Vector operator*(const Vector &v) const; 00050 }; 00051 00052 }; 00053 }; 00054 00055 #endif