ForHosting KIT · Developer Utilities

Complex number from modulus and argument calculator

This complex number from modulus and argument calculator converts polar data into rectangular form.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter a nonnegative modulus, provide an argument, and specify whether that angle is measured in radians or degrees. The calculator returns the real part and the imaginary coefficient of the resulting number a + bi. It is designed for clear manual checks and structured API calculations, with explicit validation that rejects negative moduli, missing values, nonfinite numbers, and unsupported angle units instead of silently guessing what the input means.

Enter the modulus, argument, and angle unit

Begin with the polar description of the complex number. The modulus, often written r, represents the distance from the origin on the complex plane and must be a finite number greater than or equal to zero. Enter it in the modulus field; the shorter alias r is also accepted by integrations. A negative modulus is rejected because this calculator follows the standard polar convention in which distance is nonnegative. Next, enter the argument, often written theta. It describes the direction measured from the positive real axis. The argument must also be finite, but it may be positive, negative, zero, or larger than one complete turn. Coterminal angles are valid because sine and cosine naturally reduce them to the same point. Finally, select radians or degrees. Radians are the default and suit mathematical formulas and most programming environments. Degrees may be more convenient for geometry, phasors, and familiar rotations. The shorter theta alias can stand in for argument, but using the canonical names keeps stored requests easy to understand. Always ensure the declared angle unit matches the numeric argument, since an angle of 90 radians is very different from an angle of 90 degrees.

Understand the polar-to-rectangular calculation

The conversion uses the standard trigonometric identity z = r(cos theta + i sin theta). Its real component is calculated as a = r cos theta, while its imaginary component is calculated as b = r sin theta. When degrees are selected, the calculator first converts the supplied argument to radians because JavaScript trigonometric functions consume radians. It then evaluates cosine and sine and multiplies each by the modulus. The signs of those results place the number in the correct quadrant: quadrant I has positive real and imaginary parts, quadrant II has a negative real part and positive imaginary part, quadrant III has both parts negative, and quadrant IV has a positive real part and negative imaginary part. If the modulus is zero, both rectangular components are zero for every finite argument, which reflects the fact that all directions meet at the origin. Floating-point trigonometry can produce tiny residues such as a near-zero real part for a right angle. The implementation normalizes negligible residues and negative zero to ordinary zero, then limits excess binary floating-point noise with stable significant-digit formatting. This cleanup improves readability without changing the intended mathematical point.

Read, verify, and reuse the rectangular result

The response contains two numeric fields: real and imaginary. Read them as the rectangular complex number real + imaginary times i. If imaginary is negative, write the number with subtraction rather than a doubled sign; for example, real 3 and imaginary -4 represent 3 - 4i. To check a result, calculate the distance sqrt(real squared + imaginary squared). Apart from normal floating-point rounding, it should equal the original modulus. You can also inspect the quadrant and compare it with the direction of the supplied argument. For a 120-degree argument and a positive modulus, the real part should be negative and the imaginary part positive. The numeric fields can be passed directly into later algebra, plotting, signal-processing, or storage steps without parsing a display expression. Each request converts one polar description and is billed as one item at $0.002. The algorithm is deterministic and uses no network request, persistent storage, random value, or clock, so identical valid inputs produce identical JSON output. Validation happens before calculation: negative moduli, nonnumeric fields, infinities, and unknown angle units return an invalid-input error. This strict behavior is especially useful in batch pipelines because malformed records cannot masquerade as plausible complex numbers.

Check polar-form homework

Convert a modulus and angle into real and imaginary components, then compare the result with a hand calculation.

Resolve phasor components

Turn a signal magnitude and phase angle into rectangular components for circuit or signal calculations.

Normalize complex-number records

Convert structured polar values into consistent real and imaginary numeric fields for storage or later processing.

Which formulas calculate the rectangular parts?

The real part is modulus times cosine of the argument, and the imaginary part is modulus times sine of the argument.

Can the modulus be negative?

No. A modulus is a distance and must be nonnegative, so negative input returns an invalid-input error.

Can I enter the argument in degrees?

Yes. Set angle_unit to degrees. If you omit it, the calculator interprets the argument as radians.

What happens when the modulus is zero?

Both the real and imaginary parts are returned as zero for every finite argument.

How much does one conversion cost?

One modulus-and-argument conversion is one item and costs $0.002.

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/algebra/complex-from-modulus-argument

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/algebra/complex-from-modulus-argument \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"modulus":5,"argument":53.130102354156}'
{
  "modulus": 5,
  "argument": 53.130102354156
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.complex_from_modulus_argument",
  "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.

Read the full KIT documentation →