Complex numbers, visually
Drag z and w to see addition as vectors and multiplication as rotate-and-scale; modulus and argument with the arctan quadrant trap; Euler's formula with its power series as a spiral of arrows; De Moivre and nth roots; z ↦ wz and z ↦ z² acting on shapes and grids; quadratic roots leaving the real axis; AC phasors and three-phase; and the Mandelbrot set with orbits and the limits of double precision.
Added
How to use it
A complex number a + bi is the point (a, b), and every operation on complex numbers is a move in
the plane. Each tab shows one idea; drag the coloured points, type numbers in any form — 3+4i,
-1-i, 2cis(pi/3), 2e^(i pi/4), 5∠53.13°, sqrt(2)+sqrt(2)i, 3+4j — and read the working
beside the picture. Scroll to zoom and drag empty space to pan; hold Shift while dragging a point
to turn off snapping.
-
Arithmetic — z + w as tip-to-tail vectors (the parallelogram), z − w as the arrow from w to z (so |z − w| is a distance), z × w as rotate-and-scale (the shaded triangles 0, 1, w and 0, z, zw are similar; arguments add, moduli multiply), z ÷ w by the conjugate, and z̄ as a reflection.
-
Modulus & argument — r and θ with the book’s five-step procedure, the reference angle and the quadrant, and the arctan trap: a dashed red ray shows where a calculator’s arctan(b/a) points whenever it disagrees with atan2(b, a). Type r and θ (degrees or radians) to convert back.
-
Euler’s formula — move θ (or press Play): eiθ travels round the unit circle while its shadows trace cos θ and sin θ as two unrolling graphs. Below, the power series Σ (iθ)n/n! is drawn as a chain of arrows, each a quarter-turn from the last, spiralling into eiθ; set the number of terms and read the partial sums and the error.
-
Powers — z0, z, z², …, zn as a spiral, with De Moivre’s theorem worked step by step and checked by repeated multiplication.
-
nth roots — all n solutions of zn = c on their circle of radius |c|1/n, starting at φ/n and spaced 2π/n, with each root raised back to the nth power as a check.
-
Multiply & z² — the “Multiply and watch” lab: a letter F (or a square or house) multiplied by w; drag w, try w = i for a quarter-turn, or spin w round its circle. The second mode shows z ↦ z² bending a square grid into parabolas (still crossing at right angles) or doubling every angle of a polar grid.
-
Quadratic roots — the discriminant explorer: fix a and b, slide (or sweep) c, and watch the real roots meet at −b/2a and leave the real axis as a conjugate pair p ± qi moving vertically, with the quadratic formula worked out.
-
Mandelbrot — tap a point c to draw its orbit 0, c, c² + c, … (spiralling in, cycling or flying off; the period of a cycle is reported); scroll or use the zoom buttons; slide the iteration limit N. A precision gauge compares the pixel spacing with the gap between adjacent doubles, and says when the picture is about to — or has — run out of double precision.
-
Phasors — an AC series circuit (R, XL, XC): impedance as a complex number, I = V/Z by the conjugate, and the current lagging or leading the voltage; and three-phase mains, three phasors that are the cube roots of unity and so sum to zero at every instant.
Open an example from the book (above the tabs) loads any of the book’s worked examples.
⛶ Full screen (or F) gives the current tab’s plane the whole screen — the browser’s full
screen where it is allowed, otherwise a full-window layer (iPhone); a plot beside it grows to match,
and everything is redrawn as the window changes. Escape leaves.
Limits
Everything is computed in double precision (that is the point of the Mandelbrot precision gauge). Values that should be exactly zero can show as 10−16-sized numbers, as in the book’s own Python output. Powers are computed by repeated squaring, so (1 + i)10 is exact; roots and non-integer powers use cos and sin and are accurate to about 15 digits. The Mandelbrot picture is an escape-time picture: black means “did not escape within N steps”, which is only evidence of being inside. On a touch screen, use the zoom buttons rather than pinching.
Related: Graphing calculator (polar curves r = f(θ)), Unit circle and waves, Algebra step by step (quadratics with complex roots, worked exactly), Matrix transformations (multiplication by a + bi is the matrix ), Fourier series (complex Fourier and epicycles) and Smith chart (impedance in the complex plane).
Companion to the chapter Complex numbers (and the discriminant lab in Quadratics) of Mathematics, Reconnected.
Linking to an example
Share link copies a URL that reopens the tool as you have it. Links can also be written by hand
with these parameters, followed by #tab to choose the tab (#arith, #polar, #euler,
#powers, #roots, #map, #quad, #mandel, #phasor). Settings that a link leaves out take
their defaults. In this tool a + in a link always means plus — ?z=3+4i works as typed (%2B
works too); write a space as %20, or leave spaces out.
| Parameter | Meaning | Example |
|---|---|---|
|
the number z (Arithmetic, Modulus & argument, Powers), any form |
|
|
the number w (Arithmetic; the multiplier in Multiply & z²) |
|
|
the operation: |
|
|
θ for Euler’s formula, in radians; expressions allowed |
|
|
number of power-series terms (1–30) |
|
|
the power (Powers) or the root degree (nth roots) |
|
|
c in zn = c (nth roots) |
|
|
|
|
|
|
|
|
the grid for z ↦ z²: |
|
|
coefficients of ax² + bx + c (Quadratic roots) |
|
|
the point c whose Mandelbrot orbit is drawn |
|
|
centre of the Mandelbrot view |
|
|
width of the Mandelbrot view (scientific notation is fine) |
|
|
the iteration limit N (20–3000) |
|
|
Phasors mode: |
|
|
resistance and inductive and capacitive reactance, in ohms |
|
|
peak voltage |
|
|
a preset from the list below (opens its tab if the link has no |
|
For example ?z=-1-i#polar,
?of=-16&n=4#roots and
?a=1&b=-4&c=13#quad.
Presets (?example=…):
| Name | Shows |
|---|---|
(2 + 3i)(4 − i) = 11 + 10i, the first worked product |
|
addition as the parallelogram rule (tip to tail) |
|
16-QAM: a received symbol 2.8 − 1.2i is 0.28 from 3 − i |
|
(3 + 4i)/(1 − 2i) = −1 + 2i by the conjugate |
|
(2 + i)(1 + i) = 1 + 3i: moduli multiply, arguments add |
|
−1 − i: arctan(b/a) says π/4, the truth is −3π/4 |
|
3 + 4i has modulus 5 and argument 0.9273 rad (53.13°) |
|
1 + √3 i = 2 cis(π/3) |
|
4 cis(2π/3) = −2 + 2√3 i |
|
the Euler explorer at θ = 1 with eight series terms |
|
eiπ = −1, and the 1.22 × 10−16 left by floating point |
|
a full turn: the terms grow to about 85 before they shrink and the sum spirals home |
|
(1 + i)10 = 32i by De Moivre |
|
(1 + √3 i)6 = 64: one full turn |
|
the powers of i walk round the unit circle |
|
the three cube roots of 8 |
|
the sixth roots of unity: a hexagon that sums to 0 |
|
z4 = −16: the four roots ±√2 ± √2 i |
|
multiplying a letter F by i: a quarter-turn |
|
the “Multiply and watch” lab: drag w |
|
z ↦ z² doubles every angle and squares every radius |
|
z ↦ z² bends a square grid into parabolas |
|
x² − 4x + 13 = 0 has roots 2 ± 3i |
|
r² + 2r + 26 = 0: roots −1 ± 5i (a damped bounce) |
|
the discriminant explorer: slide c and watch the roots meet and leave the axis |
|
x² − 2x + 3 = 0: no real roots; complex roots 1 ± i√2 |
|
the Mandelbrot lab; the orbit of c = i cycles between −1 + i and −i |
|
c = 1: 0, 1, 2, 5, … escapes |
|
c = −1: 0, −1, 0, −1, … a 2-cycle |
|
an orbit spiralling into a 3-cycle |
|
a billion-fold zoom at c = i: still detail, and precision to spare |
|
zoomed 1014 times at c = i, past the end of double precision: the picture goes blocky |
|
30 Ω + 40 Ω inductive reactance at 100 V: I = 1.2 − 1.6i A, lagging 53.1° |
|
three-phase mains: three phasors that always sum to zero |
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.