# What’s the difference between an orientation and a rotation?

This question came up at work recently, and I was unable to find a really good answer online. For the purposes of this article, I will be using the terms orientation and rotation as they are used in computer graphics; this might not be the same definitions you are used to.

If you search online for what the difference is between a rotation and an orientation, then you get several seemingly conflicting answers:

• ‘An orientation is given by Euler angles, whereas a rotation is given by a quaternion.’
• ‘An orientation is the destination that you reach at the end of a rotation; the rotation is the route to that destination.’
• ‘Orientations only allow you to rotate from $$0$$ to $$360$$ degrees, whereas rotations allow you to go beyond $$360$$ degrees.

I think the last of these is the one that comes closest. In the two-dimensional case, the answer is easy: an orientation is an element of $$SO(2)$$ (i.e., confusingly, a rotation matrix), whereas a rotation also comes equipped with a winding number about the origin. If we want, we can identify orientations of 2D space with elements of the circle $$S^1$$ and rotations with real numbers. Then we have a continuous function $$\lambda$$ from rotations to orientations given by $$\lambda(x) = e^{2\pi i x}$$.

This continuous map $$\lambda$$ has an important property: it is a covering map. This means that if $$z$$ is some orientation, then there is some open neighbourhood $$U$$ of $$z$$ such that $$\lambda\inv U$$ is the union of disjoint open sets, each mapped homeomorphically on to $$U$$ by $$\lambda$$. This means that if $$x$$ is a rotation, and we modify the corresponding orientation $$\lambda(x)$$ very slightly, to get an orientation $w$ then we can get a corresponding modified rotation $$y$$ such that $$\lambda(y) = w$$.

This means that, for example, if we were filming a rotating object then, assuming our frame rate were fast enough, we could track the overall rotation of the object over time by capturing its orientation at each frame. Why might we want to do this?

Let’s look at an example. There’s a game called Getting Over It with Bennett Foddy, in which you control a character named Diogenes who lives in a barrel. The only way Diogenes can get around is by moving a hammer in circles around his body. The player controls the hammer by moving the mouse around, and the tip of the hammer follows the mouse point.

In the real game, he can move the hammer in a full circle. But let’s suppose instead that he was unable to move the hammer through the bottom of the circle — perhaps the barrel is in the way.
If we only keep track of the orientation of the the mouse cursor around the centre of the rotation, we are at risk of introducing some graphical glitches. Suppose the player moves the mouse in a straight line right through the bottom of the barrel. Then we will move very suddenly from this position

to this one.

Since we would like to give the impression of continuous motion, this is undesirable. If, however, we keep track of the overall rotation of the mouse cursor, then the game will know that it should not jump to the second position, because the rotation is $$390^\circ$$, rather than $$30^\circ$$.

Now the input to the game is given by the mouse position: loosely speaking, an orientation. Therefore, the property of covering spaces that we have mentioned above is crucial: as long as we can assume that we are sampling the mouse position quickly enough, we can translate the changing mouse orientations into chainging rotations, which the game can then understand.

Another way to understand this is to recall that covering maps satisfy a property called path lifting: if $$p \colon X \to Y$$ is a covering map, $$\gamma \colon [0,1] \to Y$$ is a path in $$Y$$ and $$x$$ is a point in $$X$$ such that $$p(x) = \gamma(0)$$, then there is a path $$\hat{\gamma} \colon [0,1] \to X$$ such that $$\hat{\gamma}(0) = x$$ and $$p\circ\hat{\gamma} = \gamma$$.

The covering map $$\lambda$$ of $$S^1$$ by the real line is particularly important, because the real line is simply connected, meaning that it is in fact a universal cover for $$S^1$$. A universal cover is defined as a covering map whose source is simply connected, but the word universal refers to the fact that we can prove that any other covering map must factor through the universal cover. There are infinitely many coverings maps on to the circle (indeed, take the map from $$S^1$$ to itself given by $$e^{i\theta} \mapsto e^{ni\theta}$$ for any $$n$$), but the real line is the one that stores the most information.

An important fact about universal covers $$p \colon U \to X$$, which we shall come back to later, is that the order of the cover (i.e., the order of the set $$p^{-1}({x})$$ for any $$x$$) is the same as the order of the fundamental group of $$X$$. $$S^1$$ has fundamental group $$\mathbb Z$$, so there are infinitely many rotations corresponding to any particular orientation.

A fact in topology is that any space $$X$$ that is connected, locally path-connected and semilocally simply-connected admits a universal cover [If you are ever bored in an airport, get out some paper and work out the proof. If you, like most people, don’t know what ‘semilocally simply-connected’ means, don’t look it up – just start writing out the proof and work it out for yourself.]. It therefore makes sense to generalize our discussion above to $$n$$ dimensions as follows.

• An orientation of $$\mathbb R^n$$ is an element of $$SO(n)$$.
• A rotation of $$\mathbb R^n$$ is an element of the (technically, a) universal cover of $$SO(n)$$.

This brings us back to the second answer at the top of the article, because the elements of the univeral cover of a space $$X$$ may be identified with homotopy classes of paths in $$X$$ from a fixed source point $$x_0$$. Therefore (up to homotopy) a rotation of $$\mathbb R^n$$ really does encode the history of all the orientations that an object has been through, where the word ‘history’ is taken in the most basic sense imaginable: a path through the space of orientations.

That ‘(up to homotopy)’ becomes a lot more important in $$n>2$$ than in $$2$$ dimensions, however. In two dimensions, there is not much difference between two homotopic paths around the circle: they might travel at different speeds for different parts of the journey, or one might overshoot the target and double back. But the two paths are still clearly the same rotation in some sense. In three dimensions and above, more complicated homotopies between paths. Watch the rotating candles in this Balinese candle dance, for example.

The candles rotate about the up-down axis by two full rotations, yet the dancers’ arms are completely untwisted at the end. This reflects a fact about $$SO(3)$$: a rotation of $$360^\circ$$ is not homotopic to the identity, but a rotation of $$720^\circ$$ is. In fact, the fundamental group of $$SO(3)$$ is $$\mathbb Z/2$$, which means that its universal cover is a double cover: there are precisely two rotations corresponding to each orientation of 3D space.

This might not be a problem if we wanted to extend our man-in-a-barrel example to 3D space. In that case, we didn’t really need to track infinitely many rotations around the centre: just being able to tell when we’d gone slightly more than a full rotation round was enough. But for more complicated linkages of multiple joints, this mathematical fact can lead to problems that are very difficult to solve.

Where do quaternions come into this? The simple answer is that the space of unit quaternions is the universal cover for $$SO(3)$$. That is, the universal cover of $$SO(3)$$ is the $$3$$-sphere $$S^3$$, and if we identify $$S^3$$ with the unit quaternions then the covering map commutes with quaternion multiplication and multiplication of matrices. Therefore, we can store rotations of 3D space with quaternions (four numbers), while orientations require less nice representations such as matrices (nine numbers) or Euler angles (three numbers, but without the nice properties of covering maps).