Multiplying complex numbers
This is not a math tutorial. See Why am I writing about math?
a = complex(2, 3)
b = complex(4, 5)
z = a * b
print(z)
# (-7+22j)
Considering multiplication in terms of the rectangular form #
A complex number is any number that can be written as , where is the imaginary unit and and are real numbers.1
Remember that . Think about the process as though is a regular variable, for example , but that the result of the multiplication needs to be in the form , not something like .
Multiplying a complex number by a scalar #
:
Multiplying a complex number by a complex number #
Considering multiplication in terms of the polar form #
The polar coordinate system is outlined here: notes / The polar coordinate system
The polar coordinate system defines points on the complex plane in terms of a magnitude and an angle . The angle determines how much the polar coordinate rotates away from the polar axis (the line starting from the center of the circle in the image below):
The polar form is essentially:
complex number = magnitude * (unit circle point at its angle)
See notes/ The polar coordinate system (where do the angles of for the powers of come from?)
Skipping the proof , the formula for multiplying complex numbers in polar form is:
The magnitudes of the numbers are multiplied and the angles are summed.
Polar form notation versus computation #
I’m not sure how better to phrase the issue. Polar form notation often represents complex numbers in the form:
This shows how the polar form related to the Cartesian (rectangular) form , but when working with complex numbers computationally, you don’t actually carry out the trig functions.
An example from Processing code:
class ComplexPolar {
float r, theta, re, im;
int hue;
ComplexPolar(float r, float theta) {
this.r = r;
this.theta = theta;
this.re = r * cos(theta); // used in the sketch's code
this.im = r * sin(theta); // used in the sketch's code
this.hue = (int)(theta * 180.0/PI) % 360;
}
ComplexPolar mult(ComplexPolar other) {
return new ComplexPolar(
r * other.r, theta + other.theta
);
}
float magnitude() {
return r;
}
}
Multiplication of complex numbers on the unit circle #
When two complex numbers that are on the unit circle are multiplied, only the sine/cosine parts of the numbers are affected (because the magnitudes of the numbers are 1). This means that multiplication only has a rotation effect:
Multiplying a complex number by rotates the number 90 degrees counter-clockwise from the polar axis.
Multiplying a complex number 4 times by results in a 360 degree rotation (it’s back to the starting point).
Using complex numbers to parameterize the equation for a circle #
The way that multiplying complex numbers applies a rotation effect helps to explain how the formula for creating a circle can be parameterized.
The parameterized formula for a circle with radius centered at the origin is (in “cis” form):
The “cis” (cosine, imaginary, sine) notation expands to:
As varies from to , this traces a complete circle.
This is the way I’ve always drawn circles with Processing (ignoring the component):
float x = r*cos(t);
float y = r*sin(t);
t += PI/32 // or some other increment
Tracing what’s happening to points on the complex plane during the Mandelbrot iterations #
Related to Mandelbrot set (Processing)
I tried a small experiment with this here: notes / Tracing how numbers change during the Mandelbrot iterations
References #
Khan Academy. “Multiplying complex numbers.” Accessed on: January 26, 2026. https://www.khanacademy.org/math/algebra2/x2ec2f6f830c9fb89:complex/x2ec2f6f830c9fb89:complex-mul/a/multiplying-complex-numbers .
-
Khan Academy, “Multiplying complex numbers,” Accessed on: January 26, 2026, https://www.khanacademy.org/math/algebra2/x2ec2f6f830c9fb89:complex/x2ec2f6f830c9fb89:complex-mul/a/multiplying-complex-numbers . ↩︎