1 2 3 4 5 6 7 8 9 10 | //are two vectors orthogonal? vxd::t v1(4); vxd::t v2(4); v1 << -2, 3, 1, 4; v2 << 1, 2, 0, -1; co(v1.dot(v2), "v1.dot(v2)"); | cs |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | vxd::t v1(3); vxd::t v2(3); vxd::t v3(3); vxd::t v4(3); v1 << 2, -1, 3; v2 << 4, -1, 2; //find v3 which is projection of v1 on v2 //and v4 which is projection of v1 on orthogonal vector of v3(or v2) v3 = v_proj(v1, v2); v4 = v1 - v3; co(v3, "v3"); co(v4, "v4"); | cs |
'Linear Algebra' 카테고리의 다른 글
[Eigen] reviewing linear algebra day.4 , slicing and redicing (0) | 2019.05.26 |
---|---|
[Eigen] 복습 3일차, Linear combination algorithm (0) | 2019.05.25 |
[Eigen] 아이겐을 사용한 선형대수 복습 1일차 (0) | 2019.05.21 |
[Eigen] extracting a vector from the vector space (0) | 2019.05.21 |
[Eigen]Blocking (0) | 2019.05.21 |