Rotate 1 by N vector
조회 수: 2 (최근 30일)
이전 댓글 표시
Hello, everyone. Is there a way (function) in Matlab to rotate a row vector of N dimensions by a given angle? I've only been able to use the matrix multiplication for 2D and 3D cases.
Thanks!
댓글 수: 5
Jan
2018년 3월 10일
I consider this as not complicated:
R = eye(numel(u)) + ...
(v * u.' - u * v.') * sin(a) + ...
(u * u.' + v * v.') * (cos(a) - 1);
Here u and v are two orthogonal unit vectors to describe the n-dimensional hyperplane to rotate in. Remember, that in 3D one vector is sufficient to define a plane to rotate in, but in 4D (and N-D), this is not unique anymore. a is the angle in radians to rotate, and the direction is from u to v.
I publish this in the FileExchange currently.
답변 (2개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Gravitation, Cosmology & Astrophysics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!