Right triangle trig solver
Get every side and angle from one angle and one length: a 30° angle with an opposite side of 5 gives a hypotenuse of 10 and a second acute angle of 60°, plus the adjacent side. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Angle
- 30
- Side
- 5
- Known side
- Opposite
- Other acute
- 60
- Right angle
- 90
- Opposite
- 5
- Adjacent
- 8.6602540378
When you know one acute angle of a right triangle and the length of any one side, SOHCAHTOA recovers the other two sides and the complementary acute angle without drawing or iteration. This calculator accepts the angle in degrees, a positive side length, and a role for that side relative to the known angle—opposite, adjacent, or hypotenuse—then applies sine, cosine, or tangent as appropriate and returns opposite, adjacent, hypotenuse, both acute angles, and the fixed right angle of ninety degrees.
How SOHCAHTOA solves a right triangle from one angle and one side
In a right triangle one angle is always ninety degrees, so the two acute angles are complementary and sum to ninety. SOHCAHTOA encodes three ratios: sine of theta equals opposite over hypotenuse, cosine of theta equals adjacent over hypotenuse, and tangent of theta equals opposite over adjacent. Given theta and any one of those three lengths, algebra recovers the other two.
If the opposite is known, the hypotenuse is opposite divided by sine of theta and the adjacent is opposite divided by tangent of theta. If the adjacent is known, the hypotenuse is adjacent divided by cosine of theta and the opposite is adjacent times tangent of theta. If the hypotenuse is known, the opposite is hypotenuse times sine of theta and the adjacent is hypotenuse times cosine of theta.
The complementary acute is simply ninety minus theta. Because every quantity is a closed-form evaluation of elementary trig functions after validation, the path is fully deterministic: the same angle, side, and role always produce the same sides and angles within floating-point rounding. Classic classroom checks include a thirty-degree angle with opposite side five, which should yield a hypotenuse of ten and an adjacent of five times the square root of three, and a three-four-five family where one acute is the arctangent of three over four.
Where right-triangle SOHCAHTOA shows up in real work
Secondary-school and college trigonometry courses constantly ask students to find every side and angle of a right triangle when only one acute angle and one side are known; a trusted calculator with a strict acute-angle check speeds homework grading and removes spreadsheet mistakes where someone confuses opposite with adjacent or feeds ninety degrees into sine without noticing the degenerate case.
Construction and DIY workflows use the same ratios for ramps, stairs, rafters, and guy wires when an incline angle and one measured length are available—having a shared numeric oracle keeps field notes and office scripts aligned. If you later need oblique SSS via the law of cosines, ASA general triangles, area from two legs, or radian input and output, treat those as separate search intents rather than overloading this right-triangle SOHCAHTOA landing.
What you can do with it
Homework and exam checks
Find every side and angle from one acute angle and one side with SOHCAHTOA; reject non-acute angles with a clear error instead of NaN.
Ramps, rafters, and field layout
From an incline angle and one measured length, recover the remaining legs and hypotenuse before cutting or staking.
FAQ
What does this calculator compute?
Given one acute angle in degrees and one side of a right triangle (opposite, adjacent, or hypotenuse relative to that angle), it returns all three sides and all three angles using SOHCAHTOA.
What formulas does it use?
sin θ = opposite/hypotenuse, cos θ = adjacent/hypotenuse, tan θ = opposite/adjacent. The complementary acute is 90° − θ; the right angle is always 90°.
What does it cost?
The browser tool is free and runs locally.
How do I solve a right triangle with a 30° angle and an opposite side of 5?
Divide 5 by the sine of 30° to get the hypotenuse, which is 10. Divide 5 by the tangent of 30° for the adjacent side, and subtract 30° from 90° for the other acute angle, 60°.
How do I tell the opposite, adjacent and hypotenuse apart?
Look from your known angle. The opposite side sits across from it, the adjacent side touches it but is not the longest, and the hypotenuse is always across from the right 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/trig/right-triangle-trig \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"angle":30,"side":5,"known_side":"opposite"}'const res = await fetch("https://api.kit.forhosting.com/trig/right-triangle-trig", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"angle": 30,
"side": 5,
"known_side": "opposite"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/trig/right-triangle-trig",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"angle": 30,
"side": 5,
"known_side": "opposite"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/trig/right-triangle-trig", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"angle":30,"side":5,"known_side":"opposite"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"angle":30,"side":5,"known_side":"opposite"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/trig/right-triangle-trig", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"angle": 30,
"side": 5,
"known_side": "opposite"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "trig.right_triangle_trig",
"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
Degenerate cases—angles not strictly between zero and ninety degrees, non-positive sides, or unknown side roles—are rejected with a clear invalid_input error instead of silent NaN or sides that violate the right-triangle relationship. The free browser tool and the paid API share one pure function, so classroom demos and automated pipelines never silently diverge on the same inputs.
How SOHCAHTOA solves a right triangle from one angle and one side
Label the sides relative to a chosen acute angle theta: the opposite leg is across from theta, the adjacent leg shares a vertex with theta but is not the longest side, and the hypotenuse is always opposite the right angle.
What you send and what you get back
Wire the free browser tool for quick sanity checks, then call the identical contract from scripts when you need bulk right-triangle recovery without reimplementing SOHCAHTOA and the angle gate in every language. Provide three required fields: angle (aliases theta, angle_deg, acute_angle), a finite number of degrees strictly between zero and ninety; side (aliases length, side_length, value), a positive finite length in any consistent linear unit; and known_side (aliases side_type, role, which_side), one of the strings opposite, adjacent, or hypotenuse describing which side the length refers to relative to the known angle. Short tokens opp, adj, and hyp are accepted as aliases of those roles. Missing fields, non-numeric strings, NaN, Infinity, angles at or outside the open zero-to-ninety interval, and non-positive sides are rejected with invalid_input and are not charged. On success the JSON response echoes the normalized known angle, returns other_acute as ninety minus that angle, right_angle as ninety, and the three sides opposite, adjacent, and hypotenuse relative to the known angle, plus known_side as the normalized role, unit_angles as deg, and method as the string sohcahtoa for documentation in logs and teaching UIs. Example checks: angle thirty, side five, known_side opposite yields hypotenuse ten and adjacent approximately eight point six six zero; angle forty-five with hypotenuse one yields equal legs of one over square root of two; angle ninety or zero fails the acute-angle gate; a negative side fails the same way.
Where right-triangle SOHCAHTOA shows up in real work
Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
Game and graphics slopes
Recover missing right-triangle legs when pitch and one edge are known, using the same SOHCAHTOA path in browser and API.
Technical questions
What happens if the angle is not between 0 and 90 degrees?
The request fails with invalid_input. A non-degenerate right triangle requires a strictly acute angle: greater than 0° and less than 90°.
Are angles in degrees or radians?
Degrees only for input and output. The response includes unit_angles: "deg". Convert to radians yourself after the call if your pipeline needs radians.