Skip to content

Multiplication rotates

Level: 101 → 201 · for anyone who has multiplied out (a + b)(c + d)

One line: Multiplying by a point of the plane does two things at once, scales by its distance from the origin and turns by its angle, so i² = −1 says nothing stranger than that a quarter turn done twice is a half turn.

The thing to let go of

The previous lesson defined complex multiplication as a rule on pairs and derived from it that (0, 1) · (0, 1) = (−1, 0). The algebra is two lines, and it does not help. Multiplying two things and getting something negative out of two positives is exactly what multiplication is not supposed to do. It makes no sense so long as multiplication means "make bigger by this factor".

On the plane, multiplication means something else. Multiplying by a point z does two things at once: it scales every point by the distance of z from the origin, and it turns every point by the angle of z, measured counterclockwise from the positive horizontal axis. Nothing else. The rule

(x₁, y₁) · (x₂, y₂)  =  (x₁x₂ − y₁y₂,  x₁y₂ + x₂y₁)

is "multiply the lengths, add the angles", written out in coordinates. This page checks each half of that claim exactly, and then the minus sign explains itself.

What the program prints

Verified output of multiplication_rotates.py — regenerated by tools/run_examples.py, never hand-typed.

1. MULTIPLYING BY (0, 1) IS A QUARTER TURN
   Take each compass point and multiply it by (0, 1):
     (1, 0)    east   . (0, 1) = (0, 1)    north
     (0, 1)    north  . (0, 1) = (-1, 0)   west
     (-1, 0)   west   . (0, 1) = (0, -1)   south
     (0, -1)   south  . (0, 1) = (1, 0)    east
   East to north to west to south to east: a quarter turn
   counterclockwise, every time.

2. SO (0, 1) . (0, 1) = (-1, 0) IS 'TWO QUARTER TURNS ARE A HALF TURN'
     after 1 multiplication  by (0, 1): (0, 1)    a quarter turn
     after 2 multiplications by (0, 1): (-1, 0)   a half turn
     after 3 multiplications by (0, 1): (0, -1)   three quarters turn
     after 4 multiplications by (0, 1): (1, 0)    a full turn
   A half turn sends every point to the opposite side of the origin,
   which is exactly what multiplying by -1 does. So (0, 1) squared
   behaves as -1, and that is the whole content of i^2 = -1.

3. THE TWO AXES, MULTIPLIED
   Horizontal times horizontal: angle 0 + 0, stays horizontal.
     (2, 0)    . (3, 0)    = (6, 0)
     (-4, 0)   . (5, 0)    = (-20, 0)
   Vertical times vertical: angle 90 + 90 = 180, lands on the
   NEGATIVE horizontal axis.
     (0, 3)    . (0, 2)    = (-6, 0)
     (0, 1)    . (0, 1)    = (-1, 0)
     (0, -2)   . (0, 5)    = (10, 0)
   In the usual notation the last three read 3i . 2i = -6,
   i . i = -1, and (-2i)(5i) = 10. The minus sign is the half turn.

4. LENGTHS MULTIPLY (compared as squares, so the check is exact)
     z1           z2            |z1|^2  |z2|^2  |z1 z2|^2   product of the two
     (3, 4)       (5, 12)           25     169       4225   25 x 169 = 4225
     (1, 1)       (1, 1)             2       2          4   2 x 2 = 4
     (0, 3)       (0, 2)             9       4         36   9 x 4 = 36
     (1/2, 1/3)   (-2, 5)        13/36      29     377/36   13/36 x 29 = 377/36
   |z1 z2|^2 = |z1|^2 |z2|^2 in every row, so |z1 z2| = |z1| |z2|.

5. ANGLES ADD (checked with angles that are known exactly)
   A 3-4-5 triangle gives a unit point at angle A = atan(4/3), and a
   5-12-13 triangle one at angle B = atan(12/5). Their product should
   sit at angle A + B, and there is a way to check that without ever
   computing an angle: the point at A + B, turned back by A, is at B.
     a      = (3/5, 4/5)          |a|^2 = 1
     b      = (5/13, 12/13)        |b|^2 = 1
     a . b  = (-33/65, 56/65)      |a.b|^2 = 1
     (a . b) turned back by A = (5/13, 12/13)   which is b again: True
   Turning back by A means multiplying by the mirror image (3/5, -4/5),
   the point at angle -A. It works because angles add.

