Skip to content
Documentation sections

Rectangular ↔ Polar Complex Number Converter

POSThttps://rftools.io/api/py/v1/calculate

Slug rectangular-polar. 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.

Inputs

Send every one of these in inputs, in the units shown. Most are required: a call without one is refused (400) and costs nothing; one the calculator can do without takes the default shown. An input outside its range is still computed and flagged in the provenance.

Inputs of rectangular-polar
NameUnitRangeDefaultDescription
realnumbernoneany3Real component of a + jb. For impedance this is resistance R.
imaginarynumbernoneany4Imaginary component of a + jb. For impedance this is reactance X.
magnitudenumbernoneany5Vector length r of r∠θ.
angleDegnumber°−360 … 36053.13010235415598Phase angle in degrees, measured counter-clockwise from the +real axis.

Outputs

Returned in values, by key. A value that is unbounded or undefined is null.

Outputs of rectangular-polar
FieldUnitDescription
magnitudeOutheadlinenoneMagnitude |a + jb|
angleDegOut°Angle (−180…180°)
angleRadOutradAngle (radians)
angleDeg360°Angle (0…360°)
realOutnoneReal Part from r∠θ
imagOutnoneImaginary Part from r∠θ

Calling it

  • Calculate: one call, the request and response in full, and its errors.
  • Batch: this calculator with others, or a sweep, in one request.
  • Solve for a target: the value of one input that brings an output to a target.