Skip to content

Resource · Guide or article

Complex Number

Math refresher on complex numbers, from the a + bi form and the complex plane to polar form and the four arithmetic operations. Mainly useful as background for Fourier transform material or for implementing a complex number class.

Reviewed

Open the original: Complex Number (opens the original site in a new tab)

Add to a roadmap

Keep this resource with a roadmap you follow. It appears as your own extra resource; the roadmap's steps don't change and it doesn't count toward your tracked steps.

Source content: English

A complex number is a number that can be expressed in the form a + b * i, where a and b are real numbers, and i is a solution of the equation x^2 = −1. Because no real number satisfies this equation, i is called an imaginary number. For the complex number a + b * i, a is called the real part, and b is called the imaginary part. A Complex Number is a combination of a Real Number and an Imaginary Number: Geometrically, complex numbers extend the concept of the one-dimensional number line to the two-dimensional complex plane by using the horizontal axis for the real part and the vertical axis for the imaginary part. The complex number a + b * i can be identified with the point (a, b) in the complex plane.

PrepKit overview

PrepKit editors wrote and reviewed this overview from the source repository. It is not text from the resource itself.

Suited to
The source does not state a level
Format
Lesson

What it covers

  • Real and imaginary parts, purely real and purely imaginary numbers, and the Argand diagram
  • Polar form with modulus and argument, the trigonometric form and Euler's formula
  • Addition and subtraction part by part, each with a worked example
  • Multiplication by FOIL and the shortcut (ac - bd) + (ad + bc)i, worked for (3 + 2i)(1 + 7i)
  • Conjugates, and division by multiplying top and bottom by the conjugate, with the a^2 + b^2 rule

How to use it

PrepKit study advice, not a claim made by the source.

Build a small complex number type with add, subtract, multiply, divide and conversion to polar form, and test it against every worked example in the README, such as the division that gives -7/41 + 22/41 i.

Scope and limitations

Pure math with no algorithmic or interview framing. The polar form formulas are images rendered from Wikipedia, many figures come from MathIsFun, and the binomial multiplication link is malformed.

Access and format

README on GitHub in the MIT-licensed trekhleb/javascript-algorithms repository; English, free to read, with a French translation linked.

Reviewed by PrepKit on Oct 2, 2026. Listing source commit: 85293e3e2b88

Evidence behind this overview
  • src/algorithms/math/complex-number/README.md

Pages that include this

Get the PrepKit newsletter

Optional. You don't need it to use PrepKit.

How we handle your email