ForHosting KIT · Math

Is it a right triangle checker

Find out in one step whether three lengths make a right triangle: 3, 4 and 5 do, because 3² + 4² gives 25, exactly 5². Sides that cannot form any triangle get a plain no. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
A
3
B
4
C
5
You get
Sorted sides
3, 4, 5
Leg 1
3
Leg 2
4
Hypotenuse
5

Students, tutors, builders, and automation scripts often need a clear yes-or-no answer to one geometry question: do three given side lengths form a right triangle? This is-it-a-right-triangle checker applies the converse of the Pythagorean theorem: sort the sides so the longest is the hypotenuse candidate, then test whether the sum of the squares of the two shorter sides matches the square of the longest side within a configurable relative residual tolerance. Degenerate or non-triangle triples fail the triangle inequality and return false rather than inventing a right angle.

How the converse of Pythagoras decides a right triangle

A triangle with side lengths a, b, and c is a right triangle if and only if the square of the longest side equals the sum of the squares of the other two sides. That statement is the converse of the Pythagorean theorem, and it is the exact test this capability runs. The order in which you send a, b, and c does not matter: the engine sorts the three positive lengths ascending and treats the largest as the only plausible hypotenuse.

It then computes residual equals the absolute value of leg1 squared plus leg2 squared minus hypotenuse squared. To survive floating-point noise on near-integer or decimal triples, the residual is compared against tolerance times a positive scale, where scale is the maximum of one, the sum of the leg squares, and the hypotenuse square.

The default relative tolerance is one times ten to the minus nine, which accepts classic integer Pythagorean triples such as three-four-five and five-twelve-thirteen with zero residual, while still allowing tiny rounding drift from decimal inputs like point three, point four, point five. Before the Pythagorean test, the strict triangle inequality is applied: the sum of the two shorter sides must be strictly greater than the longest.

Homework and Pythagorean triple checks

Let students submit three side lengths and instantly verify whether a² + b² equals c², with residual and sorted hypotenuse shown for partial-credit review.

LMS and exam auto-grading

Mark right-triangle classification items with a deterministic oracle that returns false for non-right and non-triangle triples without inventing angles.

How does the is-it-a-right-triangle checker work?

It sorts your three positive side lengths, treats the longest as the hypotenuse candidate, and tests whether leg1² + leg2² equals hypotenuse² within the relative residual tolerance (default 1e-9).

Does the order of sides a, b, and c matter?

No. Any order is accepted; the engine always re-sorts so the longest side is the hypotenuse candidate before applying the converse of Pythagoras.

Can I loosen the floating-point tolerance?

Yes. Send optional tolerance (or tol/eps) as a finite number between 0 and 0.1. Larger values accept larger relative residuals when measurements are noisy.

Is a triangle with sides 3, 4 and 5 a right triangle?

Yes. The two shorter sides squared add up to 25, which is exactly the square of 5, so the angle opposite the longest side is a right angle. The leftover difference shown is 0.

What if my three lengths do not form a triangle at all?

You get a clear no. If the two shorter sides together are not longer than the longest one, the points lie on a line, so the checker reports that there is no triangle instead of inventing a right angle.

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.

POSThttps://api.kit.forhosting.com/trig/is-right-triangle

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.

curl -X POST https://api.kit.forhosting.com/trig/is-right-triangle \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a":3,"b":4,"c":5}'
{
  "a": 3,
  "b": 4,
  "c": 5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "trig.is_right_triangle",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The response is a boolean plus the sorted legs, hypotenuse, residual, and a short human-readable message—never a vague empty list. No network calls, no randomness, and no clock dependence: every finite positive triple yields a reproducible result at the published $0.002 base price when you call the API.

How the converse of Pythagoras decides a right triangle

If that inequality fails, the lengths do not form a triangle at all, so the tool returns is_triangle false and is_right_triangle false with an explanatory message. That design keeps classroom language honest—collinear points are not a triangle—and keeps API clients from treating geometry failure as a hard invalid_input billable edge case when the numbers themselves were well formed.

Input contract, response fields, and invalid_input behaviour

An optional tolerance field (also tol or eps) overrides the default relative residual threshold; it must be a finite number between zero and one tenth inclusive. Example: a equals two, b equals three, c equals four yields a valid non-right triangle with residual far above the threshold. Missing c or a negative side fails validation and is not billed. POST a JSON object with three required positive finite numbers a, b, and c. Optional aliases side_a, side_b, and side_c are accepted for the same three lengths. Each side may arrive as a JSON number or as a numeric string; empty strings, booleans, NaN, Infinity, zero, and negative values fail with invalid_input naming the field. Sides larger than one times ten to the twelfth are rejected to keep squared intermediates finite in IEEE double arithmetic. On success the body echoes the rounded inputs, the ascending sorted_sides array, leg_1 and leg_2 as the two shorter sides, hypotenuse as the longest, is_triangle, is_right_triangle, sum_of_squares_legs, hypotenuse_squared, residual, the effective tolerance, a formula string restating a squared plus b squared equals c squared, and a message string suitable for UI copy. Example: a equals three, b equals four, c equals five yields is_right_triangle true with residual zero. Pair the boolean with your own diagram if you need a sketch; this endpoint classifies only and does not emit plots, angle measures in degrees, or area unless you call a sibling geometry tool.

Where a right-triangle side checker earns its keep

Classrooms and tutoring platforms use an is-it-a-right-triangle checker so learners can verify Pythagorean triples and near-misses without flipping squaring errors by hand. Exam generators and LMS plugins need a deterministic oracle that marks true only when the converse holds within tolerance and that returns false—not a crash—when the triple is scalene but non-right or fails to close as a triangle. Construction and CAD pre-checks often receive three measured lengths from a field tablet and must decide quickly whether a corner is square enough for framing or shop cut lists before ordering stock. Keep requests small, pin residual and boolean fields in tests, and you get reproducible geometry classification for homework, grading, and edge workers without standing up a full computer-algebra stack. When you later need missing-side solves or angle recovery, combine this checker with a dedicated right-triangle calculator; this page answers only the boolean converse-of-Pythagoras question from three known sides.

Field measurement and framing pre-checks

Feed three measured lengths from a job site or shop floor into the API to decide whether a corner is square within a chosen relative tolerance.

What if the three lengths do not form a triangle?

The tool returns is_triangle false and is_right_triangle false with an explanatory message. That is a successful classification, not an invalid_input error.

What does the right triangle checker cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →