I don't like this proof of the rotation formula. It seems like juggling formulas without providing any motivation as to how we get there. It does a great job of explaining the problems with other notations, but in demonstrating the formula for quaternion rotation we just pull conjugation out of a hat.<p>First, let's ask what it means to rotate around an axis. If you consider rotation of a vector v in a plane A around the unit normal n, you can decompose v as follows:<p>v = proj_n(v) + proj_A(v) = vn + vA<p>Now a 90 degree rotation of v about n is<p>rot_n(90,v) = vn + n >< vA = vn + vR = (v•n)n + v >< n<p>So if we consider v rotated by an angle S around n, we can infer that vn is preserved and the image rot_n(S,vA) can be projected onto vA and vR according to the usual cosine rule for projection:<p>rot_n(S, vA) = cos(S)vA + cos(s-90)vR = cos(S)vA + sin(S)vR<p>Likewise,<p>rot_n(S, v) = cos(S)v + sin(S)rot_n(90, v) = cos(S)v + sin(S)((v•n)n + v >< n)<p>Okay, now what's wrong with this formula? What if we want to combine rotations? We're stuck, because this "multiplication" isn't associative. So we can turn this into a linear transformation and use the matrix representation, which gives a nine-dimensional algebra, although with symmetry you can make it five-dimensional. (The fifth dimension comes from the requirement that both the determinant and the L2 norm of the matrix coefficients are constant, 1 and 3 respectively.)<p>But we have perhaps heard about the quaternions, which <i>are</i> associative. And we might have noticed that Im(v*n), where * denotes quaternion multiplication and Im() discards the real part, is equal to v >< n, viewed as vectors. But multiplication under Im() isn't associative either. But we can also define Im() another way, using the apostrophe for conjugation:<p>Im(v*n) = (v*n - (v*n)')/2 = (v*n - n*v)/2<p>since (v*n)' = n'*v' = (-n)*(-v) = n*v for pure imaginary v,n, where we recall that conjugation distributes over products of quaternions at the cost of reversing the order.<p>Now what if we try to construct the rotation again:<p>rot_n(S,v) = cos(S)v + sin(S)(v*n - n*v)/2 = (v*(cos(S)+ sin(S)n) - (-cos(S) + sin(S))*v)/2 = (v*q(n,S) + q(n,S)'*v)/2<p>Here q(n,S) = cos(S) + sin(S)n is a perfectly reasonable quaternion, and we call it a rotation quaternion. This is now almost associative but not quite. If we combine rotations q and p, we end up with terms like q'*v*p. How annoying. But it feels like we're getting closer, so let's see if we can learn anything else about these "sandwich" products.<p>Geometrically, if we rotate the vector forwards and backwards, we should get the same vector. But q(n,-S) = q(n,S)', so we must find (we drop the arguments since there is only one q and we are sick of parentheses):<p>((v*q + q'*v)*q' + q*(v*q + q'*v))/4 = (v*q*q' + q*q'*v + q'*v*q' + q*v*q)/4 = v<p>Now it's not so hard to verify that q*q' = q'*q = 1, so we can subtract v/2 from both sides and clear the denominator to find the curious-looking lemma:<p>q*v*q + q'*v*q' = 2v<p>Now (q'*v*q')' = q*v'*q = -q*v*q, the last equality being established because v is imaginary. Therefore:<p>q*v*q - (q*v*q)' = 2Im(q*v*q) = 2v<p>so Im(q<i>v</i>q) = v, for <i>arbitrary</i> rotation vectors q.<p>Evidently a multiplication by q on the right <i>undoes</i> a multiplication by q on the left, at least when we are talking about imaginary parts, which we were interested in already. So what happens when we take q'*v*q — the missing sandwich in the above equation? This should give us two rotations in the same direction, since switching sides inverts the rotation and conjugation inverts it again to leave us with the same rotation. But what's the use of writing<p>rot_n(2S, v) = Im(q'*v*q)?<p>Just try it:<p>Im(q'*v*q) = (q'*v*q - (q'*v*q)')/2 = (q'*v*q - q'*v'*q)/2 = (q'*v*q + q'*v*q)/2 = q'*v*q!<p>So we now have a formula where everything is in one product. It turns out that the ugly "sandwiches" (we also call this <i>conjugation</i>, which can be confusing) are useful after all. (Explicitly verifying that q'<i>v</i>q = rot_n(2S, v) is left as an exercise for the reader. See hint [1]. ) Now if we consider a rotation by a second quaternion p, we find:<p>p'*q'*v*q*p = (q*p)'*v*(q*p)<p>by inverting the distributive property for conjugation. So we only need to take one product to combine rotations. Finally, an associative structure!<p>There is only one sticking point left. Evidently q(n,S) corresponds to the transformation rot_n(2S,v). So in order to get rot_n(S, v) we need:<p>Q(n,S) = q(n,S/2)<p>But there is one more thing. What happens when S = 360? We all know that a rotation of 360 degrees doesn't change the geometry. So shouldn't we have Q(n,360) = 1? But in fact:<p>Q(n,360) = q(n,180) = cos(180) + sin(180)n = -1!<p>Of course (-1)'v(-1) = v.<p>Evidently Q has a period of 720 degrees under rotations S rather than the usual 360, i.e., Q is a spinor. This is sometimes called a "double cover".<p>In fact, we could also represent rotations and positions with the Pauli spin matrices and complex 2-vectors respectively, although (as in quantum mechanics) we pick up a meaningless global phase, and translation is weird.<p>[1]: Consider various ways of writing parentheses on the expression Im(q*q'*v*q*q), and show that q(n,S)*q(n,S) = q(n,2S).