Arctangent calculator
Enter the ratio 1 and get its arctangent: 0.785398163397 radians, which is 45 degrees. Any finite number works, however extreme, and the angle always stays strictly between −π/2 and π/2, with radians and degrees side by side so they never disagree. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- X
- 1
- Input
- 1
- Radians
- 0.7853981634
- Degrees
- 45
- Range
- (-pi/2, pi/2)
You send one number, and you get back the angle in radians strictly between -pi/2 and pi/2, together with the equivalent in degrees. Non-finite or non-numeric input is rejected with a clear validation error instead of a silent wrong answer, so automated pipelines can trust the result they receive every single time.
What the arctangent actually gives you
The tangent function turns an angle into a ratio: rise over run, opposite over adjacent. The arctangent calculator goes the other way. Hand it the ratio 1 and it answers pi/4, roughly 0.785398 radians, because that is the angle whose tangent equals one.
Hand it -3.7 and it answers a negative angle of about -1.3069 radians, since the arctangent is an odd function whose sign follows its input. As the input grows without bound the output approaches pi/2 but never reaches it, and mirrored behavior holds on the negative side. For practical work this means you can feed in any finite ratio, however extreme, and receive a bounded, well-behaved angle that downstream trigonometry can consume without special cases, branch cuts, or quadrant ambiguity of its own to resolve first.
Why radians, and when you need degrees
Radians are the native unit of analysis: derivatives, integrals, and series expansions of trigonometric functions are only clean when angles are measured in radians, and every serious math library returns atan in radians for that reason. This capability returns radians first, exactly as the standard library computes them, and then adds the degree equivalent as a convenience so you do not multiply by 180/pi yourself. If you feed the result into another computation, use the radians field.
If a human reads it, the degrees field usually lands faster: 0.785398 radians is opaque, while 45 degrees is immediately recognizable. Either way, one call gives you both representations computed from the same underlying value, so the two numbers can never disagree with each other, and you never maintain a conversion constant of your own that could drift or be typed incorrectly.
Arctangent versus atan2, and input validation
One number in, one angle out — that is the contract here. The classic atan2 variant takes two arguments, a y and an x coordinate, and uses their signs to place the angle in the correct quadrant, returning values across the full circle. This capability deliberately handles the single-argument case only: a ratio with no quadrant information, which is exactly what slopes, gradients, and growth rates are.
Validation is strict by design. Infinite input is refused rather than mapped to pi/2 because accepting it would hide upstream bugs — a division overflow masquerading as a legitimate angle is precisely the failure you want surfaced, not smoothed over silently.
What you can do with it
Convert a slope to an angle
Turn a gradient from a sensor, a road grade, or a regression coefficient into the inclination angle it represents, in radians or degrees.
Stabilize a control loop
Map an unbounded error ratio into the bounded range (-pi/2, pi/2) so a controller sees a smooth, saturated signal instead of a runaway value.
Validate financial ratios
Convert growth-rate ratios into angles for geometric portfolio visualizations, with non-finite inputs rejected before they reach a chart.
FAQ
What happens if I send text or nothing?
The value must be a finite number; NaN and Infinity are also refused.
Is this the same as atan2?
No. atan2 takes two coordinates and resolves the quadrant. This capability takes a single ratio and returns the principal arctangent.
How accurate is the result?
It uses the platform's native arctangent and rounds to twelve decimal places, so results are stable and reproducible across machines.
Do you store my input?
No. The number is processed in memory and discarded; only the computed angle is returned.
Can I use it to turn a slope into an angle?
Yes. A slope is rise over run, which is exactly the tangent of the angle, so enter the slope as one number. A slope of 1 gives 45 degrees, and a negative slope gives a negative angle.
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/arctan \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"x":1}'const res = await fetch("https://api.kit.forhosting.com/math/arctan", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"x": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/arctan",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"x": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/arctan", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"x":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"x":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/arctan", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"x": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.arctan",
"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
The arctangent API answers a deceptively simple question: given a slope or ratio, what angle produces it? It is the inverse of the tangent function, computed deterministically with no rounding surprises — the same code runs free in your browser and behind the paid API.
What the arctangent actually gives you
The result is always the principal value: the unique angle in the open interval (-pi/2, pi/2) whose tangent matches your number. That guarantee is what makes the function a true inverse — every real number has exactly one answer, and the answer never lands on the vertical asymptotes themselves.
Arctangent versus atan2, and input validation
If you have raw coordinates, divide carefully or use a two-argument tool such as trig.inverse_tan instead; if you have a ratio, this is the right one. The input must be a finite number: strings that do not parse, missing fields, NaN, and positive or negative Infinity are all rejected with an invalid_input error before any computation happens, and rejected calls are not billed.
Technical questions
What does it cost?
$0.002 per request via the API. It is also free to run in your browser on this page.
What range does the result have?
The output is the principal value: an angle in radians strictly between -pi/2 and pi/2, plus the equivalent in degrees.