ForHosting KIT · Math

Complex number to rectangular form

Turn a modulus and an argument back into a + bi: a modulus of 2 at 60 degrees gives a real part of 1 and an imaginary part of about 1.732. Enter the angle in radians or degrees, with no separate conversion step. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Modulus
2 deg
Argument
45
You get
Real
1.4142135624 deg
Imag
1.4142135624

The complex number to rectangular form converter takes a complex number given in polar form, that is by its modulus and its argument, and returns its rectangular form: the real part and the imaginary part of the equivalent a + bi expression. The real part is the modulus times the cosine of the argument and the imaginary part is the modulus times the sine, and the argument can be supplied either in radians or in degrees, so you never need a separate unit conversion step. The modulus must be a finite non-negative number and the argument must be finite; anything else is rejected with a clear validation error.

From modulus and argument to a + bi

A complex number in polar form is described by a distance and a direction: the modulus r tells you how far the number sits from the origin of the complex plane, and the argument theta tells you the angle measured counterclockwise from the positive real axis. Rectangular form describes the very same number by its coordinates instead: a real part a and an imaginary part b, written a + bi.

Moving from polar to rectangular is a direct application of trigonometry, because the modulus is the hypotenuse of a right triangle whose legs are exactly the two parts, so the real part is r times the cosine of theta and the imaginary part is r times the sine of theta. For example, a modulus of 2 with an argument of 60 degrees gives a real part of 2 times one half, which is 1, and an imaginary part of 2 times the square root of three over two, about 1.732.

Sending the modulus and the argument to this complex number to rectangular form converter returns both parts in a single call, which is the step you need after multiplying, dividing, or taking powers and roots in polar form, since those operations are easy in polar coordinates but most displays, formulas, and downstream tools expect the familiar a + bi shape. Both returned parts are rounded to twelve decimal places so results compare byte-identically across machines.

Radians or degrees, one call, no extra step

Angles in mathematics and engineering arrive in two different units, and picking the wrong one silently wrecks a calculation: pi over four radians and 45 degrees are the same direction, but feeding 45 into a cosine that expects radians produces a meaningless result. This converter removes that trap by accepting an explicit unit field. Pass "rad" or omit the field and the argument is read as radians, the natural unit of Euler's formula, of every programming language's trigonometric functions, and of most university mathematics.

Pass "deg" and the argument is read as degrees, the unit found in engineering drawings, phasor diagrams, navigation bearings, and homework assignments, and the converter multiplies by pi over 180 before taking the cosine and sine. The chosen unit is echoed back in the response alongside the modulus and the argument you supplied, so a log or a spreadsheet row always records which interpretation was used, and any other value for the unit field is rejected with a validation error rather than guessed.

Validation, determinism, and where it fits

A modulus of zero is a deliberate special case that is accepted: the number collapses to the origin, so the converter returns 0 + 0i regardless of the argument, which keeps pipelines total and predictable. The computation is a handful of floating point operations with no network access, no randomness, and no clock, so the same input always yields byte-identical output.

Typical callers are electrical engineering tools turning a phasor given as magnitude and phase into resistance plus reactance, signal processing code converting a magnitude-phase spectrum back into real and imaginary FFT bins, control systems translating between frequency response representations, and students checking the rectangular form after applying De Moivre's theorem.

Electrical engineering and phasors

Turn an AC phasor given as magnitude and phase angle in degrees into rectangular form (resistance plus reactance, or voltage real and imaginary parts) for circuit calculations.

Signal processing

Rebuild the real and imaginary parts of an FFT bin from a magnitude-phase spectrum after filtering or equalization, with the angle supplied in radians.

Math homework and teaching

Check the rectangular form of a complex number after computing powers or roots with De Moivre's theorem, where the result naturally comes out in polar form.

What does it cost?

The same conversion is free to run in your browser on this page.

What exactly is returned?

The real part, the imaginary part, and the echoed modulus, argument, and unit, all rounded to twelve decimal places: real = modulus*cos(argument), imag = modulus*sin(argument).

Can I give the angle in degrees?

Yes. Pass unit "deg" and the argument is read as degrees; pass "rad" or omit the unit and it is read as radians. Any other unit value is rejected.

Why is a negative modulus an error?

In polar form the modulus is a distance from the origin, so it cannot be negative. If your calculation produced a negative value, flip the sign and add pi radians (180 degrees) to the argument instead.

Which inputs are rejected?

Anything that is not a finite number: missing fields, null, booleans, arrays, empty or non-numeric strings, NaN, and Infinity, plus any negative modulus. Numeric strings like "2.5" are accepted.

What happens when the modulus is zero?

The number is the origin regardless of the angle, so the converter returns 0 + 0i for any finite argument instead of failing.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/math/complex-number-to-rectangular-form

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/math/complex-number-to-rectangular-form \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modulus":2,"argument":45}'
{
  "modulus": 2,
  "argument": 45
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "math.complex_number_to_rectangular_form",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The same conversion runs free in your browser on this page, and the identical code serves the paid API at $0.002 per request.

Validation, determinism, and where it fits

The modulus must be a finite number greater than or equal to zero, because a negative distance has no meaning in polar form, and the argument must be a finite number; the endpoint accepts JSON numbers and numeric strings such as "2.5" or "-30", which is convenient when values arrive as web form fields, but it rejects nulls, empty strings, booleans, arrays, the text NaN, and anything infinite, answering with an invalid input error that names the offending field instead of silently producing nonsense coordinates. It runs on the edge in milliseconds, keeps nothing after the response, and costs $0.002 per request through the API while remaining free to use interactively in the browser.

Read the full KIT documentation →