Euler's formula
Draw a radius-1 circle around 0 in the complex plane. The point at angle θ sits cos θ across and sin θ up, so it is the complex number cos θ + j sin θ. Engineers write j for √−1, because i means current.
Euler's formula: e^jθ = cos θ + j sin θ. So e to an imaginary power does not grow; it turns. e^jθ is the length-1 arrow at angle θ: half a turn gives e^jπ = −1, a quarter turn j. Line 2 checks the length.
Phasors
Let the angle grow steadily with time: θ = ωt, where ω is the angular frequency in radians per second. The arrow spins, and its shadow on the real axis swings back and forth: the real part of e^jωt is cos ωt.
A sinusoid (a shifted cosine wave) Vm cos(ωt + φ) is the real part of Vm e^jφ · e^jωt. At one frequency everything spins at the same ω, so drop e^jωt and keep the phasor Vm∠φ. Our current becomes I = 2∠0°.
R and L as phasors
Ohm's law (voltage = resistance × current) works on phasors: VR = R·I = 3 × 2∠0° = 6∠0°. Line 3 computes it. A real number only stretches the arrow, so vR(t) = 6 cos ωt rises and falls in step with the current.
An inductor's voltage is L di/dt. The derivative of e^jωt is jω e^jωt, so for phasors d/dt becomes multiply by jω: calculus turns into algebra. Multiplying by j turns an arrow a quarter turn, +90°, and keeps its length.
Here ωL = 4 Ω, so VL = jωL·I = j4 × 2 = j8, which is 8∠90°; line 4 computes it. Back in time, vL(t) = 8 cos(ωt + 90°): the inductor's voltage peaks a quarter cycle before the current does.
Adding phasors
R and L are in series, so the source voltage is vR + vL (Kirchhoff's voltage law). Adding sinusoids with trig identities is slow; adding phasors is plain complex addition. Put VL's tail on VR's tip: V = 6 + j8, line 5.
The sum's length is |V| = √(6² + 8²) = 10. Its angle is atan2(8, 6) = 53.13° (atan2 finds the angle of the point 6 across, 8 up). So V = 10∠53.13°. cmath.polar(V) returns (10.0, 0.927…): radians.
Multiply by e^jωt, take the real part: v(t) = 10 cos(ωt + 53.13°). Spin the arrows together: at every instant the shadows add, vR + vL = v. The source peaks at 10 V, not 14 V: vR and vL peak at different times.
Try it in the Python prompt
;; step 1/10 · The unit circle >>> import math >>> math.cos(math.pi/3), math.sin(math.pi/3) # θ = 60° (0.5000000000000001, 0.8660254037844386) >>> complex(math.cos(math.pi/3), math.sin(math.pi/3)) (0.5000000000000001+0.8660254037844386j)
Mathematicians write i for √−1; electrical engineers write j, because i is the symbol for current. Python follows the engineers: 2j is a complex literal. The current arrow I (and jI) is drawn on its own scale: 1 A is as long as 2.5 V, so I = 2 A is as long as a 5 V arrow. Amps and volts cannot share one ruler. Python prints 1j as 1j and e^jπ as (-1+1.2246467991473532e-16j): the tiny imaginary part is floating-point rounding, not maths.