I have 2 vectors, U1 and V1 (from origin) in 3D space, together forming a plane P1. The vectors then both changes to U2 and V2 (still from origin) forming a new plane P2. Is there there a way to obtain the quaternion representing the rotation between P1 and P2?
Quaternion between 2 3D planes
1
$\begingroup$
quaternions
-
0Hmm... you're right. Is it possible to find a quaternion that maps correctly? – 2011-08-22
1 Answers
2
I'll just post the full answer thanks to Shiyu in the comments. I'm an engineer and programmer, so the writing is probably not the way a mathematician would want to read it.
N1 = U1.cross(V1) N2 = U2.cross(V2) N1.normalize(), N2.normalize() Vector M = N1+N2 M.normalize() Vector axis = M.cross(N2) angle = M.dot(N2) Quaternion q(w=angle, x=axis.x, y=axis.y, z=axis) q.normalize()
-
0This works well when the plane is rotate about an arbitary rotation. But not when the plane is rotated about the normal vector. What I mean is U1/V1 and U2/V1 are different but lie still on the same plane. In this simple case the rotation would be the angle between U1/U2 or V1/V2. In the answers above this rotation is not calculated in. How can this calculated in? – 2012-11-12