Chris Collins

Tools · math

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

z

the number z (Arithmetic, Modulus & argument, Powers), any form

z=-1-i, z=2cis(pi/3)

w

the number w (Arithmetic; the multiplier in Multiply & z²)

w=1-2i, w=i

op

the operation: add, sub, mul, div, conj

op=div

th

θ for Euler’s formula, in radians; expressions allowed

th=pi, th=1

terms

number of power-series terms (1–30)

terms=8

n

the power (Powers) or the root degree (nth roots)

n=10

of

c in zn = c (nth roots)

of=-16

map

mul (multiply a shape by w) or sq (z ↦ z²)

map=sq

shape

f, square or house

shape=f

grid

the grid for z ↦ z²: cart (square) or polar

grid=polar

a, b, c

coefficients of ax² + bx + c (Quadratic roots)

a=1&b=-4&c=13

pt

the point c whose Mandelbrot orbit is drawn

pt=i, pt=-0.1+0.8i

x, y

centre of the Mandelbrot view

x=-0.75&y=0

span

width of the Mandelbrot view (scientific notation is fine)

span=4e-14

iter

the iteration limit N (20–3000)

iter=200

ph

Phasors mode: ac or three

ph=three

r, xl, xc

resistance and inductive and capacitive reactance, in ohms

r=30&xl=40

v

peak voltage

v=100

example

a preset from the list below (opens its tab if the link has no #tab)

example=ch15-z4-roots

Presets (?example=…):

Name Shows

ch15-multiply

(2 + 3i)(4 − i) = 11 + 10i, the first worked product

ch15-add

addition as the parallelogram rule (tip to tail)

ch15-qam

16-QAM: a received symbol 2.8 − 1.2i is 0.28 from 3 − i

ch15-divide

(3 + 4i)/(1 − 2i) = −1 + 2i by the conjugate

ch15-rotate-scale

(2 + i)(1 + i) = 1 + 3i: moduli multiply, arguments add

ch15-arg-trap

−1 − i: arctan(b/a) says π/4, the truth is −3π/4

ch15-modulus

3 + 4i has modulus 5 and argument 0.9273 rad (53.13°)

ch15-polar-form

1 + √3 i = 2 cis(π/3)

ch15-cis

4 cis(2π/3) = −2 + 2√3 i

ch15-euler

the Euler explorer at θ = 1 with eight series terms

ch15-euler-pi

eiπ = −1, and the 1.22 × 10−16 left by floating point

ch15-euler-2pi

a full turn: the terms grow to about 85 before they shrink and the sum spirals home

ch15-demoivre

(1 + i)10 = 32i by De Moivre

ch15-demoivre-64

(1 + √3 i)6 = 64: one full turn

ch15-powers-of-i

the powers of i walk round the unit circle

ch15-cube-roots-8

the three cube roots of 8

ch15-unity-6

the sixth roots of unity: a hexagon that sums to 0

ch15-z4-roots

z4 = −16: the four roots ±√2 ± √2 i

ch15-times-i

multiplying a letter F by i: a quarter-turn

ch15-multiply-watch

the “Multiply and watch” lab: drag w

ch15-z-squared

z ↦ z² doubles every angle and squares every radius

ch15-z-squared-grid

z ↦ z² bends a square grid into parabolas

ch15-quadratic

x² − 4x + 13 = 0 has roots 2 ± 3i

ch15-suspension

r² + 2r + 26 = 0: roots −1 ± 5i (a damped bounce)

ch08-discriminant

the discriminant explorer: slide c and watch the roots meet and leave the axis

ch08-no-real-roots

x² − 2x + 3 = 0: no real roots; complex roots 1 ± i√2

ch15-mandelbrot

the Mandelbrot lab; the orbit of c = i cycles between −1 + i and −i

ch15-mandel-escape

c = 1: 0, 1, 2, 5, … escapes

ch15-mandel-cycle

c = −1: 0, −1, 0, −1, … a 2-cycle

ch15-mandel-spiral

an orbit spiralling into a 3-cycle

ch15-mandel-zoom

a billion-fold zoom at c = i: still detail, and precision to spare

ch15-mandel-precision

zoomed 1014 times at c = i, past the end of double precision: the picture goes blocky

ch15-ac-circuit

30 Ω + 40 Ω inductive reactance at 100 V: I = 1.2 − 1.6i A, lagging 53.1°

ch15-three-phase

three-phase mains: three phasors that always sum to zero

Runs entirely in your browser; nothing you type leaves this page.