SAS triangle solver
Sides of 3 and 4 that meet at 90° close a triangle with a third side of 5, an area of 6 and a perimeter of 12. Enter two sides and the angle between them to get the missing side and angles, area and perimeter. 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
- Included angle
- 90
- C
- 5
- Angle a
- 36.8698976458
- Angle b
- 53.1301023542
- Angle sum
- 180
Side-angle-side, written SAS, is the congruence case that fixes a unique triangle from two side lengths and the angle sitting between them. Surveyors, carpenters, and students meet this data constantly: two measured edges and the corner they share.
What SAS means and how the formulas lock the triangle
SAS names the unique-triangle case in which you already know two side lengths and the angle that sits between those two sides, not an angle opposite one of them. That distinction is the whole point of a dedicated SAS triangle solver. When the given angle is opposite a known side, you are in the SSA ambiguous case and may have zero, one, or two triangles.
When the angle is the included corner, the figure is locked: one pair of sides and the hinge between them determine the third side, the other two interior angles, the area, and the perimeter. The third side follows the law of cosines. If a and b are the known sides and C is the included angle in degrees, convert C to radians, then compute c as the positive square root of a squared plus b squared minus twice a b times the cosine of C.
The area is one half a b times the sine of C, which is positive exactly when C is strictly between zero and one hundred eighty degrees. Remaining angles at A and B are recovered with the law of cosines as well, using inverse cosine so an obtuse included angle stays obtuse and is never folded back into an acute look-alike. A classroom check is immediate: a equals three, b equals four, C equals ninety degrees must close to the five-unit hypotenuse, area six, and complementary acute angles.
An isosceles pair with a sixty-degree included angle closes to an equilateral triangle when the sides match. Every step is elementary trigonometry on three scalars, so the result is deterministic, has no iteration, and never depends on the clock or a random seed.
Practical tips, limits, and when SAS is the right case
Angles are degrees only in the public contract; convert from radians in your client if your sensor stack uses radians. When teaching, prefer paired examples: three-four-ninety for a classic right triangle; equal sides with a sixty-degree included angle for the equilateral case; and an angle of one hundred eighty or zero to demonstrate the hard rejection path that protects callers from a zero-area figure. Prefer SAS when the angle you measured is the corner between the two measured edges—typical in surveying, carpentry miters, and path-closing problems.
If you already know three sides and want area only, Heron's formula is a different search; if you know two angles and a non-included side, use an AAS solver instead of forcing those numbers into this SAS contract.
What you can do with it
Surveying and construction takeoff from two edges and a corner
Turn measured fence runs or wall lengths plus the included corner angle into the closing side, floor area, and interior angles without a separate CAD pass.
Game, CAD, and path-closing tools
Close a polygonal path or validate a triangle mesh fragment when two edge lengths and the hinge angle between them are already known in the scene graph.
FAQ
What does SAS mean in a triangle solver?
SAS means side-angle-side: two side lengths and the angle included between them. That data uniquely determines the third side, the other two angles, the area, and the perimeter when the angle is between 0° and 180° exclusive.
How is the third side computed?
With the law of cosines: c = sqrt(a² + b² − 2ab cos C), where C is the included angle in degrees converted to radians for the cosine.
Why are included angles of 0° or 180° rejected?
Those values make area zero and collapse the figure to a line segment.
Does this solve the ambiguous SSA case?
No. This capability is SAS only. SSA (two sides and a non-included angle) can be ambiguous and is outside this contract.
What does the SAS triangle solver cost?
The browser tool is free and runs locally.
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/sas-triangle \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":3,"b":4,"included_angle":90}'const res = await fetch("https://api.kit.forhosting.com/math/sas-triangle", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 3,
"b": 4,
"included_angle": 90
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/sas-triangle",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 3,
"b": 4,
"included_angle": 90
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/sas-triangle", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":3,"b":4,"included_angle":90}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":3,"b":4,"included_angle":90}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/sas-triangle", 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,
"included_angle": 90
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.sas_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.
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 SAS triangle solver takes those three numbers, applies the law of cosines for the unknown third side, recovers the two remaining interior angles, and returns the complete triangle—sides, angles, area, and perimeter—as deterministic JSON. The included angle must lie strictly between zero and one hundred eighty degrees; values at or beyond those bounds collapse the figure to a line and are rejected as invalid_input. The same pure function powers the free browser tool and the prepaid API path at $0.002 per successful request, so homework checks and production scripts never disagree on a 3-4-90 right triangle or an isosceles close.
How to call the API and what the full solution contains
Use it from geometry homework pipelines, construction takeoff scripts, game-level tooling, interview-prep sandboxes, or any workflow that needs a reproducible SAS solve without installing a computer-algebra package on every machine. Send a JSON body with three required fields. Field a is the first positive side length; aliases side_a and side1 are accepted. Field b is the second positive side; aliases side_b and side2 map to the same meaning. Field included_angle is the included angle between those sides, measured in degrees, strictly greater than zero and strictly less than one hundred eighty; aliases angle, angle_c, and C are accepted. On success the response echoes a, b, and included_angle, adds the unknown side c, remaining angles angle_a and angle_b in degrees, angle_sum near one hundred eighty, area, perimeter, unit_angle set to degrees, method SAS, and a formula string documenting the closed forms. Failed validation—missing a required field, a non-finite number, a non-positive side, an included angle at or outside the open zero-to-one-hundred-eighty interval, or a numerically degenerate configuration—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item. Keep sides inside the published positive range up to one trillion so intermediate products stay finite in IEEE double precision on the Worker and in the browser.
Practical tips, limits, and when SAS is the right case
Because remaining angles come from inverse cosine after the third side is known, students can recompute cos A and cos B by hand for small integers and match the API line by line. This landing targets people searching for an SAS triangle solver or a two-sides-and-included-angle calculator; it is not an SSA ambiguous-case tool and will not invent a second triangle when only an opposite angle is known. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when users type out-of-range angles while learning the contract. Round-trip checks are easy: after solving, confirm that angle_a plus angle_b plus included_angle is approximately one hundred eighty degrees and that the law of cosines reconstructs c from a, b, and C within floating tolerance.
Integration use cases
Homework and exam checks for SAS problems
Give students two sides and the included angle; compare their hand-computed third side, remaining angles, and area against a deterministic API or free browser result.