From 22b233242bab0159b6f4ecd61560f689fb946d96 Mon Sep 17 00:00:00 2001 From: blobt Date: Thu, 25 Mar 2021 15:24:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=AF=E5=AF=86=E7=89=B9=E6=AD=A3=E4=BA=A4?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vs/3dMath/v15/.suo | Bin 43520 -> 43520 bytes main.cpp | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/.vs/3dMath/v15/.suo b/.vs/3dMath/v15/.suo index 07efb70fbf28e959ae2cb3950ac8db0cbcc2ea40..cceb55c37c07c8dd8213d39e22437f00154c4031 100644 GIT binary patch delta 1637 zcmd6nO>9(E6vyAa^E#c^c>`1E$CQ~mGj-ZdDV9=WV*G4vLrYuAS5RY&u~>8#v{*Z{ zuu0p8D5yZJ@3@eJk6}8Hu*13T#5jR2VAlkUF|J5l>4rr~+{oj9hBu{6G%jq3_;J3EO+f=sx~ysz3gV zh*HKoCl=_Q*9ll~%JUl-UJ`o!%hiyofDUSaAJhU4xe;>!3;_dF0+=0qSu?>p+OM~Y z7P_E^MUqbIM;q6>9_+lg`D@&bo((o*c;FU z7WqFZJ3J~5CC*T$`b1&NqA+=xcfIVUmWNFJzt@=S)N>nj8vUS|E=@*M&+|Wd?7HiL z(vP+#y;322r5*W~p72?FltZH_3r&lH`aGS~9oN-gy_N^Xsp$8kr|c&fLI6WK z`-RMPOX_-KOpU#HMifQ{gpZrG5C9m7vZVk$K8n}~YctTZk7BcJZ_?dRI*s~5LX zabb+|QxSVxGW1+eIyL_O(8sB+p0VwN{d*5hbsgBTed5Eyq$QQL$r9u_d^cLT5;R%l z=JVCdSL*)_T1X(UHI<-z^V?-v<? zenim-j%+;-h=zo9^k0Xx=nvk5R!rAq zAcGHTe$YC}h-{1aQqxY`6e)Rjr(r=*8(vUp<{?-KwS-*+j_n}%G@+j0BG?JX2^`8s zQX_1`SJV*H5rZah;tlmJ?_k-2t$65V9lOll#UV4`kO)|p+kgMHk65;0T9jCdVz8Rn zrfae2Cg%-On2yRxGEAzn%cOYDq@Jl-=e4IuA13$+jf4<^qcoJ|PLgcbOmYWdJE4UT zB=`xu7bwf!B=->76$QW4x?zwne125Zs?UZ)=C9{RTd}qFgpHkVk;4KZhrzm#{G#?{ zK-KL*r(2a?_h;Z_GS$GfZ2|L}R?oWry| z11Ws4D+5WHb{q%!?fyfitanA@2dmi0b+2y1n@K|&a|UGlSG2aOU0nC9>3eB`ukEo* zL>CAj2W2quGf2_=2nrt32~<7ovdfe30G~(KaXg>!Xf0t(08zfpj>a$)m*#CjfldC$7SW}C1MvdWZU^PsJ0R`(NKTFmw3)aR2n-p661r&Pmz(XsYc3sasjk9FkK;em<=*cg{2z4je!P({jxNzIE&*PRzlitqI{p$5nN=nF z_U6i5*ug7qd!#RwicR;YPoEx3b&Ln1VKl5{*s8M$V3% z?-=*vk9j|oz9k3#N&G#`G~*77UfxW6J@4eiE=T0Z#AIx0Ur#B2$9NDg=YvrC;+@3z zV3Ba`9>77o)ZHSED%@*}#vJH>f}-&2o9Rc6tKkNm4?nASA87A6@WzqY#JRC!xE8L* SrG%x@T#L&efn2`TYyAuPZ41Z% 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