# Lesson 3: Warm-up: multiplying complex numbers is rotating in 2D

Source: https://quaternion.steppeschool.com/complex-numbers-2d-rotation/ (part of "Quaternions, Visually" by Steppeschool, free)

In 2D, multiplying by a complex number of length 1 is a rotation. Quaternions grow from this one fact: they do the same in 3D. So we make sure it is completely clear in 2D first.

## 3.1 A point is a number

A complex number $p = a + b\,i$ is just a point in the plane, or the arrow from 0 to that point: a steps along the real axis, b steps along the imaginary axis. The only new rule is $i^2 = -1$. The length of the arrow is $\sqrt{a^2 + b^2}$.

> **Interactive visual: A point is a number.** **Try it:** drag the point. A complex number is nothing more than this: two numbers, drawn as one point.

## 3.2 Multiplying is rotating

We start with the simplest multiplication: by the number i.

> **Interactive visual: Times i is a quarter turn.** **Try it:** press **× i** four times and read the numbers. Each press swaps the two parts and flips one sign, and the arrow makes a quarter turn.

So i is a turn by 90°. For other angles we take another number, r, that sits on the circle of radius 1, at the angle θ from the real axis:

$$r = \cos\theta + i\,\sin\theta$$

Its length is 1, because cos² θ + sin² θ = 1.

**The rule:**
- **Multiplying any point p by r turns p by the angle θ around 0.** The length of p does not change.

- So the number r *is* a rotation. Its angle on the circle is the angle of the turn.

- Do it to every point of a shape, and the whole shape turns.

> **Interactive visual: Times r is a turn by any angle.** **Try it:** move the slider. The purple arrow r moves along the unit circle to the angle θ, and the orange house, which is the green house multiplied by r, turns by exactly the same θ. Press **× i**: the number i sits at 90° on the circle, so each press is a quarter turn. Drag the green point to check that it works for any point.

## 3.3 Why it works

**With numbers first.** Take the point p = 2 + 1i, which is the arrow (2, 1), and multiply it by i:

$$(2 + 1i)\cdot i = 2i + i^2 = -1 + 2i$$

The arrow (2, 1) became (−1, 2): same length, turned by a quarter turn.

**For any angle** we multiply by $r = \cos\theta + i\sin\theta$ the same way, and use $i^2 = -1$:

$$(a + b\,i)(\cos\theta + i\sin\theta) = (a\cos\theta - b\sin\theta) + (a\sin\theta + b\cos\theta)\,i$$

The new point is x′ = a cos θ − b sin θ and y′ = a sin θ + b cos θ. This is exactly the formula for turning a point by θ in 2D.

So in 2D, a rotation is a number on the unit circle, and turning a vector is one multiplication. Two turns one after another are two multiplications, and the angles add up.

> **Interactive visual: Two turns: the angles add.** **Try it:** r₁ and r₂ are two rotations. Their product is the orange arrow. Its angle is always the sum of the two.

**Aha:** **What does $i^2=-1$ mean?** Multiplying by i turns by 90°. Doing it twice turns by 180°, and a half turn makes every vector point the other way, which is multiplying by −1. So $i \cdot i = -1$ is just "two quarter turns are a half turn".

## 3.4 From 2D to 3D

In 2D there is only one plane to turn in, so one imaginary unit i is enough. In 3D we can turn in three different planes, so we need three: i, j and k. In 1843 William Rowan Hamilton found the rules that make it work, and carved them into a bridge in Dublin:

$$i^2 = j^2 = k^2 = ijk = -1$$

A quaternion is one real part plus these three imaginary parts. We meet it properly in the next lesson.

## ✓ Check yourself

**Q: What does multiplying by −1 do to a 2D vector?**

It turns the vector by 180°.

**Q: What is $(\cos 30° + i\sin 30°)^3$?**

Three turns of 30°, so one turn of 90°: $\cos 90° + i\sin 90° = i$.

## Sources and further reading

- G. Sanderson (3Blue1Brown), "Visualizing quaternions (4d numbers) with stereographic projection", 2018 <https://www.3blue1brown.com/lessons/quaternions>: starts from the same complex-number idea, fully animated