6. SCALE AND TURN AT ONCE
   Multiplying (1, 0) by (0, 3) should be: turn a quarter, stretch by 3.
     (1, 0)    . (0, 3) = (0, 3)    |z|^2 = 1, |w|^2 = 9 = 9 x 1
     (2, 1)    . (0, 3) = (-3, 6)   |z|^2 = 5, |w|^2 = 45 = 9 x 5
     (-1, -1)  . (0, 3) = (3, -3)   |z|^2 = 2, |w|^2 = 18 = 9 x 2
   Every point turned a quarter turn and grew by a factor of 3.
   That is what the rule always does: multiply by the length of the
   second point, turn by its angle.

7. THE SAME THING AS A MATRIX
   'Multiply by (x, y)' is a linear map of the plane, so it is a 2x2
   matrix. Reading the rule with (x2, y2) = (x, y) fixed and (x1, y1)
   as the input column, the matrix is [[x, -y], [y, x]].
     multiply by (0, 1)        = [[0, -1], [1, 0]]
     multiply by (0, 3)        = [[0, -3], [3, 0]]
     multiply by (3/5, 4/5)    = [[3/5, -4/5], [4/5, 3/5]]
   For (0, 1) that is [[0, -1], [1, 0]], the standard quarter-turn
   matrix. Apply it to a column (x, y) and out comes (-y, x):
     [[0, -1], [1, 0]] . (1, 0)   = (0, 1)
     [[0, -1], [1, 0]] . (2, 1)   = (-1, 2)
   Square it by multiplying matrices, and by the pair rule:
     [[0, -1], [1, 0]]^2 = [[-1, 0], [0, -1]]   and (0, 1) . (0, 1) = (-1, 0)
   Both say -1 times the identity: a half turn, i^2 = -1 as a matrix.

Multiplying by (0, 1) is a quarter turn

The point (0, 1) sits at distance 1 from the origin, straight up, at an angle of 90°. So multiplying by it should leave lengths alone and turn everything a quarter turn counterclockwise. Section 1 tries it on the four compass points:

east   (1, 0)  · (0, 1)  =  (0, 1)   north
north  (0, 1)  · (0, 1)  =  (−1, 0)  west
west   (−1, 0) · (0, 1)  =  (0, −1)  south
south  (0, −1) · (0, 1)  =  (1, 0)   east

East to north to west to south and back to east. Every one is a quarter turn counterclockwise.

The second line of that table is the whole mystery, and there is nothing left of it. Start facing north, at (0, 1). Multiply by (0, 1), which means "turn a quarter turn". North turned a quarter turn is west, and west is (−1, 0), the real number −1. Section 2 does it four times over from east: a quarter turn, a half turn, three quarters, and back where you started.

A half turn sends every point to the opposite side of the origin, which is exactly what multiplying by −1 does. So (0, 1) squared behaves as −1, and i² = −1 says that two quarter turns make a half turn. That is all it says.

The two axes

Section 3 multiplies points on the axes. Two horizontal points have angle 0 each, so their product has angle 0 + 0 and stays horizontal, and only the lengths multiply: (2, 0) · (3, 0) = (6, 0). This is why the horizontal axis is the ordinary real line, and why the ordinary multiplication you know is the special case where nothing turns.

Two vertical points have angle 90° each, so their product has angle 180°: it lands on the horizontal axis, on the negative side. (0, 3) · (0, 2) = (−6, 0), which in the usual notation is 3i · 2i = −6. Vertical times vertical does not stay vertical; it jumps to the negative reals, and the jump is the half turn. The general form is (0, y₁) · (0, y₂) = (−y₁y₂, 0). The minus sign is not an algebraic accident; it is the direction west.

Lengths multiply

A point's distance from the origin is √(x² + y²), and a program that took that square root would be comparing rounded floats. So section 4 compares squared lengths, which are exact in fractions, and checks that

|z₁z₂|²  =  |z₁|² |z₂|²

in every case: 25 × 169 = 4225 for (3, 4) times (5, 12), and 13/36 × 29 = 377/36 for a pair with fractional coordinates. If the squares multiply, so do the lengths. This is the same identity the previous lesson met as Brahmagupta's two-squares identity, now read as geometry: the product is as long as the two lengths multiplied.

Angles add

