calculating dual quaternion from two vectors
조회 수: 22 (최근 30일)
이전 댓글 표시
hi, i have two points (vectors) and i would like to calculate the rotation between them using quaternions. as i understand quaternion only give me the rotation, there fore if there is a translation between the two points as well the results i would get for the rotation angles are not good. i have read that to represent a rotation and translation using quaternion i need to uses the dual quaternion. i know how to calculate a quaternion between two points and then extract the rotation angles:
p1 = [1,0,0]; p2 = [0,1,0];
u = cross(p1,p2)/norm(cross(p1,p2));
alpha = acos(dot(p1,p2)/(norm(p1)*norm(p2)));
q = [cos(alpha/2), sin(alpha/2)*u(1), sin(alpha/2)*u(2), sin(alpha/2)*u(3)]
[roll, pitch, yaw] = quat2angle(q,'XYZ')
the question is how do i calculate a dual quaternion between two points?
thank you for your help.
댓글 수: 0
채택된 답변
Matt J
2014년 10월 30일
편집: Matt J
2016년 1월 17일
I think you've under-posed your problem. There is no unique rotation and translation relating just two points. Given only 2 points p1 and p2, you can always just say that they are related by translation p2-p1 and zero rotation.
On the other hand, if you have 2 groups of points each group with 3 or more non-colinear points, then a quaternion-based solver for the roto-translation between them is here,
댓글 수: 1
Matt J
2014년 11월 1일
Dany commented:
you are right. i do have several points in each data set, there fore i could use the solver in the link you provided. thank you
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Quaternion Math에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!