calculating dual quaternion from two vectors
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Matt J
il 30 Ott 2014
Modificato: Matt J
il 17 Gen 2016
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 Commento
Matt J
il 1 Nov 2014
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
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Coordinate Transformations in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!