# Quaternions, Rotations and Real numbers

I haven't really formally studied Algebra at anywhere near this level, but I was told about the existence of Quaternions a few years ago and I find them really cool. I also like how pure quaternions are analogous to cross products in $R^3$, and that it gives me a way of doing it algebraically rather than relying on hand rules.

Over the course of using them it's my understanding that multiplying an element by another, both imaginary numbers, rotates it in some manner so as to be orthogonal to both, similar to rotations of $\frac{\pi}{2}$ in the space with one real and one imaginary axis when multiplied by $i$, which is why it's useful for cross products as it will rotate it to be orthogonal to a plane spanned by linear combinations of those two vectors [afaik].

What I can't intuit though is why for any pure quaternion multiplication, there's a negative real part [the scalar product] if it's meant to correspond to a rotation within $R^3$ and the space of pure Quaternions is Isomorphic to $R^3$. Similarly I don't understand why $i^2 = j^2 = k^2 =$ A negative real.

• It is not contradictory : the space of pure quaternions is stable for addition and multiplication by a scalar (it's even a sub(vector) space) but not stable for multiplication (of a quaternion with another quaternion). – Jean Marie Dec 10 '17 at 19:54
• I wasn't trying to imply that it's contradictory, just that I don't understand it. What does it mean for a subspace to stable or unstable under an operation? That all points under an operation lie within the same subspace? – Phase Dec 10 '17 at 19:56
• Yes, that's it. Concerning the fact that $i^2=j^2=k^2=-1$ : as $i,j,k$ play a same role and we want $\mathbb{C}$ to be included into $\mathbb{H}$ (quaternions), we end up with three "copies" of $\mathbb{C}$... – Jean Marie Dec 10 '17 at 20:01
• Some time ago, I have made a kind of "survey" of different ways to "see" a quaternion (math.stackexchange.com/q/1917093), mainly through the prism of matrices implementation. – Jean Marie Dec 10 '17 at 20:06

Don't try interpret quaternion multiplication $q_1 q_2$ as immediatedly connected to rotations; it's more indirect.

The operation which performs a rotation is $q u q^*$, where $u$ is a pure vector quaternion (to be rotated), and $q$ is a unit quaternion $$q = \cos(\alpha/2) + \sin(\alpha/2) \, n ,$$ where $n$ is a unit vector giving the axis of rotation, and $\alpha$ is the angle of rotation. (And $q^* = \cos(\alpha/2) - \sin(\alpha/2) \, n$ is the conjugate.)

Then a general quaternion (a constant times a unit quaternion) can be thought of as representing a linear transformation which is a combination of a rotation and a scaling, and the multiplication of two quaternions is an algebraic way of computing the composition of two such linear transformations: $$q_1 \bigl( q_2 u q_2^* \bigr) q_1^* = (q_1 q_2) u (q_1 q_2)^* .$$ For example, a pure vector (unit) quaternion performs a 180 degree rotation around the corresponding axis, but when you compose two 180 degree rotations you don't get a new 180 degree rotation, unless the two axes of rotation happen to be orthogonal. So it makes perfect sense to have a scalar part (nonzero in general) in the quaternion product; it is related to the angle of the composed rotation.

• That makes sense thanks, is there a way of formulating this in terms of Matrices? Given the $q^{-1}uq$ reminds me of a basis change of a hermitian $u$ and it's matrix of eigenvectors $q$. – Phase Dec 11 '17 at 12:15
• Well, it depends on what you mean really, but maybe what you are looking for is the Lie group $SU(2)$. – Hans Lundmark Dec 11 '17 at 13:35
• @DavidK: Ah, yes, you're right. For a unit quaternion, $q^*$ and $q^{-1}$ coincide, so it doesn't matter for rotations, but if we want to do scaling, it's of course a bad idea to cancel that effect by using the inverse... And if $\sin(\alpha/2)=1$, then of course it's half the angle $\alpha$ which is 90 degrees. Will fix. Thanks! – Hans Lundmark Dec 11 '17 at 14:40

Let's start by considering the uses of multiplication of complex numbers, since that is how you tried to derive an intuition about quaternions being suitable for rotation in $\mathbb R^3.$

First, it might be worth noting that to use complex numbers for rotation, we use multiplication, and that although $\mathbb C$ is in some ways isomorphic to $\mathbb R^2,$ the field of $\mathbb C$ with multiplication is not isomorphic to $\mathbb R^2,$ at least not in the sense that we would have "guessed" the rules for complex multiplication just by looking at obvious operations to perform on $\mathbb R^2.$ See an answer to an earlier question for further discussion.

Now let's consider the function $f(x) = \cos x.$ This is a transformation on $\mathbb R,$ that is, a function $\mathbb R\to\mathbb R$; its input and output are strictly one-dimensional. But we can also write $f(x) = \Re[e^{ix}],$ that is, we can use complex numbers (which are two-dimensional in this context) to express a one-dimensional operation. This seems to add a lot of unnecessary complexity (pun intended) to something that really only needs one dimension, not two, but electrical engineers and physicists find that this "unnecessary complexity" actually simplifies a lot of calculations.

You could think of rotation by quaternions in a similar way: as an "unnecessary" extra dimension added to the three-dimensional space of the objects you want to rotate, which happens to be handy for calculation. We allow intermediate steps of the calculation to have this fourth dimension, but in the end we will be back in three dimensions again.

As for how to make sense of the fact that $i^2 = j^2 = k^2 = -1,$ we need to review some details of how calculations with quaternions relate to rotation in $\mathbb R^2.$ Referring to an answer to another previous question, we can write a quaternion in the form $$q = w + ix + jy + kz,$$ and define the conjugate of the same quaternion as $$q^* = w - ix - jy - kz,$$ that is, the conjugate has the same real part but opposite imaginary parts. We can also view the imaginary parts of a quaternion as a vector in $\mathbb R^3,$ so $\mathbb R^3$ is (in this sense) isomorphic to the set of purely imaginary quaternions.

Then if we take a purely imaginary quaternion $r$ and a unit quaternion $q$ (such that $qq^* = 1$), the product $$r' = qrq^*$$ gives the same result $r'$ that we would get if we made the usual identification of $r$ with a vector in $\mathbb R^3$ and rotated it by an angle $\theta$ around an axis $\hat n = (n_x, n_y, n_z),$ where $$q = \cos\frac\theta2 + (in_x + jn_y + kn_z)\sin\frac\theta2.$$

Notice that $q$ can be purely imaginary only if $\cos\frac\theta2 = 0.$ A purely imaginary quaternion corresponds to a rotation by $\pi$ radians ($180$ degrees). Perform the same rotation twice, and you come back to where you started. So it works out nicely that $i^2 = -1,$ because if we perform the "$i$" rotation twice, the result is $$r' = i^2 r (i^2)^* = (-1)r(-1) = r,$$ as it should be.

That $i^2 = j^2 = k^2 = -1$ is related to that two rotations à $90^\circ$ give a rotation of $180^\circ$ which reflects (two) axes, i.e. multiply the $x$, $y$ or $z$ values with $-1$.

• That isn't really relevant, I understand that multiplying a vector by a negative number gives it's additive inverse, I was talking about Multiplication of Pure Quaternions giving a real part. – Phase Dec 10 '17 at 23:10
• My answer wasn't about $(-1)u = -u$. I tried to explain $i^2 = j^2 = k^2 = -1$ in terms of rotations. But your question was rather just "why are quaternions defined so that $i^2 = j^2 = k^2 = -1$"? – md2perpe Dec 11 '17 at 7:01
• It's the first, but I understand algebraically why it gives $-1$, it was more why it seemed that something that is analogous to rotations in $R^3$ can, under multiplication, no longer be contained in a space isomorphic to it. I didn't know the ideas of a subspace being stable or unstable – Phase Dec 11 '17 at 12:12