Rectangular ↔ Polar Complex Number Converter
Convert complex numbers between rectangular (a + jb) and polar (r∠θ) form. Quadrant-correct via atan2, with degrees, radians, and 0–360° wrapped angle. For impedance, S-parameters, and phasor arithmetic.
Formula
Reference: Standard complex-plane identities; Touchstone MA/RI conventions
How It Works
Every complex quantity in electronics — an impedance, an S-parameter, a phasor voltage — has two equivalent descriptions. Rectangular form names the point by its coordinates in the complex plane. Polar form names it by distance from the origin and angle from the positive real axis. The two carry identical information; which one you want depends on the operation. Addition and subtraction are trivial in rectangular form because the components add independently. Multiplication, division, and raising to a power are trivial in polar form because magnitudes multiply and angles add.
The conversion out of rectangular form is and . The magnitude is just the Pythagorean distance and is never controversial. The angle is where nearly every mistake in this conversion lives, because the naive expression is wrong for half the plane. A single-argument arctangent returns values only in to , and the ratio discards the individual signs: and produce the same ratio and therefore the same answer, even though they point in opposite directions. The two-argument form atan2 takes and separately, inspects both signs, and returns the true angle over the full to range.
The reverse conversion is the definition of polar coordinates: and . It has no ambiguity, but it does have a convention to respect — the magnitude is taken as non-negative. A negative describes the same vector as , and while the arithmetic still works, most instruments and file formats assume and will misinterpret it.
In RF work the practical stakes are concrete. An impedance in polar form is , where means inductive and means capacitive. A reflection coefficient stored in Touchstone MA format is magnitude and degrees; in RI format it is the rectangular pair. Getting the quadrant wrong flips an inductive load into a capacitive one, which sends a matching network in exactly the wrong direction.
Worked Example
Converting to degrees:
Both and are positive, so the point is in quadrant I and the – form is the same value, .
Step 3: Back the other wayThe round trip recovers the original pair exactly, which is the check worth running whenever you suspect a quadrant problem.
Step 4: Why the quadrant mattersTake instead. The ratio is identical to the ratio for , so returns for both — pointing into quadrant I when the vector is actually in quadrant III. atan2 sees that both arguments are negative and returns , equivalently in the – form.
Result: , and — same magnitude, opposite direction.Practical Tips
- ✓Use polar form for cascaded multiplication (impedance transformations, chained S-parameters) and rectangular form for anything additive (series impedances, superposed phasors) — converting at the right moment removes most of the arithmetic
- ✓For an impedance, read the sign of the angle first: positive is inductive, negative is capacitive, zero is purely resistive. It tells you which way to move before you compute anything
- ✓When reading Touchstone files, confirm the format line: MA is magnitude and degrees, DB is magnitude in dB and degrees, RI is the rectangular pair. Mistaking DB for MA gives a magnitude that is wrong by a logarithm
- ✓Round-trip any suspicious conversion — convert to polar, convert straight back, and compare against the original. A quadrant error shows up immediately as a sign flip
- ✓Keep full precision on the angle when chaining conversions. Rounding 53.13010235 degrees to 53.1 introduces a 0.02 percent magnitude error after just a few cascaded multiplications
Common Mistakes
- ✗Using arctan(b/a) instead of atan2(b, a) — this collapses quadrant II onto quadrant IV and quadrant III onto quadrant I, producing a silent 180-degree error that inverts an impedance from inductive to capacitive
- ✗Mixing degrees and radians in the same calculation — trigonometric library functions almost always take radians, so a value in degrees must be multiplied by pi/180 before it reaches cos or sin
- ✗Assuming the angle range without checking — atan2 returns -180 to +180 degrees, while many VNAs and Touchstone readers present 0 to 360; the two differ by exactly 360 degrees for negative angles and comparing them directly gives a spurious mismatch
- ✗Entering a negative magnitude in polar form — r is defined as non-negative, and a negative value silently rotates the vector by 180 degrees relative to what downstream tools expect
- ✗Averaging angles across a wrap point — the mean of 179 degrees and -179 degrees is 0 degrees by arithmetic but 180 degrees in reality; unwrap the phase before any averaging or interpolation
Frequently Asked Questions
Related Articles
Related Calculators
Convert
Angle Converter
Convert angles between degrees, radians, gradians, arcminutes, arcseconds, and turns for motor, antenna, and RF applications.
RF
VSWR / Return Loss
Convert between VSWR, return loss, reflection coefficient, and mismatch loss instantly. Get reflected and transmitted power percentages. Free, instant results.
RF
Reactance Calculator
Calculate inductive reactance (XL = 2πfL) and capacitive reactance (XC = 1/2πfC) for any frequency. Also computes the LC resonant frequency where XL = XC. Essential for filter and impedance matching design.
RF
dBm Converter
Convert dBm to watts, milliwatts, dBW, dBuV, and Vrms instantly. Enter power level and impedance for all RF power unit conversions. Free, instant results.