Quaternions
I don&#x27;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&#x27;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 &gt;&lt; vA = vn + vR = (v•n)n + v &gt;&lt; 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 &gt;&lt; n)<p>Okay, now what&#x27;s wrong with this formula? What if we want to combine rotations? We&#x27;re stuck, because this &quot;multiplication&quot; isn&#x27;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 &gt;&lt; n, viewed as vectors. But multiplication under Im() isn&#x27;t associative either. But we can also define Im() another way, using the apostrophe for conjugation:<p>Im(v*n) = (v*n - (v*n)&#x27;)&#x2F;2 = (v*n - n*v)&#x2F;2<p>since (v*n)&#x27; = n&#x27;*v&#x27; = (-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)&#x2F;2 = (v*(cos(S)+ sin(S)n) - (-cos(S) + sin(S))*v)&#x2F;2 = (v*q(n,S) + q(n,S)&#x27;*v)&#x2F;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&#x27;*v*p. How annoying. But it feels like we&#x27;re getting closer, so let&#x27;s see if we can learn anything else about these &quot;sandwich&quot; products.<p>Geometrically, if we rotate the vector forwards and backwards, we should get the same vector. But q(n,-S) = q(n,S)&#x27;, so we must find (we drop the arguments since there is only one q and we are sick of parentheses):<p>((v*q + q&#x27;*v)*q&#x27; + q*(v*q + q&#x27;*v))&#x2F;4 = (v*q*q&#x27; + q*q&#x27;*v + q&#x27;*v*q&#x27; + q*v*q)&#x2F;4 = v<p>Now it&#x27;s not so hard to verify that q*q&#x27; = q&#x27;*q = 1, so we can subtract v&#x2F;2 from both sides and clear the denominator to find the curious-looking lemma:<p>q*v*q + q&#x27;*v*q&#x27; = 2v<p>Now (q&#x27;*v*q&#x27;)&#x27; = q*v&#x27;*q = -q*v*q, the last equality being established because v is imaginary. Therefore:<p>q*v*q - (q*v*q)&#x27; = 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&#x27;*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&#x27;s the use of writing<p>rot_n(2S, v) = Im(q&#x27;*v*q)?<p>Just try it:<p>Im(q&#x27;*v*q) = (q&#x27;*v*q - (q&#x27;*v*q)&#x27;)&#x2F;2 = (q&#x27;*v*q - q&#x27;*v&#x27;*q)&#x2F;2 = (q&#x27;*v*q + q&#x27;*v*q)&#x2F;2 = q&#x27;*v*q!<p>So we now have a formula where everything is in one product. It turns out that the ugly &quot;sandwiches&quot; (we also call this <i>conjugation</i>, which can be confusing) are useful after all. (Explicitly verifying that q&#x27;<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&#x27;*q&#x27;*v*q*p = (q*p)&#x27;*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&#x2F;2)<p>But there is one more thing. What happens when S = 360? We all know that a rotation of 360 degrees doesn&#x27;t change the geometry. So shouldn&#x27;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)&#x27;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 &quot;double cover&quot;.<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&#x27;*v*q*q), and show that q(n,S)*q(n,S) = q(n,2S).