(a + i b + j c + k d)+(e + i f + j g + k h) = (a+e) + i ( b+f) + j ( c+g) + k ( d+h)
a*e – b*f – c*g – d*h + i (b*e + a*f + c*h- d*g) + j (a*g – b*h+ c*e + d*f) + k (a*h + b*g – c*f + d*e) |
The simple answer to the question is, given:
R = [w, x, y, z]
P = [0, p1, p2, p2]
R' = [w, -x, -y, -z]
You can calculate the resulting vector using the hamilton product H(a, b) (described here: http://en.wikipedia.org/wiki/Quaternion#Hamilton_product) by:
P' = RPR'
P' = H(H(R, P), R')
In the example given these are:
R = [0.7071203316249954, 0.0, 0.7071203316249954, 0.0]
R' = [0.7071203316249954, 0.0, -0.7071203316249954, 0.0]
P = [0, 1, 0, 0]
H(R, P) = [0.0, 0.7071203316249954, 0.0, -0.7071203316249954]
H(H(R, P), R') = [0.0, 0.0, 0.0, -1.0000383267948871]
Notice the result is a length 4 vector; the w component will always be zero and can be discarded.
Ie. The point (1, 0, 0) is transformed by a rotation around the Y-axis by 90 degrees and becomes (0, 0, -1)
For those unfamiliar with quaternions, it’s worth noting that the quaternion R is generated as described here (http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation):
a = angle to rotate
[x, y, z] = axis to rotate around
R = [cos(a/2), sin(a/2)*x, sin(a/2)*y, sin(a/2)*z]
So to accomplish this:
qDelta = qCurr * ^qLast
P2=qDelta * P1 * ^qDelta
QTransition = QFinal * QInitial^{-1}
Quatertenions Transforms Derivations
Spinor
A spinor represents a transform where a rotation of 360° inverts the object. To restore the object to its original orientation we need to rotate by 720°.