Triangle ratio calculator
If two sides of a triangle are in the ratio 2:5 and the side matching the 2 measures 6, the other side is 15. Enter the known side and both parts of the ratio and get the missing length and the scale factor. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Known side
- 6
- Known ratio
- 2
- Unknown ratio
- 5
- Unknown side
- 15
- Scale
- 2.5
A triangle side-ratio calculator recovers one unknown length when another side is already measured and the two sides stand in a known proportion. Survey sketches, similar-figure homework, and scale drawings all reduce to the same closed form: the unknown length equals the known length times the unknown part of the ratio divided by the known part.
What a triangle side ratio means and how the unknown side appears
Two sides of a triangle stand in a given ratio when each length is a positive multiple of the same unit part. Classic classroom pairs appear immediately. Sides in the ratio two to five with a known side of six matching the two recover an unknown side of fifteen.
Sides in the ratio three to four with a known side of twelve matching the three recover sixteen. A scale of three halves sends a known side of eight to twelve. Because a Euclidean length cannot be zero or negative, every given quantity must be a positive finite number; a zero run, a signed cut, Infinity, or a non-numeric token is not a geometric side or a usable ratio part and must not look like a successful solve.
This calculator encodes that contract end to end and returns the unknown length together with the echoed inputs and the scale factor from the known part of the ratio to the unknown part.
Where side ratios come up in practice
Classrooms and tutoring platforms use a triangle side-ratio calculator so learners can verify the missing corresponding length without mixing up which part of the ratio to write first. Construction and layout tools convert a measured member plus a stated proportion into the remaining cut length before ordering stock. Roof, ramp, and pattern sketches often copy one side at a new ratio: a known length and two ratio parts fix the unknown without reopening a trigonometry table.
Game engines and physics sandboxes spawn a scaled copy from whichever side the designer already stored and the ratio the art brief named. Exam generators and LMS plugins need a deterministic oracle that rejects a non-positive side or ratio instead of taking absolute values and marking a signed homework token as correct.
The landing is deliberately narrower than a full triangle solver: it does not return angles or area and it does not invent a hypotenuse from two legs, so the page stays aligned with the search for an unknown side from a known side and a given side ratio.
What you can do with it
Classroom side-ratio checks
Students enter a known side and a two-part ratio such as 2:5 to verify the missing length against textbook proportion exercises.
Scaled cut from a measured member
Convert a measured stock length plus a stated side ratio into the remaining cut before ordering material or printing a pattern.
Exam and LMS auto-grading
Mark side-ratio items with a deterministic oracle that rejects a non-positive known side or ratio part instead of silently taking absolute values.
FAQ
What happens if the known side or a ratio part is zero or negative?
A Euclidean length and a usable ratio part must be positive finite numbers; those failures are not billed.
Is this the same as similar right triangles or Pythagoras?
No. This landing recovers one unknown from a known side and an explicit two-part side ratio. It does not take three corresponding sides of two right triangles, and it does not apply a²+b²=c².
How do I find a side from a ratio like 2:5?
Multiply the known side by the part of the ratio that belongs to the missing side, then divide by the part that belongs to the known side. A known side of 6 matching the 2 gives 6 × 5 ÷ 2, which is 15.
Which part of the ratio belongs to the side I measured?
The part that describes that same side. Swapping the two parts is the most common mistake: the result then shrinks instead of grows. Write down which side each number of the ratio refers to before you enter them.
What is the scale factor in the result?
It is the part of the ratio for the missing side divided by the part for the known side, so it tells you how many times larger or smaller the missing side is. For 2:5 it is 2.5; a scale of 3/2 turns a side of 8 into 12.
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/triangle-ratio \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"known_side":6,"known_ratio":2,"unknown_ratio":5}'const res = await fetch("https://api.kit.forhosting.com/math/triangle-ratio", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"known_side": 6,
"known_ratio": 2,
"unknown_ratio": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/triangle-ratio",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"known_side": 6,
"known_ratio": 2,
"unknown_ratio": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/triangle-ratio", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"known_side":6,"known_ratio":2,"unknown_ratio":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"known_side":6,"known_ratio":2,"unknown_ratio":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/triangle-ratio", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"known_side": 6,
"known_ratio": 2,
"unknown_ratio": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.triangle_ratio",
"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
This endpoint accepts those three positive finite numbers, applies that proportion exactly, and returns the unknown side together with the scale factor and the identity used. A zero, negative, or non-numeric known side or ratio part is not a geometric length, so the task fails with invalid_input and is not billed.
What a triangle side ratio means and how the unknown side appears
If the known side corresponds to the first part of the ratio and the missing side corresponds to the second part, the defining proportion is known_side over known_ratio equals unknown_side over unknown_ratio. Cross-multiplying and dividing yields the closed form this calculator uses: the unknown side equals the known side times unknown_ratio divided by known_ratio. That identity is the same statement as similar figures, corresponding sides of a scaled copy, or a bar model that splits a pair of lengths into matching parts. It is not a search, a numeric fit, or an appeal to the Pythagorean theorem: the caller already treats the two sides as standing in that ratio, so the scale factor alone recovers the missing length.
Input contract, response shape, and error behaviour
You supply the known length and both ratio parts already in one consistent unit. POST a JSON body with three required positive finite numbers: known_side, the measured length; known_ratio, the part of the side ratio that belongs to that measured length; and unknown_ratio, the part that belongs to the missing length. Each field may arrive as a JSON number or as a numeric string. Field known_side also accepts the aliases side, length, and given_side; known_ratio accepts ratio_known and known_part; unknown_ratio accepts ratio_unknown and unknown_part. A missing field, an empty string, Infinity, NaN, or a token that is not a decimal number fails with invalid_input naming the field and stating that a positive finite number is expected. A given known side or ratio part that is zero or negative fails with invalid_input stating that the value must be greater than zero. Those validation failures are not billed. On success the body returns unknown_side as the recovered length, echoes the three inputs, reports scale as unknown_ratio divided by known_ratio, restates the identity in the formula field, and sets method to triangle_ratio so clients can distinguish this landing from a Pythagorean missing-side solver or a similar-right-triangles quartet. Example: known_side equals six, known_ratio equals two, and unknown_ratio equals five yields unknown_side fifteen with scale two and a half. Example: known_side equals seven and a half, known_ratio equals three, and unknown_ratio equals four yields unknown_side ten. Pair the structured JSON with your own drawing code if you need a sketch; this endpoint returns numbers only and does not emit SVG, step-by-step prose beyond the field names, or unit conversion.
Where a triangle side-ratio API earns its keep
Keep requests small, pin the rounded unknown_side in tests, and you get reproducible geometry for homework, edge workers, and design scripts without standing up symbolic math infrastructure of your own.
Technical questions
How do I find an unknown triangle side from a known side and a ratio?
Send three positive finite numbers: known_side, known_ratio (the ratio part for that side), and unknown_ratio (the ratio part for the missing side). The API returns unknown_side = known_side × (unknown_ratio / known_ratio).
Which aliases does the triangle ratio calculator accept?
known_side also accepts side, length, and given_side. known_ratio accepts ratio_known and known_part. unknown_ratio accepts ratio_unknown and unknown_part.
What does the triangle side-ratio calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.