Adding and multiplying: moving, turning and scaling
Adding a complex number slides the whole plane, multiplying by a real number stretches it, and multiplying by i turns it a quarter turn. Together they show what every product does: it multiplies the lengths and adds the angles.
Describe adding u as sliding every point of the plane along the arrow of u, and draw a sum tip to tail.
Show that multiplying by i turns every point a quarter turn anticlockwise about 0, sending (a, b) to (−b, a).
Explain why the product uz has the length of u times the length of z, and the angle of z plus the angle of u.
Check the length and the angle of a product in Python with math.hypot and math.atan2.
In review. The maths and code on this page are checked by automated tests on every change, but an independent reader has not signed it off yet. Spot a mistake or a confusing step? Tell us.
The question
The last lesson multiplied \({z = 3 + 4i}\) by \({u = 1 + i}\) and got \({-1 + 7i}\). Now plot the three numbers. The product is exactly \(\sqrt{2}\) times as long as \(z\), and \(\sqrt{2}\) is the length of \(u\). It points \(45^\circ\) further round than \(z\), and \(45^\circ\) is the angle of \(u\). Is that a coincidence, or is it what multiplying always does? The transformers of modern language models use the answer to mark where each word sits (DL05.3).
From the last lesson
1. Where does the number \(i\) sit in the complex plane?
Show answer
At the point \({(0, 1)}\), one unit straight up from 0. This lesson shows why it belongs there.
2. What is the modulus of \({-1 + 7i}\)?
Show answer
\({\sqrt{(-1)^2 + 7^2}} = {\sqrt{50}} = {5\sqrt{2}}\), about 7.0711.
Intuition
Draw every complex number as an arrow from 0 to its point. Then adding and multiplying become two ways of moving the plane.
M01.9.2-F1
Adding \({u = 1 + i}\) slides \(z\) one step across and one step up. Multiplying by \(u\) turns \(z\) by \(45^\circ\), the angle of \(u\), and stretches it by \(\sqrt{2}\), the length of \(u\).
Adding \(u\) slides. The sum \({z + u}\) is \(z\) moved by the arrow of \(u\): draw \(u\) again from the tip of \(z\), tip to tail, as in M01.2.4. Every point of the plane moves by the same arrow, so a shape slides without turning and without changing size.
Multiplying by \(u\) turns and stretches. The product \(uz\) is the arrow of \(z\) turned about 0 by the angle of \(u\), and stretched from 0 by the length of \(u\). Here the angle of a number is the angle of its point, measured anticlockwise from the positive real axis as in M01.5.2, and its length is its modulus. For \({u = 1 + i}\) the angle is \(45^\circ\) and the length is \(\sqrt{2}\), so \({z = 3 + 4i}\), at \(53.13^\circ\), becomes an arrow at \(98.13^\circ\) that is \(\sqrt{2}\) times longer: \({-1 + 7i}\).
In one line: lengths multiply and angles add. The rest of this lesson shows why.
Build it up
Step 1. Adding slides. By the rule for sums, \({z + u = (a + c) + (b + d)i}\): the point of \(z\) moved \(c\) across and \(d\) up, which is the arrow of \(u\). The same arrow moves every point.
Step 2. Multiplying by a real number stretches. If \(r\) is a real number, then \({r(a + bi) = ra + rbi}\): both parts are multiplied by \(r\). For \({r > 0}\) the point moves along the same line through 0 to \(r\) times the distance, because the triangle with legs \(ra\) and \(rb\) is a scaled copy of the one with legs \(a\) and \(b\) (M01.5.1). For \({r = -1}\) the point goes to \({(-a, -b)}\), straight through 0 to the other side: a half turn.
Step 3. Multiplying by \(i\) turns a quarter turn. Work it out:
\[
\begin{aligned}
i(a + bi) &= ai + bi^2 \\
&= -b + ai .
\end{aligned}
\]
So the point \({(a, b)}\) goes to \({(-b, a)}\). Why is that a quarter turn? The arrow to \({(a, b)}\) is \(a\) steps to the right and then \(b\) steps up. Turn the picture a quarter turn anticlockwise about 0: “to the right” becomes “up”, and “up” becomes “to the left”. So the turned arrow is \(a\) steps up and then \(b\) steps to the left, which ends at \({(-b, a)}\). Its length is still \({\sqrt{b^2 + a^2}}\). For \({z = 3 + 4i}\), the turned number \(iz\) is \({-4 + 3i}\).
M01.9.2-F2
Multiplying by \(i\) again and again walks \(z\) round a circle a quarter turn at a time. The triangle with sides 3 and 4 turns with it, and after four turns it is back where it started.
Step 4. \({i^2 = -1}\) is two quarter turns. Multiplying by \(i\) twice turns a half turn, which takes every point straight through 0 to the other side. That is what multiplying by \({-1}\) does (Step 2). The rule that looked strange in M01.9.1 is a fact about turning: two quarter turns make a half turn. Four make a whole turn, so \({i^4 = 1}\).
Step 5. Multiplying by any \({u = c + di}\). The distributive law splits the product in two:
\[
uz = (c + di)z = cz + d(iz) .
\]
So \(uz\) is reached by \(c\) steps along \(z\) and then \(d\) steps along \(iz\), which is \(z\) turned a quarter turn and just as long as \(z\). Compare the walk that draws \(u\) itself: \(c\) steps to the right, then \(d\) steps up. It is the same walk, with “to the right” now meaning along \(z\), “up” now meaning along \(iz\), and every step \(\abs{z}\) long instead of 1.
The formal statement
NoteResult: what a product does
For complex numbers \(z\) and \(u\), neither of them 0, the product \(uz\) has
\[
\begin{aligned}
\text{length:}\quad & \abs{uz} = \abs{u}\,\abs{z} , \\
\text{angle:}\quad & \text{angle of } z + \text{angle of } u .
\end{aligned}
\]
The angle may need a whole turn of \(360^\circ\) added or taken away to bring it between \({-180^\circ}\) and \(180^\circ\), the range that atan2 reports. The next lesson calls the angle the argument, \(\arg z\), and measures it in radians.
Proof. Write \({u = c + di}\).
The distributive law gives \({uz = cz + d(iz)}\), as in Step 5.
By Step 3, \(iz\) is \(z\) turned a quarter turn anticlockwise, with the same length \(\abs{z}\).
Now turn the whole plane about 0 through the angle of \(z\), and then enlarge it from 0 by the factor \(\abs{z}\). The point 1, at angle \(0^\circ\) and distance 1, lands on the point at the angle of \(z\) and at distance \(\abs{z}\), which is \(z\) itself. The point \(i\), a quarter turn further round than 1, lands a quarter turn further round than \(z\) at the same distance, which is \(iz\).
Turning and enlarging carry every walk along with them. The walk of \(c\) steps along 1 and then \(d\) steps along \(i\) ends at \(u\). It becomes the walk of \(c\) steps along \(z\) and then \(d\) steps along \(iz\), which ends at \({cz + d(iz) = uz}\). So \(uz\) is the point \(u\), turned through the angle of \(z\) and enlarged by \(\abs{z}\).
Turning about 0 adds the angle of \(z\) to the angle of every point, and enlarging multiplies every distance from 0 by \(\abs{z}\). So the angle of \(uz\) is the angle of \(u\) plus the angle of \(z\), and its length is \(\abs{z}\,\abs{u}\).
The length can also be seen in one triangle. The walk 0, then \(cz\), then \(uz\) has a right angle at \(cz\), because \(iz\) is at right angles to \(z\). Its legs are \(\abs{c}\,\abs{z}\) and \(\abs{d}\,\abs{z}\), so it is the triangle with legs \(\abs{c}\) and \(\abs{d}\) that draws \(u\), enlarged by \(\abs{z}\). Scaled copies (M01.5.1) have all their sides in the same ratio, so the hypotenuse is \(\abs{z}\) times \(\abs{u}\), as exercise 3 of M01.9.1 found by algebra.
Go deeper: negative steps, and why the proof never used the angle-addition formulas
If \(c\) or \(d\) is negative, the walk goes backwards along \(z\) or along \(iz\). Nothing in the proof changes: a backward step along 1 becomes a backward step along \(z\), so the turned and enlarged walk still ends at \(uz\). Exercise 3 below walks \({(2 - i)z}\) with a backward step.
The proof used only the arithmetic of M01.9.1 and the picture of a turn, never the sine or the cosine of a sum of two angles. That matters, because lesson M01.9.3 derives those angle-addition formulas of M01.5.4 from this result. Some books, Beck and others among them, go the other way and use the formulas to prove this result; a route that starts from the formulas cannot then prove them.
Worked example
Multiply \({z = 3 + 4i}\), of length 5 and angle \(53.13^\circ\), by \(i\) and by \({u = 1 + i}\).
Times \(i\). By Step 3, \({iz = -4 + 3i}\). Its length is \({\sqrt{16 + 9} = 5}\), unchanged. Its angle, from atan2(3, -4) as in M01.5.2, is \(143.13^\circ\), which is \({53.13^\circ + 90^\circ}\): a quarter turn.
Times \({u = 1 + i}\). Here \({c = 1}\) and \({d = 1}\), so the product is one step along \(z\) and then one step along \(iz\):
\[
\begin{aligned}
uz &= 1 \times z + 1 \times iz \\
&= (3 + 4i) + (-4 + 3i) \\
&= -1 + 7i .
\end{aligned}
\]
M01.9.2-F3
The product as a walk: one step along \(z\), then one step along \(iz\). The triangle that draws \(u\) has been enlarged 5 times and laid along \(z\).
The right triangle with corners 0, \(z\) and \(uz\) has two legs of length 5, so its hypotenuse is \(5\sqrt{2}\), about 7.0711, and its angle at 0 is \(45^\circ\). Measured from the real axis, the product points at \({53.13^\circ + 45^\circ = 98.13^\circ}\). The direct checks agree: \({\abs{-1 + 7i} = \sqrt{50} = 5\sqrt{2}}\), and atan2(7, -1) is \(98.13^\circ\).
Code
The product on pairs, as in M01.9.1, with two helpers: the length from math.hypot, and the angle from math.atan2, which takes \(y\) first and answers in radians, so math.degrees converts it.
import mathdef multiply(z, u): a, b = z c, d = ureturn (a * c - b * d, a * d + b * c)def length(z):return math.hypot(z[0], z[1]) # the distance from 0def angle(z):return math.degrees(math.atan2(z[1], z[0])) # imaginary part first, then real partz, u = (3, 4), (1, 1)p = multiply(z, u)print("product:", p)print("length of the product:", round(length(p), 4), " |z| times |u|:", round(length(z) * length(u), 4))print("angle of the product: ", round(angle(p), 2), " angle of z plus angle of u:", round(angle(z) + angle(u), 2))
product: (-1, 7)
length of the product: 7.0711 |z| times |u|: 7.0711
angle of the product: 98.13 angle of z plus angle of u: 98.13
Multiplying by \(i\), the pair (0, 1), four times in a loop walks the point round and home:
point = (3, 4)for step inrange(5):print(step, point) point = multiply((0, 1), point) # multiply by i
0 (3, 4)
1 (-4, 3)
2 (-3, -4)
3 (4, -3)
4 (3, 4)
One example proves nothing (M01.6.3), so here the rule is tested on pairs that point every way. Angles that add past \(180^\circ\) come back from atan2 a whole turn lower, so the test asks whether two angles differ by whole turns.
def same_direction(first, second): turns = (first - second) /360# how many whole turns apartreturn math.isclose(turns, round(turns), abs_tol=1e-9)for z, u in [((3, 4), (0, 1)), ((3, 4), (2, -1)), ((-1, 1), (0, 1)), ((-2, -5), (-3, 1))]: p = multiply(z, u) lengths_ok = math.isclose(length(p), length(z) * length(u)) angles_ok = same_direction(angle(p), angle(z) + angle(u))print(z, "times", u, "=", p, lengths_ok, angles_ok)
(3, 4) times (0, 1) = (-4, 3) True True
(3, 4) times (2, -1) = (10, 5) True True
(-1, 1) times (0, 1) = (-1, -1) True True
(-2, -5) times (-3, 1) = (11, 13) True True
The third pair is the case of a whole turn: \({-1 + i}\) is at \(135^\circ\) and \(i\) at \(90^\circ\), which add to \(225^\circ\), and the product \({-1 - i}\) is reported at \({-135^\circ}\), the same direction. Python’s own complex numbers, where \(i\) is written 1j, give the same answers with * and abs:
z, u =3+4j, 1+1jp = z * uprint(p, abs(p), abs(z) *abs(u))print(round(math.degrees(math.atan2(p.imag, p.real)), 2))
Frontier note: turning words into positions: rotary position embeddings
A transformer (DL05) compares a query vector with a key vector to decide how much one word attends to another, and it must know where each word sits. Rotary position embeddings (Su and others, Sections 3.2.1 and 3.2.2) read each pair of coordinates of a query or a key as one complex number, and multiply it, for the word at position \(m\), by the number of length 1 at the angle \(m\theta\), where each pair has its own fixed \(\theta\): a pure turn. A turn keeps every length. And when a query turned by \(m\theta\) meets a key turned by \(n\theta\), the two positions enter their comparison only through the difference \({(m - n)\theta}\): what counts is how far apart the two words are, not where they happen to sit.
Explore
M01.9-X1
Turn-and-scale explorer
Drag the blue point \(z\) and the sky-blue point \(u\), or set their lengths and angles with the sliders. The sum is drawn tip to tail and the product with its turn marked; the read-out prints every number as \({a + bi}\). Multiply again multiplies by \(u\) once more.
Three things to try. Drag \(u\) onto the real axis at 2: the product is \(z\) stretched, not turned. Drag \(u\) to \(i\): the product is \(z\) turned a quarter turn, \({-4 + 3i}\). Then set the length of \(u\) to 1 and its angle to \(45^\circ\), and press Multiply again eight times: the point walks round the circle of radius 5 in steps of \(45^\circ\) and is back at \(z\) after the eighth press, because \({8 \times 45^\circ = 360^\circ}\). With a length of 0.9 or 1.1 the walk spirals in or out instead.
Pitfalls
M01.9.2-F4
Wrong beside right. Adding \(i\) slides the point up by 1; multiplying by \(i\) turns it a quarter turn about 0.
“Multiplying by \(i\) moves a point up by 1.”
That is adding \(i\): \({(3 + 4i) + i = 3 + 5i}\), a slide. Multiplying turns about 0: \({i(3 + 4i) = -4 + 3i}\).
“Multiplying by \(i\) turns clockwise.”
It turns anticlockwise, the way angles are measured: \({i \times 1}\) is \(i\), a quarter turn up from the positive real axis. The clockwise quarter turn is multiplying by \({-i}\), which sends \({3 + 4i}\) to \({4 - 3i}\).
“To multiply, multiply the real parts and multiply the imaginary parts.”
That would make \({(3 + 4i)(1 + i)}\) into \({3 + 4i}\), as if \(u\) did nothing. The cross terms \(3i\) and \(4i\) and the term \({4i^2 = -4}\) are what turn and stretch \(z\); the true product is \({-1 + 7i}\). NumPy’s * on two arrays such as np.array([3, 4]) and np.array([1, 1]) multiplies entry by entry in exactly this wrong way. Store complex numbers as complex numbers, 3 + 4j, and * multiplies them correctly.
Check yourself
Recall
1. What does adding \(u\) do to every point of the plane?
Show answer
It slides every point by the same arrow, the arrow from 0 to \(u\).
2. Where does multiplying by \(i\) send \({2 + 5i}\)?
Show answer
To \({-5 + 2i}\): the point \({(a, b)}\) goes to \({(-b, a)}\), a quarter turn anticlockwise about 0.
3. Explain \({i^2 = -1}\) in terms of turns.
Show answer
Multiplying by \(i\) is a quarter turn, so doing it twice is a half turn, which is what multiplying by \({-1}\) does.
4.\(u\) has length 2 and angle \(30^\circ\); \(z\) has length 3 and angle \(60^\circ\). What is \(uz\)?
Show answer
Length \({2 \times 3 = 6}\) and angle \({30^\circ + 60^\circ = 90^\circ}\): the point 6 straight up from 0, which is \(6i\).
5. What does multiplying by 3 do to the plane, and what does multiplying by \({-1}\) do?
Show answer
Multiplying by 3 stretches every arrow from 0 to three times its length. Multiplying by \({-1}\) is a half turn about 0.
Exercises
1.★ Multiply \({z = 3 + 4i}\) by \({u = 2i}\), first by algebra and then by turning and stretching. Do the answers agree?
By turning and stretching: \(2i\) has length 2 and angle \(90^\circ\), so the product has length \({2 \times 5 = 10}\) and angle \({53.13^\circ + 90^\circ = 143.13^\circ}\). The point of the unit circle at the angle of \(z\) is \({(0.6, 0.8)}\), which is \({(3, 4)}\) divided by its length 5 (M01.5.2), and a quarter turn sends it to \({(-0.8, 0.6)}\) (Step 3). Stretched to the length 10, that is the point
By the rule, each factor of \(u\) multiplies the length by \(\sqrt{2}\) and adds \(45^\circ\). So \(u^2\) has length 2 at \(90^\circ\), which is \(2i\); \(u^3\) has length \(2\sqrt{2}\), about 2.8284, at \(135^\circ\), which is \({-2 + 2i}\); and \(u^4\) has length 4 at \(180^\circ\), which is \({-4}\). All three agree.
3.★★★ Use \({uz = cz + d(iz)}\) to work out \({(2 - i)(3 + 4i)}\) as a walk, with one step backwards. Check the answer by algebra, and check that its length and angle obey the rule.
Show solution
Here \({c = 2}\) and \({d = -1}\), and \({iz = -4 + 3i}\). The walk is two steps along \(z\) and then one step backwards along \(iz\):
The length of \({2 - i}\) is \(\sqrt{5}\) and that of \(z\) is 5, so the rule predicts \(5\sqrt{5}\), about 11.1803; directly, \({\abs{10 + 5i} = \sqrt{125} = 5\sqrt{5}}\). The angle of \({2 - i}\) is atan2(-1, 2), about \({-26.565^\circ}\), and the angle of \(z\) is about \(53.130^\circ\), so the rule predicts \({53.130^\circ - 26.565^\circ = 26.565^\circ}\); directly, atan2(5, 10) is about \(26.565^\circ\). (The angles carry three decimal places here because, rounded to two, they give \({53.13^\circ - 26.57^\circ = 26.56^\circ}\), which misses \(26.57^\circ\) by rounding alone.)
Summary card
Adding slides; multiplying turns and stretches.
M01.9.2-F1
Lengths multiply, angles add.
\({z + u}\): slide \(z\) along the arrow of \(u\).
\(rz\) with \({r > 0}\): stretch by \(r\). \({-z}\): a half turn. \(iz\): a quarter turn, \({(a, b) \mapsto (-b, a)}\).
\({uz = cz + d(iz)}\) for \({u = c + di}\).
\({\abs{uz} = \abs{u}\,\abs{z}}\), and the angle of \(uz\) is the angle of \(z\) plus the angle of \(u\), up to a whole turn.
Sources and next steps
Sources. Each was opened and checked against this lesson on 12 November 2026.
Matthias Beck, Gerald Marchesi, Dennis Pixton and Lucas Sabalka, A First Course in Complex Analysis, edition 1.6, Section 1.2. Addition of complex numbers as the addition of arrows (Figure 1.2.1), the absolute value and the argument (Definition 1.2.2), and the product: its absolute value is \(r_1 r_2\) and one of its arguments is \({\phi_1 + \phi_2}\), “multiplying the lengths … and adding their angles”. The book reaches this by the angle-addition formulas; this lesson reaches it from the picture of a turn.
Python Software Foundation, math module, Python 3.12 documentation: math.atan2(y, x) returns an angle between \({-\pi}\) and \(\pi\) in the correct quadrant, because it knows the signs of both inputs; math.hypot returns the length of the arrow from the origin to the point.
Jianlin Su and others, RoFormer: Enhanced Transformer with Rotary Position Embedding, arXiv, version 5. Section 3.2.1, equation (12): in two dimensions the query and the key are written as complex numbers and multiplied by \(e^{im\theta}\) and \(e^{in\theta}\) (the numbers of length 1 at the angles \(m\theta\) and \(n\theta\), in the notation of M01.9.3), which rotates them “by amount of angle multiples of its position index”, and the positions enter their comparison only through \({m - n}\). Section 3.2.2, equations (14) and (15): a longer vector is split into pairs of coordinates, each turned in the same way with its own angle.