|
|
@ -18,6 +18,11 @@ |
|
|
|
|
|
|
|
using namespace std; |
|
|
|
|
|
|
|
class GVector3; |
|
|
|
class GVector; |
|
|
|
class GMatrix; |
|
|
|
typedef GVector3 GPoint3; |
|
|
|
|
|
|
|
class GVector3 { |
|
|
|
private: |
|
|
|
float v[3]; |
|
|
@ -74,7 +79,6 @@ public: |
|
|
|
const float operator [](const int& idx) const;//下标获取分量 |
|
|
|
}; |
|
|
|
|
|
|
|
class GMatrix; |
|
|
|
class GVector { |
|
|
|
public: |
|
|
|
//GVector 1~2 |
|
|
@ -192,11 +196,24 @@ public: |
|
|
|
friend int Rank(const GMatrix& m);//获取矩阵的秩 |
|
|
|
friend int Nullity(const GMatrix& m);//获取矩阵的零化度 |
|
|
|
|
|
|
|
friend GMatrix Mij(const GMatrix& m, int r, int c); //计算余子式 |
|
|
|
friend GMatrix Mij(const GMatrix& m, int r, int c); //计算余子式矩阵 |
|
|
|
friend float Det(const GMatrix& m); |
|
|
|
|
|
|
|
private: |
|
|
|
int r; |
|
|
|
int c; |
|
|
|
float *m; |
|
|
|
}; |
|
|
|
|
|
|
|
class GLine { |
|
|
|
private: |
|
|
|
// l(t) = p + t*v; |
|
|
|
GPoint3 p;//端点 |
|
|
|
GVector3 v;//方向 |
|
|
|
public: |
|
|
|
GLine(const GPoint3& _p = GPoint3(0.0f, 0.0f, 0.0f), const GVector3& _v = GVector3(0.0f, 0.0f, 0.0f)); |
|
|
|
GLine(const GLine& copy); |
|
|
|
|
|
|
|
GLine& operator =(const GLine& rhs); |
|
|
|
GPoint3 operator ()(const float t) const; |
|
|
|
}; |