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.
Quadrant-correct atan2 · r∠θ ↔ a + jbAPI slug rectangular-polar
Linked values
Type in any field — the others follow.
Reference values
Select a row to load it| Real Part (rect → polar) | Imaginary Part (rect → polar) | Magnitude (polar → rect) | Angle (polar → rect) | Angle (radians) | Angle (0…360°) |
|---|---|---|---|---|---|
| 0.000 | 5.000 | 0.000° | 0.000rad | 0.000° | |
| 2.500 | 5.000 | 30.000° | 0.524rad | 30.000° | |
| 3.536 | 5.000 | 45.000° | 0.785rad | 45.000° | |
| 4.330 | 5.000 | 60.000° | 1.047rad | 60.000° | |
| 5.000 | 5.000 | 90.000° | 1.571rad | 90.000° | |
| 4.330 | 5.000 | 120.000° | 2.094rad | 120.000° | |
| 3.536 | 5.000 | 135.000° | 2.356rad | 135.000° | |
| 0.000 | 5.000 | 180.000° | 3.142rad | 180.000° |
Formula
Standard complex-plane identities; Touchstone MA/RI conventions
| Symbol | Quantity | Your value |
|---|---|---|
| a | Real part (resistance R for impedance) | 3 |
| b | Imaginary part (reactance X for impedance) | 4 |
| r | Magnitude / modulus | 5 |
| θ | Phase angle / argument (° or rad) | 53.1° |
Assumptions
6 items
- 01Rectangular to polar is r = √(a² + b²) and θ = atan2(b, a), so the quadrant is kept; θ is given from −180° to 180°, in radians, and from 0° to 360° by adding 360° to a negative angle.
- 02Polar to rectangular is a = r·cos θ and b = r·sin θ, with θ in degrees counter-clockwise from the +real axis.
- 03The parts carry no unit: the same conversion serves an impedance R + jX in ohms, an S-parameter or a phasor.
- 04On this page a + jb and r∠θ always describe the same number: typing a or b keeps the other part, typing r keeps θ and typing an angle keeps r; a part smaller than 10⁻¹² of r is written as 0, so 5∠90° is 0 + j5.
- 05The angle of 0 + j0 is undefined and is given as 0° with a warning; a negative magnitude is refused when typed, and one reaching the calculation another way is evaluated as |r|∠(θ + 180°) with a warning.
- 06The angle input runs from −360° to 360°, and a typed angle keeps its turn: 270° stays 270° and is not rewritten as −90°.
Worked example
Capacitive load 30 − j40 Ω in polar form
An impedance analyser reads a load as 30 − j40 Ω. A simulator port wants it as magnitude and angle; find |Z|∠θ in both angle conventions.
| Step | Expression | Result |
|---|---|---|
| Magnitude | √(30² + (−40)²) | 50 |
| Angle, quadrant IV | atan2(−40, 30) | −53.1° |
| In radians | −53.1° × π/180 | −0.9273 rad |
| As a positive angle | −53.1° + 360° | 306.9° |
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.
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
6 questions
What is the difference between arctan and atan2?
arctan takes one argument, the ratio b/a, and can only return an angle between -90 and +90 degrees. atan2 takes b and a as separate arguments, so it can see their individual signs and return the correct angle anywhere in the full -180 to +180 degree range. Since the ratio b/a is identical for a point and its opposite, arctan cannot distinguish them and atan2 can.
How do I convert an impedance to polar form?
Treat resistance as the real part and reactance as the imaginary part. For Z = 50 - j25 ohms the magnitude is sqrt(50^2 + 25^2) = 55.90 ohms and the angle is atan2(-25, 50) = -26.57 degrees. The negative angle confirms the load is capacitive.
Why does my calculator give 53.13 degrees for both 3+j4 and -3-j4?
Because it is using single-argument arctan on the ratio. Both cases give b/a = 1.333, so the ratio alone cannot tell them apart. The correct answers are +53.13 degrees and -126.87 degrees respectively — same magnitude of 5, opposite directions in the plane.
Should I report angles as -180 to 180 or 0 to 360?
Use -180 to 180 for anything where the sign carries meaning, such as impedance phase, because the sign immediately distinguishes inductive from capacitive. Use 0 to 360 when matching an instrument display or file format that uses that convention. This calculator reports both so you never have to add or subtract 360 by hand.
How does polar form simplify multiplying complex numbers?
In polar form the magnitudes multiply and the angles add: (r1 angle t1) times (r2 angle t2) equals (r1 r2) angle (t1 + t2). In rectangular form the same operation needs four multiplications and two additions with careful sign handling. For cascaded networks, where you may be multiplying a dozen terms, polar form is dramatically less error-prone.
What is the angle of zero?
Undefined — a vector of zero length points nowhere. atan2(0, 0) returns 0 by convention so that code does not crash, and this calculator warns when you hit that case so the result is not mistaken for a real measurement.