norm : distance of vector
1 2 3 4 5 | v3d::t v; v << -3, 2, 1; co(v.norm() * v.norm(),"v.norm() * v.norm()"); | cs |
unit vector : vector which of norm is one.
1 2 3 4 5 6 7 8 9 10 11 | v3d::t v; v << -3, 2, 1; co(v.norm() * v.norm(),"v.norm() * v.norm()"); v3d::t unitVector; unitVector = 1 / v.norm() * v; co(unitVector, "unitVector"); co(unitVector.norm(), "unitVector.norm()"); | cs |
these kind of operations referred as a normalizing
standard unit vector : vector of same direction with axis in 2D or 3D space which of norm is one.i.e..(1,0,0) , (0,1,0), (0,0,1)
cos theta from inner production between two vectors :
1 2 3 4 5 6 7 8 9 10 11 12 | v3d::t v1; v3d::t v2; v1 << 0, 0, 1; v2 << 0, 2, 2; co(v1.norm() ,"v1.norm() "); co(v2.norm() ,"v2.norm() "); co(v1.dot(v2),"v1.dot(v2) "); co( deg_rad(acos(v1.dot(v2) / (v1.norm() * v2.norm())) ) , "cosin Theta ") ; | cs |
result :
1 2 3 4 5 6 7 8 | v1.norm() = 1 v2.norm() = 2.82843 v1.dot(v2) = 2 cosin Theta = 45 | cs |
'Linear Algebra' 카테고리의 다른 글
[Eigen] 복습 3일차, Linear combination algorithm (0) | 2019.05.25 |
---|---|
[Eigen] 복습 2일차 (0) | 2019.05.22 |
[Eigen] extracting a vector from the vector space (0) | 2019.05.21 |
[Eigen]Blocking (0) | 2019.05.21 |
[Eigen] Linear algebra and decompositions (0) | 2019.05.21 |