diff --git a/.vs/3dMath/v15/.suo b/.vs/3dMath/v15/.suo index 07efb70..cceb55c 100644 Binary files a/.vs/3dMath/v15/.suo and b/.vs/3dMath/v15/.suo differ diff --git a/main.cpp b/main.cpp index 30436e0..c08221c 100644 --- a/main.cpp +++ b/main.cpp @@ -9,9 +9,25 @@ int main() { GVector3 v2(-1, 1, -1); GVector3 v3(0, -2, -2); + //斯密特正交化 GVector3 w1 = v1; GVector3 w2 = v2 - proj(v2, w1); //cout << w2 << endl; GVector3 w3 = v3 - proj(v3, w1) - proj(v3, w2); //cout << w3 << endl; + //normalize + w1 = w1 / norm(w1); + w2 = w2 / norm(w2); + w3 = w3 / norm(w3); + + GMatrix M1(3, 3); + M1.SetRowVec(0, w1); + M1.SetRowVec(1, w2); + M1.SetRowVec(2, w3); + cout << M1 << endl; + + GMatrix M2 = Transpose(M1); + cout << M2 << endl; + + cout << M1 * M2 << endl; return 0; } \ No newline at end of file