Tangent from line slope calculator
A slope of 1 means the line climbs at 45°: enter any finite slope and get its inclination angle in degrees and radians, plus whether the line rises, falls or stays flat. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Slope
- 1
- Angle degrees
- 45
- Angle radians
- 0.7853981634
- Direction
- rising
Every non-vertical straight line in the coordinate plane has a slope m equal to rise over run, and that same number is exactly the tangent of the line’s inclination angle θ measured from the positive x-axis. Students learning the slope–angle relationship, surveyors converting percent grade notes into degrees, CAD users checking a drafted ramp, and game or physics scripts that store direction as a number all need a deterministic inverse: given m, recover θ = arctan(m). This capacity accepts a single finite slope, applies the principal arctangent, returns the angle in degrees and radians with a rising, falling, or horizontal direction label, and fails clearly when the slope is missing or non-finite—because a vertical line has no finite slope and no unique tan(θ) representation.
What slope means as tan(θ) and why arctan recovers the inclination angle
In analytic geometry the slope of a non-vertical line is the ratio of the vertical change to the horizontal change between any two distinct points on that line. If the line rises three units while running one unit to the right, m equals three; if it falls one unit while running one unit to the right, m equals negative one; if it is horizontal, m equals zero.
Trigonometry identifies that ratio with the tangent of the inclination angle θ, the directed angle from the positive x-axis up to the line, conventionally taken in the open interval from negative ninety degrees to positive ninety degrees so that every finite slope maps to exactly one principal angle. Therefore m equals tan(θ) and, conversely, θ equals arctan(m). Search intent clusters around phrases such as tangent from slope, line slope to angle degrees, inclination angle calculator, arctan of slope, and convert rise-over-run to degrees.
What you can do with it
Homework and exam slope–angle drills
Students and graders convert a textbook slope m into θ = arctan(m) in degrees, including clear labels for rising, falling, and horizontal lines.
FAQ
Why is the angle always between −90° and 90°?
The principal arctangent maps every finite real to (−90°, 90°). That matches the conventional inclination of a non-vertical line from the positive x-axis.
Is the tangent-from-slope calculator free?
The browser tool runs free on your device.
Does slope zero mean a horizontal line?
Yes. When m is zero, tan(θ) is zero, so θ is 0° and the direction label is horizontal.
What angle does a slope of 1 give?
A slope of 1 gives an inclination of 45°, and the line is labelled as rising. Rise and run are equal, so the line climbs exactly as much as it moves to the right.
Why can't I get the angle of a vertical line?
A vertical line has no finite slope, so there is no number to enter and the calculator stops with a clear message instead of guessing. Very steep slopes approach 90° but never reach it.
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/trig/tangent-from-slope \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"slope":1}'const res = await fetch("https://api.kit.forhosting.com/trig/tangent-from-slope", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"slope": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/trig/tangent-from-slope",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"slope": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/trig/tangent-from-slope", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"slope":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"slope":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/trig/tangent-from-slope", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"slope": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "trig.tangent_from_slope",
"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
What slope means as tan(θ) and why arctan recovers the inclination angle
Delivering both degrees and radians as structured JSON, together with a short direction label, makes the result easy to paste into notes, assert in continuous integration, or feed into a larger pipeline without reimplementing degree conversion and sign interpretation in every language you teach or deploy.
How this calculator validates the slope and shapes the response
There is no second point, no intercept, and no automatic percent-grade conversion: if you only know two points, first form m equals (y2 minus y1) over (x2 minus x1) elsewhere, then pass that finite m here. Edge cases are explicit—zero slope returns zero degrees and the horizontal label; large positive slopes approach but never reach ninety degrees; large negative slopes approach negative ninety degrees—so clients never receive a vertical claim from a finite number. Failed validation is not billed; only successful conversions consume the published item price. Send a JSON body with the required field slope set to a finite number (numeric strings are accepted after trim). The field may also be supplied under the alias m when slope is absent. Missing input, empty strings, booleans, objects, NaN, and Infinity all fail with invalid_input: Infinity would correspond to a vertical line, which has undefined slope and cannot be written as a finite tan(θ). On success the engine computes angle_radians with Math.atan of the slope, multiplies by one hundred eighty over pi for angle_degrees, echoes the rounded slope, attaches direction as horizontal when m is zero, rising when m is positive, and falling when m is negative, and includes a formula string restating θ equals arctan(m).
Practical uses, limits, pricing, and delivery channels
Use the browser tool when you want an immediate slope-to-angle conversion while checking homework, verifying a ramp or roof pitch note expressed as rise over run, or confirming a scripted heading without installing a computer-algebra system. Accepted inputs are finite reals only: there is no complex branch, no multi-value inverse family beyond the principal arctangent range, and no claim to model a vertical line. Results are fully deterministic—the same slope always yields the same degrees, radians, direction, and formula—so the capacity is safe to pin in continuous-integration checks and reproducible lesson materials. Each successful request is one billable item at $0.002; failed validation does not consume balance. Wire the endpoint into slope calculators, grade-to-angle demos, contest answer checkers, or floating preprocessing steps where you already prefer an explicit invalid_input error over opaque widgets that invent ninety degrees for Infinity.
Integration use cases
Deterministic fixtures for CAD and game physics tests
Pipelines that store direction as rise-over-run can call a pure arctan oracle instead of reimplementing degree conversion in every language.
Site plans and ramp notes from rise over run
Field notes that record slope as a ratio recover a stable inclination angle in degrees and radians as structured JSON for logs or lightweight map helpers.
Technical questions
How do I get the inclination angle from a line slope?
Send a finite slope m to trig.tangent_from_slope. The response returns angle_degrees, angle_radians, direction, and the formula θ = arctan(m).
What happens for a vertical line?
Vertical lines have undefined (infinite) slope. Non-finite slope values fail with invalid_input and are not charged.