Sub topic 2
Complex Numbers: Rectangular and Polar Form
This chapter assumes you know basic trigonometry (sine, cosine, phase angles), basic algebra, and DC circuit analysis. It covers the complex-number arithmetic you need before the phasor transform. Euler's formula and the phasor itself come in later chapters.
Why circuit analysis needs complex numbers
A sinusoidal signal has an amplitude and a phase. To add two sinusoids or to relate a voltage to a current through an inductor, you need to keep track of both quantities at once. A complex number holds two real quantities in one object, and its arithmetic handles the bookkeeping for you.
In electrical engineering the imaginary unit is written j, not i, because i is already the symbol for current. It is defined by j² = −1.
A complex number has a real part and an imaginary part:
z = a + jb
Here a and b are ordinary real numbers. The term "imaginary" is only a name. The number b is real. The factor j marks it as belonging to the second axis.
Rectangular form
Rectangular form is z = x + jy, where x is the real part, written Re(z), and y is the imaginary part, written Im(z). You can plot z as a point on the complex plane. The horizontal axis is the real axis. The vertical axis is the imaginary axis.
Rectangular form is the natural choice for addition and subtraction, because you combine the real parts and the imaginary parts separately.
Polar form
Polar form describes the same point by its distance from the origin and the angle of the line to it:
z = r∠θ
Here r is the magnitude (also called modulus), written |z|. The angle θ is the argument or phase, written ∠z. Polar form is the natural choice for multiplication and division.
In circuit work, angles are usually given in degrees, for example 10∠30°. Software and calculus use radians. Always check which unit a tool expects.
Converting between the forms
From polar to rectangular:
- x = r cos θ
- y = r sin θ
From rectangular to polar:
- r = √(x² + y²)
- θ = atan2(y, x)
The conversion for the angle needs care. The plain formula θ = arctan(y/x) cannot tell the difference between opposite quadrants, because (−3, −4) and (3, 4) give the same ratio. A calculator's arctan returns an angle between −90° and 90° only. The function atan2(y, x) looks at the signs of both inputs and returns the correct quadrant.
| Point | Quadrant | arctan(y/x) | Correct angle |
|---|---|---|---|
| 3 + j4 | I | 53.13° | 53.13° |
| −3 + j4 | II | −53.13° | 126.87° |
| −3 − j4 | III | 53.13° | −126.87° (or 233.13°) |
| 3 − j4 | IV | −53.13° | −53.13° |
Angles that differ by 360° describe the same number, so −126.87° and 233.13° are equal. Pick one convention, usually the range −180° to 180°, and keep to it.
Worked conversion
Convert z = −3 + j4 to polar form.
- Magnitude: r = √((−3)² + 4²) = √25 = 5.
- Angle: atan2(4, −3) = 126.87°. The point is in the second quadrant, so a bare arctan(4/−3) = −53.13° would be wrong by 180°.
- Result: z = 5∠126.87°.
The following code does the same conversion and checks it by converting back.
import cmath
import math
z = complex(-3, 4)
r = abs(z) # magnitude
theta = math.degrees(cmath.phase(z)) # uses atan2 internally
print(r, theta)
# Convert back to rectangular form
back = cmath.rect(r, math.radians(theta))
print(back)The output shows magnitude 5.0 and angle 126.87°, and the round trip returns −3 + 4j, up to floating-point rounding (for example, −3.0000000000000004).
Python writes the imaginary unit as j, so complex(-3, 4) and -3 + 4j are the same number. The cmath module works in radians, so the code converts degrees explicitly.
Arithmetic
Addition and subtraction
Work in rectangular form. Add or subtract the real parts and the imaginary parts separately:
(a + jb) + (c + jd) = (a + c) + j(b + d)
Example: (3 + j4) + (2 − j6) = 5 − j2.
Do not add magnitudes and angles in polar form. 5∠53.13° plus 5∠−53.13° is 6 + j0 = 6∠0°, not 10∠0°.
Multiplication
In rectangular form, expand the product and use j² = −1:
(a + jb)(c + jd) = (ac − bd) + j(ad + bc)
In polar form the rule is shorter. Multiply the magnitudes and add the angles:
r₁∠θ₁ × r₂∠θ₂ = (r₁r₂)∠(θ₁ + θ₂)
Example: 2∠30° × 3∠45° = 6∠75°.
Division
In polar form, divide the magnitudes and subtract the angles:
r₁∠θ₁ / r₂∠θ₂ = (r₁/r₂)∠(θ₁ − θ₂)
In rectangular form, you remove j from the denominator by multiplying the top and bottom by the complex conjugate of the denominator. The conjugate of c + jd is c − jd, written z\. Its useful property is that z z\ = |z|², a real number:
(a + jb)/(c + jd) = [(a + jb)(c − jd)] / (c² + d²)
Example: (1 + j2)/(3 + j4) = (1 + j2)(3 − j4)/25 = (3 + 8 + j(6 − 4))/25 = (11 + j2)/25 = 0.44 + j0.08.
Reciprocals
The reciprocal of z = r∠θ is (1/r)∠(−θ). This matters in circuits, because the impedance of a capacitor is 1/(jωC). Two reciprocal facts are worth memorising:
- 1/j = −j, because j × (−j) = −j² = 1.
- Multiplying by j rotates a number by +90° (counterclockwise). Dividing by j rotates it by −90°.
The second fact follows from polar form, since j = 1∠90°. Later chapters rely on it for inductors and capacitors.
Choosing a form
| Operation | Convenient form | Reason |
|---|---|---|
| Add, subtract | Rectangular | Real and imaginary parts combine independently |
| Multiply, divide | Polar | Magnitudes combine and angles add or subtract |
| Reciprocal, power, root | Polar | Magnitude is inverted or raised, angle is negated or scaled |
| Final answer for a phase shift | Polar | Gain and angle read off directly |
In a typical circuit calculation you will switch back and forth several times, for example by adding two impedances in rectangular form and then dividing a voltage by the sum in polar form.
Complex numbers and sinusoids
Here is a preview of why this matters for the rest of the tutorial. A rotating arrow of length r at angle θ has a horizontal projection r cos θ. If the angle grows steadily with time as ωt + φ, the projection is a cosine wave of amplitude r and phase φ. The complex number r∠φ stores exactly the two numbers, amplitude and phase, that describe the wave at a fixed frequency. The next chapters make this precise.
The following code adds two sinusoids of the same frequency by adding their complex representations in rectangular form, using the numbers 3∠0° and 4∠90°.
import cmath
import math
# 3 cos(w t) + 4 cos(w t + 90 degrees)
A = cmath.rect(3, 0)
B = cmath.rect(4, math.radians(90))
S = A + B
print(abs(S), math.degrees(cmath.phase(S)))The result is magnitude 5 and angle 53.13°. The rectangular sum is 3 + j4, so the polar result matches the table above. The complex-number step is correct, but treating these numbers as sinusoids is justified only by the phasor transform, which is the subject of a later chapter.
Common errors
- Wrong quadrant. Using arctan(y/x) instead of atan2(y, x). Always sketch the point, or check the signs of x and y.
- Degrees and radians mixed.
cmathandmathuse radians. Convert before and after. - Adding in polar form. Magnitudes and angles do not add in a sum of complex numbers. Convert to rectangular first.
- Dropping j² = −1. When you multiply two imaginary parts, the product is real and has the opposite sign: (j2)(j3) = −6.
- Forgetting the conjugate sign. The conjugate flips only the sign of the imaginary part. The angle changes sign, and the magnitude stays the same.
- Rounding too early. Carry at least four significant figures through intermediate steps, especially when subtracting nearly equal numbers.
Exercises
Exercise
Let z1 = 4 − j3 and z2 = 2∠60°. Find z1 × z2 and z1 / z2 in polar form, using degrees.
Show answer
First convert z1 to polar form. |z1| = √(16 + 9) = 5, and the angle is atan2(−3, 4) = −36.87°, so z1 = 5∠−36.87°. Multiply: 5 × 2 = 10 and −36.87° + 60° = 23.13°, so z1 × z2 = 10∠23.13°. Divide: 5 / 2 = 2.5 and −36.87° − 60° = −96.87°, so z1 / z2 = 2.5∠−96.87°.
Exercise
Convert z = −5 − j12 to polar form, and explain why arctan(12/5) alone gives the wrong angle.
Show answer
The magnitude is √(25 + 144) = 13. The point is in the third quadrant. Since arctan(12/5) = 67.38°, that value is the angle to the nearest real axis in the first quadrant. The correct angle is atan2(−12, −5) = −112.62° (equivalently 247.38°). So z = 13∠−112.62°. The ratio y/x is positive for both quadrant I and quadrant III, so arctan cannot distinguish them.