# Why Rotations (in CG) are not linear?

One of my teachers told me that a fundamental problem in Computer Graphics is that the rotations are not linear. The transations and scalar are linear, but not the rotations. He tried to explain to me why rotations were not linear, but I didn’t understand at all. Not to mention my undertanding about the linearity concept is weak.

Does anyone has a simple for-dummies explanation about why rotations are not linear?

My math is very simple, so I’ve looking for an explanation that’s basic and simple.

Thanks a lot ðŸ™‚

#### Solutions Collecting From Web of "Why Rotations (in CG) are not linear?"

Affine Linear Transformations

There can be a bit of confusion about what a “linear function” is. On one hand,
$$y=a+bx\tag{1}$$
describes a line, and is often called a linear function.

On the other hand, a function between vector spaces defined by matrix multiplication
$$y=Mx\tag{2}$$
is also called a linear transformation.

There are also functions called Affine Linear Transformations, which combine these two notions. They are compositions of a linear transformation and a translation.
$$\begin{bmatrix} r\\ s \end{bmatrix} = \begin{bmatrix} a&b\\ c&d \end{bmatrix} \begin{bmatrix} x\\ y \end{bmatrix} + \begin{bmatrix} h\\ k \end{bmatrix}\tag{3}$$
An affine transformation in $\mathbb{R}^2$ can be viewed as a linear transformation on a plane in $\mathbb{R}^3$.

For example, on the plane $z=1$ in $\mathbb{R}^3$, the linear transformation
$$\begin{bmatrix} r\\ s\\ 1 \end{bmatrix} = \begin{bmatrix} a&b&h\\ c&d&k\\ 0&0&1 \end{bmatrix} \begin{bmatrix} x\\ y\\ 1 \end{bmatrix}\tag{4}$$
has the same effect as the affine transformation in $(3)$.

This is often how affine transformations are performed in computer graphics.

Perspective Transformations

The preceding approach can be generalized to perspective transformations by replacing the two zeros in the bottom row of the matrix in $(4)$ with non-zero numbers and by using the perspective projection between $\mathbb{R}^2$ and $\mathbb{R}^3$:
$$\begin{bmatrix} x\\ y \end{bmatrix} \to \begin{bmatrix} x\\ y\\ 1 \end{bmatrix} \quad\text{and}\quad \begin{bmatrix} x\\ y\\ z \end{bmatrix} \to \begin{bmatrix} x/z\\ y/z \end{bmatrix}\tag{5}$$
That is,
$$\begin{bmatrix} x\\ y \end{bmatrix} \to \begin{bmatrix} r\\ s\\ t \end{bmatrix} = \begin{bmatrix} a&b&h\\ c&d&k\\ u&v&1 \end{bmatrix} \begin{bmatrix} x\\ y\\ 1 \end{bmatrix} \to \begin{bmatrix} r/t\\ s/t \end{bmatrix}\tag{6}$$

I think what was meant by your teacher is that, while a rotation is a linear map, the set of all rotations is not a linear space. This is in contrast to translations and scalar multiplications, which do form linear spaces. The fact that rotations do not form a linear space indeed does cause difficulties. For example, given two points in a linear space, it is very easy to construct a path connecting the two points (just take a line segment). Finding a path of roations connecting two given rotations is a more difficult task.

A rotation around a fixed origin is certainly linear — we can write down the corresponding rotation matrix. However, the rotation of a object about some axis or point other than the origin cannot be represented as a rotation matrix in standard coordinates (and hence it is not linear). We can immediately see that this fails the linearity criterion because the origin is not preserved under a rotation centered away from the origin.

Imagine that the origin is the Sun. Assuming that the Earth’s orbit is circular (it’s not, but just assuming), then the Earth’s motion around the Sun is the trajectory generated by a rotation matrix. But the Earth is not just rotating about the Sun, it is also rotating about its axis. With respect to the Sun origin, such a motion cannot be generated by a rotation matrix.