For the simplicity, we'll consider two 3D points, that moves one relatively to other, in time. Let's say:
at moment t0, we have P1(0,0,0) and P2(0,2,0)
at moment t1, P1 is still (0,0,0) but P2 changed to (0,2,2).
I need to compute the rotation of P2 relatively to P1, at moment t1, represented as quaternion. From what I've understood reading about quaternions, is that, at moment t0, Q1 (representing P1) and Q2 (representing P2) will be both (0, 0, 0, 0).
But at the moment t1, Q2 will become something else (w, x, y, z). How do I calculate the Q2 at t1 moment?
I've googled a lot on this subject, but I was able to find only rotation between quaternions. I will appreciate any guidance. Thanks!
Note that
|P2(t0)| ≠ |P2(t1)|, so you'll have to do a rotation as well as a scaling.So the question is: convert a rotation of 45° CW and a scale factor of
√2into a single quaternion representation.The axis-angle representation of a quaternion
qiswith
Sthe scale factor,ax,ayandazthe axis of rotation andwthe scalar part of the quaternion. A 45° CW rotation as you describe is a rotation about the positivez-axis by a negative angle (CCW is always positive), which translates intowith
a = -45° = -45·π/180 rad. For the scale factorS— we know thatwith
q’the conjugate,pthe original vector,p’the new vector and×the Hamilton product. The rules of the Hamilton product imply thatfor any scalar constant
c, so thatwhich means for your problem
so that finally,