Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

Complex numbers lab

Calculate with complex numbers, see them on the Argand diagram, find all n-th roots, and watch a function of z bend a grid of lines.

How to use it

  1. Calculator: type any expression with complex numbers, such as (3+4i)*(1-2i), (1+i)^8 or e^(i*pi). You get the result, its real and imaginary parts, modulus, argument, polar form and conjugate, drawn on the Argand diagram.
  2. Roots: find all n-th roots of a number. They always sit evenly spaced on a circle.
  3. Map the plane: type a function of z and see what it does to a grid of lines: z² doubles angles, 1/z turns the plane inside out, exp(z) wraps lines into circles and rays.

What you can type

+ - * / ^Add, subtract, multiply, divide, power (3i and 2(1+i) multiply too)
i, pi, e, zThe imaginary unit, π, e, and the variable (map tab only)
Functionsre, im, abs, arg, conj, sqrt, exp, ln, sin, cos, written like sqrt(-4)

Tips

  • Multiplying by i turns a point a quarter turn anticlockwise around 0. Try i*(2+i) and compare the two points.
  • In polar form, multiplying multiplies the lengths and adds the angles. That is why (1+i)8 is exactly 16.
  • Euler’s identity: e^(i*pi) gives −1.
  • Powers like ii have many values; the lab gives the principal one (about 0.2079, a real number).

About this tool

Complex numbers extend the real numbers with i, where i2 = −1. Every complex number a + bi is a point (a, b) in the plane, the Argand diagram, and arithmetic becomes geometry: adding slides, multiplying turns and stretches. They are used across physics and engineering, from electric circuits to signal processing.

The lab reads your expression with a small parser of its own (no outside code) and works with principal values: the argument lies between −180° and 180°, and logarithms and non-whole powers are taken through it.

The tests evaluate many expressions and check them against Python’s own complex arithmetic, and check that every n-th root raised to the n-th power gives back the number.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product