Arcus tangent calculator
The arcus tangent of 1 is 45 degrees, and of −1 it is −45 degrees. Unlike the inverse sine or cosine, it accepts any finite number, and you choose whether the angle comes back in radians, in degrees or in both at once. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Value
- 1 both
- Radians
- 0.7853981634
- Degrees
- 45
The arcus tangent calculator computes the inverse tangent of any finite real number and returns the corresponding angle in radians, degrees, or both. It answers the reverse question of trigonometry: tangent produced this ratio — which angle generated it? Unlike arcsin or arccos, arctan accepts every real input, from the tangent of a nearly flat slope to an enormous ratio produced by a near-vertical line, so there is no domain to validate beyond requiring a finite number. The result always lands on the principal branch, from -π/2 to π/2 radians (-90 to 90 degrees), the convention assumed by textbooks, navigation formulas and physics derivations.
What the arcus tangent actually computes
Tangent maps an angle to a ratio — the opposite side over the adjacent side of a right triangle — and the arcus tangent is the inverse journey: it takes that ratio and hands you back the angle. Because the tangent function is periodic, infinitely many angles share the same tangent, so the inverse is defined on a single principal branch: atan(x) always returns the unique angle in the open interval (-π/2, π/2) radians, that is, between -90 and 90 degrees, whose tangent equals x.
So atan(0) is 0, atan(1) is π/4 (45 degrees), atan(-1) is -π/4 (-45 degrees), and as the input grows without bound the result approaches π/2 without ever reaching it. This calculator returns that principal value with full double precision and rounds the published output to twelve decimal places so results are byte-stable across machines.
Radians, degrees, or both
The unit parameter controls the shape of the answer. Pass 'radians' and you get only the radian measure, which is what calculus, physics and most programming languages expect — JavaScript's Math.atan, Python's math.atan and C's atan all speak radians natively. Pass 'degrees' and you get the angle in degrees, the unit surveyors, navigators and school geometry actually use.
Pass 'both' — the default — and you get the two representations in a single response, converted through the exact identity degrees = radians × 180 / π, which saves a second call when a report needs one unit and the code behind it needs the other. Choosing the unit at the source avoids the classic double-conversion bug where a rounded degree value is converted back to radians and drifts away from the true answer.
If you omit the parameter entirely, the default 'both' applies, so the simplest possible request — just a value — already returns a complete answer: the echo of your input plus the angle in each unit.
What you can do with it
Slope to inclination angle
Pass the gradient (rise over run) of a ramp, road or terrain profile to atan and read the inclination angle in degrees or radians.
Phase of a complex number
Divide the imaginary part by the real part and invert the tangent to recover the phase angle of a signal, phasor or impedance.
FAQ
What inputs are accepted?
Any finite real number — negative, zero or positive.
Why is Infinity rejected if atan(∞) is π/2?
Because Infinity is not a number your model produced on purpose; it usually means a denominator collapsed to zero. The calculator fails fast so you detect that case deliberately instead of silently receiving 90 degrees.
What units can I get?
Radians, degrees, or both at once. The default is 'both', and the degree value is derived exactly as radians × 180 / π.
Is my input stored?
No. The value is used for the calculation and discarded; only the computed angle is returned.
Which angle does it return when several angles share a tangent?
It returns the principal value, the one angle between -90 and 90 degrees whose tangent matches your number. Because tangent repeats, infinitely many angles share it, and this is the convention textbooks, navigation formulas and physics assume.
Related tools
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/math/arcus-tangent \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"value":1}'const res = await fetch("https://api.kit.forhosting.com/math/arcus-tangent", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"value": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/arcus-tangent",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"value": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/arcus-tangent", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"value":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"value":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/arcus-tangent", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"value": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.arcus_tangent",
"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. |
Technical notes
Non-numeric or non-finite input such as NaN or Infinity is rejected with a clear invalid_input error instead of returning NaN, so automated pipelines fail loudly and early. The exact same code runs free in your browser on this page; you only pay $0.002 per request when you call it through the API.
What the arcus tangent actually computes
The input must be a finite number; anything that is not — a missing value, a non-numeric string, NaN or Infinity — is rejected with an invalid_input error naming the offending input rather than silently emitting NaN. That strictness matters when the value came from a longer computation: a division that produced Infinity when its denominator collapsed to zero should be caught at the boundary, not allowed to propagate quietly through every downstream step.
Radians, degrees, or both
Every response echoes the value you sent, which makes results self-describing when they are logged or stored for an audit trail, and lets you reconstruct the request without keeping a separate record of what was asked.
Where it fits and what it costs
Inverse tangent appears wherever an angle must be recovered from a ratio of two components: converting the slope of a line or a terrain gradient into an inclination angle, extracting a heading from the east and north components of a velocity vector, computing the phase angle of a complex number or an impedance in AC circuit analysis, recovering a camera tilt from image geometry, or inverting a tangent term in a positioning formula. In all of those the arithmetic is trivial but the boundary handling is not: a component that collapses to zero turns the ratio into Infinity, and a library that accepts it silently hands you π/2 as if nothing unusual happened. This endpoint fails fast on non-finite input instead, so the anomaly surfaces where it was made — if a vertical line is legitimate in your model, detect it yourself and handle it deliberately. It runs as a pure calculation on our global edge with nothing stored after the response, and the identical module powers the free calculator on this page, so the browser and the API can never disagree. Browser use is free and unlimited; API calls cost $0.002 per request with no per-unit surcharge, which makes it practical to validate every call in a pipeline rather than sampling a few.
Integration use cases
Validate pipeline ratios
Send every computed tangent through the API: NaN and Infinity from collapsed denominators are rejected loudly instead of propagating downstream.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free and unlimited to run in your browser on this page.
Which angle does it return when several share a tangent?
Always the principal value: the unique angle in (-π/2, π/2) radians, i.e. -90 to 90 degrees exclusive, with that tangent.