calculating dual quaternion from two vectors
14 次查看(过去 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 中查找有关 Coordinate Transformations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!