Imaginary part of a complex number calculator
This imaginary part of a complex number calculator returns the real scalar that multiplies i.
Run — free
Enter a number in rectangular form, a + bi, and it selects b directly. Enter the same number in polar form, with magnitude r and angle theta, and it converts the value using r sin(theta). The calculator accepts polar angles in radians or degrees, validates every numeric input, and gives a compact result suitable for homework checks, engineering calculations, and automated algebra workflows.
Identify the form before extracting the component
A complex number combines a real component and an imaginary component, but the way those components appear depends on the notation. In rectangular form, usually written a + bi, a is the real part and b is the imaginary part. The requested answer is b, not bi and not the entire complex number. For example, the imaginary part of 7 - 4i is -4. Choose rectangular form and supply the coefficient with its sign. The real value may also be supplied so the input describes the complete number, although it does not affect the extracted result. Polar form packages the same number as a magnitude and an angle, often written r(cos(theta) + i sin(theta)) or r e^(i theta). In that notation, the imaginary component is not shown as a separate field, so it must be calculated. Choose polar only when your inputs genuinely represent a modulus and argument. Keeping the representation explicit avoids guessing whether a pair of values means coordinates or radius and angle.
Convert polar form with the correct angle unit
For a polar complex number, the calculator evaluates imaginary part = r sin(theta). The magnitude r must be nonnegative under the standard polar convention. The angle may be positive, negative, larger than one full turn, or zero, because sine naturally handles coterminal angles. Select radians when theta is expressed using values such as pi/2 or a decimal radian measure; select degrees for familiar values such as 30, 90, or 225. The calculator converts degrees to radians internally before applying sine. Unit selection matters: an angle of 30 radians is very different from 30 degrees. The sign of the result follows the vertical position of the complex number in the plane. Angles in the upper half-plane produce a positive imaginary part, while angles in the lower half-plane produce a negative one. Values that should be zero at standard axes are normalized to zero when floating-point sine leaves an extremely small numerical residue. This keeps ordinary exact-axis answers readable without hiding meaningful values.
Interpret and reuse the scalar result
The output contains one field, imaginary_part, whose value is a scalar. If the result is 5, the imaginary term in rectangular notation is 5i; if the result is -2, the term is -2i. A zero result means the represented complex number lies on the real axis, including zero itself. The response deliberately does not return a formatted expression, because a numeric scalar is easier to compare, store, graph, or pass to another calculation. This also makes the endpoint useful inside checking systems and data pipelines where display notation would need parsing again. All supplied numeric values must be finite JavaScript numbers: text such as “3i,” infinity, and missing form-specific fields are rejected rather than interpreted silently. Rectangular aliases imag and im are accepted, and polar aliases radius and modulus are accepted, but canonical field names make integrations clearer. The algorithm is deterministic and uses no network, stored state, clock, or randomness, so identical valid inputs produce identical JSON output. API use costs $0.002 per item, while the browser execution can use the same pure calculation logic.
What you can do with it
Check algebra exercises
Confirm the signed coefficient of i after reading rectangular notation or converting a polar answer.
Resolve phasor components
Turn a magnitude and phase angle into the scalar imaginary component used in signal and circuit calculations.
Normalize complex-number data
Extract one consistent numeric field from records that arrive in either rectangular or polar representation.
FAQ
What is the imaginary part of a + bi?
It is the scalar b. The imaginary part of 3 - 8i is -8, not -8i.
How is the imaginary part found from polar form?
It is calculated as r sin(theta), where r is the nonnegative magnitude and theta is the argument.
Can I enter the polar angle in degrees?
Yes. Set angle_unit to degrees; otherwise the default unit is radians.
Why can the result be negative?
A negative result means the point lies below the real axis, so the coefficient of i is negative.
How much does an API calculation cost?
Each item costs $0.002. The computation is constant-time and requires no external service.
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/algebra/complex-imaginary-part \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"form":"rectangular","imaginary":-4.5}'const res = await fetch("https://api.kit.forhosting.com/algebra/complex-imaginary-part", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"form": "rectangular",
"imaginary": -4.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/complex-imaginary-part",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"form": "rectangular",
"imaginary": -4.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/complex-imaginary-part", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"form":"rectangular","imaginary":-4.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"form":"rectangular","imaginary":-4.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/complex-imaginary-part", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"form": "rectangular",
"imaginary": -4.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.complex_imaginary_part",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |