calculating dual quaternion from two vectors
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Coordinate Transformations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!