Angles are harder to check exactly, because most angles are irrational numbers of degrees and most points' angles cannot be written down at all. Section 5 sidesteps that with points whose angles are exact by construction. The 3-4-5 triangle gives the unit point a = (3/5, 4/5) at some angle A; the 5-12-13 triangle gives b = (5/13, 12/13) at some angle B. Neither angle is ever computed. Instead:

If angles add, then a · b sits at angle A + B, and turning it back by A must land on b again.

Turning back by A means multiplying by the mirror image (3/5, −4/5), the point at angle −A. The program computes a · b = (−33/65, 56/65), multiplies by the mirror image, and gets (5/13, 12/13) exactly. It is b. The angles added.

(Written in cosines and sines, a · b = (cos A cos B − sin A sin B, sin A cos B + cos A sin B), and the two components are the angle-addition formulas for cos(A + B) and sin(A + B). The rule and the formulas are the same fact.)

Both at once

Section 6 multiplies three points by (0, 3), which is distance 3 at angle 90°. Every one turns a quarter turn and its squared length grows by 9, so its length grew by 3. Scale by the length, turn by the angle, and that is what the rule always does.

So here is complex multiplication with the algebra removed. To multiply by z: stretch the plane by |z|, then turn it by the angle of z. Points on the positive real axis have angle 0 and only stretch, which is the multiplication of school. Points on the vertical axis turn you sideways, and turning sideways twice leaves you facing backwards. That backwards is the minus sign, and it is the only new thing.

The same thing as a matrix

"Multiply by z" sends a point of the plane to a point of the plane, and it does so linearly, so it is a 2 × 2 matrix. Reading the rule with (x₂, y₂) = (x, y) held fixed and (x₁, y₁) as the input column gives

multiply by (x, y)  =  [ x  −y ]
                       [ y   x ]

and section 7 prints that matrix for a few points. For (0, 1) it is

[ 0  −1 ]   [ x ]     [ −y ]
[ 1   0 ] · [ y ]  =  [  x ]

which is the standard matrix of a quarter turn counterclockwise, and (x, y) ↦ (−y, x) is what the pair rule gave in section 1. Square that matrix by ordinary matrix multiplication and the result is −1 times the identity, the matrix that scales every vector by −1. Square (0, 1) by the pair rule and the result is (−1, 0). They are the same computation in two notations, and both say the half turn.

So if matrices feel more solid than pairs, the whole chapter can be read that way: a complex number x + yi is the matrix [[x, −y], [y, x]], addition is matrix addition, and complex multiplication is matrix multiplication. Every such matrix is a scaling by √(x² + y²) composed with a rotation, and the products of two of them is again one of them. The pair rule is just the shortcut for multiplying two matrices of that shape.

Run it yourself

From the root of your clone of this repository:

python3 03_Complex_Numbers/multiplication_rotates/examples/multiplication_rotates.py

Po polsku, w skrócie

Mnożenie liczb zespolonych na płaszczyźnie robi dwie rzeczy naraz: mnoży długości i dodaje kąty. Mnożenie przez punkt z rozciąga całą płaszczyznę tyle razy, ile wynosi odległość z od początku układu, i obraca ją o kąt, pod którym leży z. Punkt (0, 1), czyli i, leży w odległości 1 pod kątem 90°, więc mnożenie przez i to po prostu ćwierćobrót w lewo: wschód przechodzi na północ, północ na zachód. Stąd i² = −1 przestaje być zagadką: dwa ćwierćobroty to półobrót, a półobrót przenosi każdy punkt na drugą stronę początku układu, czyli robi to samo co mnożenie przez −1.

Program sprawdza obie połowy dokładnie, na ułamkach. Kwadraty długości się mnożą. Kąty się dodają, co widać bez liczenia żadnego kąta: iloczyn obrócony z powrotem o pierwszy kąt daje drugi punkt. Ta sama reguła zapisana macierzą to [[x, −y], [y, x]], a dla i to zwykła macierz obrotu o 90°. Na tym ćwierćobrocie opiera się tożsamość Eulera: prędkość i · położenie to położenie obrócone o 90°, więc punkt krąży po okręgu.

Auf Deutsch: Stichwörter

Multiplizieren streckt um den Betrag und dreht um das Argument: Beträge multiplizieren sich, Winkel addieren sich.

Stichwörter: Drehung (rotation), Streckung, Betrag, Argument (Winkel), Polarform, Satz von de Moivre, Multiplikation mit i als Vierteldrehung.

See also