Classifying triangles by sides and angles
Enter three side lengths and get both labels at once: 3, 4 and 5 make a scalene right triangle. It sorts by sides and by angles, and first checks that the lengths can close into a triangle at all. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A
- 3
- B
- 4
- C
- 5
- By sides
- scalene
- By angles
- right
Given the three side lengths of a triangle, this capability answers the two classic classification questions in a single call: by sides — equilateral, isosceles or scalene — and by angles — acute, right or obtuse. It first checks that the lengths can actually form a triangle at all, applying the triangle inequality theorem, and rejects impossible triples with a clear error instead of a meaningless label. The angle classification uses the converse of the Pythagorean theorem, comparing the square of the longest side against the sum of the squares of the other two.
Two classifications, one call
Triangles are classified along two independent axes, and students often mix them up. The first axis looks at the sides: if all three sides are equal the triangle is equilateral; if exactly two are equal it is isosceles; and if all three differ it is scalene. The second axis looks at the angles: a triangle is right when one angle measures exactly 90 degrees, acute when all three angles are below 90 degrees, and obtuse when one angle exceeds 90 degrees.
Because the two axes are independent, any combination is possible — a 3-4-5 triangle is scalene and right, while an equilateral triangle is always acute.
Validity first: the triangle inequality
Not every three positive numbers describe a triangle. The triangle inequality theorem states that the sum of any two sides must be strictly greater than the third; in practice it is enough to check that the two shorter sides add up to more than the longest one. Lengths like 1, 2 and 5 fail that test — the short sides simply cannot reach each other — and so do degenerate cases like 1, 2 and 3, where the three points would collapse onto a single straight line.
The comparison uses a small relative tolerance so that floating-point inputs such as 0.1, 0.2 and 0.3 are judged the way a human would judge them, not the way raw binary arithmetic would.
How the angle test works without angles
You do not need trigonometry to know whether a triangle is acute, right or obtuse — the side lengths already decide it. Sort the sides so that z is the longest, then compare z² with x² + y². If they are equal, the triangle is right, by the converse of the Pythagorean theorem.
If z² is smaller, the longest side is 'too short' to open a right angle, so the opposite angle — and therefore the whole triangle — is acute. If z² is larger, the opposite angle opens past 90 degrees and the triangle is obtuse. That is the entire algorithm: one sort, three multiplications and one comparison, all done with a relative epsilon so decimal inputs behave predictably.
What you can do with it
Homework and quiz checking
Verify a student's classification of a triangle from three side lengths, returning both the side-based and angle-based labels plus a clear error when the triple is impossible.
Tutoring and e-learning apps
Generate instant feedback in geometry exercises: show whether 5-5-8 is isosceles and obtuse without writing your own validation logic.
Geometry data pipelines
Tag triangle records in a dataset with their two classifications before downstream analysis, rejecting degenerate or invalid measurements at the boundary.
FAQ
What input does it expect?
Three fields — a, b and c — each a positive finite number representing one side length, in any unit and any order.
Is an equilateral triangle also isosceles?
Mathematically yes under the inclusive definition, but this capability returns the most specific label: three equal sides are reported as equilateral, and isosceles is used only when exactly two sides are equal.
How does it decide between acute, right and obtuse?
By comparing the square of the longest side with the sum of the squares of the other two — the converse of the Pythagorean theorem — with a small relative tolerance for floating-point inputs.
Can I use decimal or very small side lengths?
Yes. Any positive finite numbers work, including decimals like 0.1, 2.5 or 7.75; the unit does not matter because only the ratios between the sides affect the result.
Why can the lengths 1, 2 and 3 not form a triangle?
Because the two shorter sides must add up to more than the longest one. Here 1 plus 2 only equals 3, so the three corners would fall on one straight line, and the tool rejects them instead of giving a label.
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/classifying-triangles \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":3,"b":4,"c":5}'const res = await fetch("https://api.kit.forhosting.com/math/classifying-triangles", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 3,
"b": 4,
"c": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/classifying-triangles",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 3,
"b": 4,
"c": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/classifying-triangles", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":3,"b":4,"c":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":3,"b":4,"c":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/classifying-triangles", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a": 3,
"b": 4,
"c": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.classifying_triangles",
"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
No approximations, no external services: a small deterministic computation you can run free in the browser or call through the API for $0.002 per request.
Two classifications, one call
This endpoint returns both classifications together, as the fields <code>by_sides</code> and <code>by_angles</code>, so a homework checker, a tutoring app or a geometry pipeline gets the complete answer in one request instead of computing the two tests separately and risking an inconsistent implementation of each.
Validity first: the triangle inequality
This capability validates the input before classifying anything: non-numeric values, zero or negative lengths, and triples that violate the inequality are all rejected with an <code>invalid_input</code> error and a message that explains why, and a failed call is never 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 happens if the sides cannot form a triangle?
The call fails with an invalid_input error explaining that the two shorter sides must add up to more than the longest side. Failed calls are not billed.