Strange behaviour of vrrotvec. What is [0 0 0] axis?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have such an example:
v0 = [0 0 -1]; v1 = [0 0 1];
q = vrrotvec(v0, v1);
So, as I understand, v1 is v0 rotated by 180 degrees in x-axis. But I get q = [0 0 0 pi]
Why?
댓글 수: 0
채택된 답변
Antti
2012년 7월 10일
편집: Antti
2012년 7월 10일
Actually the rotation could be 180 degrees about any axis that is in the xy-plane, like the y-axis. So the x-axis is not the only correct answer.
To me it seems that the function is not working well. In this case there are infinite choices of correct axis, so the function should return at least one correct axis, for example the y-axis or the x-axis.
However, the axis matters if you want to do this rotation for a 3D body. For a 3D-body the result is different if you rotate 180 degrees about x-axis, or 180 degrees about y-axis. But from those two vectors, it is not possible to determine, whether you want a rotation about x-axis, or y-axis or some other axis in xy-plane.
댓글 수: 0
추가 답변 (1개)
Jan Danek
2012년 7월 20일
Hi Evgheny and Antti,
Thanks for pointing at this. We have corrected the behaviour of this function, as of MATLAB R2012b it will provide a valid axis for parallel / anti-parallel input vectors.
vrrotvec function is to determine the VRML rotation that will rotate the first input vector to the second. It is written as to find the minimal angle that will do that 0;pi.
Best regards,
Jan
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Axes Transformations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!