> ## Documentation Index
> Fetch the complete documentation index at: https://aegean.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotation as multiplication

> Complex numbers represent points in 2-D, and multiplication can rotate them. This idea leads to SO(2) and the exponential map.

This section gives you three tools that the [motion algebras chapter](/book/kinematics/index) relies on.

* **Rotation as a product.** Multiplying a complex number by $e^{i\theta}$ rotates it by $\theta$. You will see that this is the same operation as multiplying a vector by a $2 \times 2$ rotation matrix. [Rotation representations](/aiml-common/lectures/motion-algebras/rotation-representations/index) describes every rotation of a robot in the plane with that matrix.
* **The exponential map.** The formula $e^{i\theta} = \cos\theta + i\sin\theta$ turns an angle into a rotation. [Lie theory](/aiml-common/lectures/motion-algebras/lie-theory/index) builds on this map, written with matrices as $e^{\theta G}$, to connect velocities with rotations.
* **Combining and undoing rotations.** Two planar rotations combine into one by adding their angles, and every rotation can be undone. [Lie theory](/aiml-common/lectures/motion-algebras/lie-theory/index) and [SO(2) as a manifold](/aiml-common/lectures/motion-algebras/so2-manifold/index) start from these rules.

To follow the argument, you need only plane vectors and the series for $e^x$, $\cos$ and $\sin$.

## A number for a point in the plane

A real number marks a position on a line, while a point in the plane requires two numbers, $(x, y)$. A complex number combines them in one object:

$$
z = x + iy ,
$$

You draw this number at the point $(x, y)$. Its real part $x$ lies on the horizontal axis, and its imaginary part $y$ lies on the vertical axis. You can therefore regard a complex number as a two-dimensional number. Its usefulness comes from the rule for multiplying two such numbers.

## The imaginary unit as a rotation by 90 degrees

Begin with the number $1$ at the point $(1, 0)$. Multiplication by $i$ gives $i$ at $(0, 1)$. The point has rotated by $90^\circ$ about the origin.

Multiply by $i$ once more. A second quarter turn brings you to $(-1, 0)$, which represents the number $-1$. The equation $i^2 = -1$ describes these two turns:

$$
1 \xrightarrow{\;\times i\;} i \xrightarrow{\;\times i\;} -1 .
$$

This behavior applies to every point, not only $1$. For $z = x + iy$,

$$
iz = i(x + iy) = ix + i^2 y = -y + ix ,
$$

So multiplication by $i$ maps $(x, y)$ to $(-y, x)$.

The same map can be written with a matrix. A $2 \times 2$ matrix acts on a vector by multiplying it, and its two columns record where the two basis vectors go. The first column is the image of $(1, 0)$, and the second is the image of $(0, 1)$. Multiplication by $i$ sends $(1, 0)$ to $(0, 1)$ and sends $(0, 1)$ to $(-1, 0)$. Those two images are the columns of the matrix:

$$
\begin{bmatrix} -y \\ x \end{bmatrix}
=
\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}
\begin{bmatrix} x \\ y \end{bmatrix} .
$$

Lie theory names this matrix $G$. It serves the same purpose as $i$.

## Rotation by any angle

For a rotation through any angle $\theta$, choose the point $\cos\theta + i\sin\theta$ on the unit circle. Euler's formula expresses that point as an exponential:

$$
e^{i\theta} = \cos\theta + i\sin\theta .
$$

To derive the formula, use the series $e^{x} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots$ with $x = i\theta$. The powers of $i$ repeat in the order $i, -1, -i, 1$. The even terms are real, while the odd terms contain an $i$:

$$
e^{i\theta}
= \underbrace{\left(1 - \frac{\theta^2}{2!} + \frac{\theta^4}{4!} - \cdots\right)}_{\cos\theta}
+ i\,\underbrace{\left(\theta - \frac{\theta^3}{3!} + \frac{\theta^5}{5!} - \cdots\right)}_{\sin\theta} .
$$

Multiply the point $z = x + iy$ by $e^{i\theta}$, then collect its real and imaginary parts:

$$
e^{i\theta} z
= (\cos\theta + i\sin\theta)(x + iy)
= (x\cos\theta - y\sin\theta) + i\,(x\sin\theta + y\cos\theta) .
$$

Now build the matrix for this rotation the same way. Rotating $(1, 0)$ by $\theta$ gives $(\cos\theta, \sin\theta)$, and rotating $(0, 1)$ gives $(-\sin\theta, \cos\theta)$. With these images as columns, the matrix, called the rotation matrix $R(\theta)$, produces the same components:

$$
\begin{bmatrix} x\cos\theta - y\sin\theta \\ x\sin\theta + y\cos\theta \end{bmatrix}
=
\underbrace{\begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}}_{R(\theta)}
\begin{bmatrix} x \\ y \end{bmatrix} .
$$

Multiplication by $e^{i\theta}$ is therefore equivalent to multiplication by $R(\theta)$. When $\theta = 90^\circ$, you recover the quarter turn produced by $i$.

## Composing and undoing rotations

Suppose you rotate first by $\alpha$ and then by $\beta$. Complex notation combines the two rotations in one product:

$$
e^{i\beta}\, e^{i\alpha} = e^{i(\alpha + \beta)} .
$$

You compose planar rotations by adding their angles. Their order is irrelevant because $\alpha + \beta = \beta + \alpha$.

To reverse a rotation, multiply by the opposite angle, $e^{-i\theta}$. On the unit circle, this number is the conjugate of the original one. Conjugating $z = x + iy$ changes the sign of its imaginary part:

$$
\bar z = x - iy ,
$$

For $z = e^{i\theta}$, the result is $\bar z = \cos\theta - i\sin\theta = e^{-i\theta}$, and therefore $\bar z\, z = 1$.

## Two notations for planar rotations

The numbers $e^{i\theta}$ trace the unit circle, denoted by $S^1$. Their multiplication follows the same rules as multiplication of rotation matrices:

| Unit complex numbers | Rotation matrices |
| - | - |
| $e^{i\theta}$ | $R(\theta)$ |
| $e^{i\beta}e^{i\alpha} = e^{i(\alpha + \beta)}$ | $R(\beta)R(\alpha) = R(\alpha + \beta)$ |
| $1 = e^{i0}$ | identity $I$ |
| $\bar z = e^{-i\theta}$ | $R(\theta)^{-1} = R(\theta)^\top = R(-\theta)$ |

So the unit complex numbers and the rotation matrices describe the same rotations in two notations. Both follow the same rules. Combining two rotations gives another rotation. One rotation does nothing. Every rotation can be undone. [Lie theory](/aiml-common/lectures/motion-algebras/lie-theory/index) calls a set with these rules a *group*, and it names the group of planar rotation matrices SO(2). The angle $\theta$ is a coordinate on it.

The map $\theta \mapsto e^{i\theta}$ sends a number on a line to a point on a circle. This map is an exponential map. In [Lie theory](/aiml-common/lectures/motion-algebras/lie-theory/index), you write its matrix form as $e^{\theta G}$, where $G$ is the quarter-turn matrix introduced above.

***

<Callout icon="bug" iconType="regular">
  Found an error on this page? [Report an issue](https://github.com/aegean-ai/eaia-feedback/issues/new?template=page-issue.yml\&page=/aiml-common/lectures/ml-math/complex-numbers).
</Callout>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.