SAS triangle calculator
Two sides and the angle between them give you the whole triangle: sides 3 and 4 with 90° between them close with a third side of 5, an area of 6 and angles of 36.869897645844° and 53.130102354156°. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- First side length
- 3
- Second side length
- 4
- Angle c
- 90
- C
- 5
- Angle a
- 36.8698976458
- Angle b
- 53.1301023542
- Angle sum
- 180
Side-angle-side (SAS) is the classic way to pin down a triangle when you know two lengths and the angle between them: a surveyor measures two fence runs and the corner between them; a student is given sides a and b with included angle C; a game or CAD path needs the closing edge, the area, and the other two angles without sketching by hand. This capability applies the law of cosines for the unknown third side, the half-ab-sine formula for area, and a second pair of cosine-law angle recoveries for the remaining vertices. The included angle must lie strictly between zero and one hundred eighty degrees so the figure is non-degenerate.
What SAS means and how the formulas work
SAS stands for side-angle-side: you supply two side lengths and the angle that sits between those two sides, not an angle opposite one of them. That distinction matters because the ambiguous SSA case can yield zero, one, or two triangles, while SAS always determines a unique triangle when the included angle is strictly between zero and one hundred eighty degrees and both sides are positive.
The third side follows the law of cosines: c squared equals a squared plus b squared minus two a b cos of C, so c is the positive square root of that quantity. Once c is known, angles at A and B are recovered with the law of cosines as well: cos A equals b squared plus c squared minus a squared, all over two b c, and likewise for B.
Using inverse cosine rather than the law of sines alone keeps obtuse included angles well behaved, because sine is symmetric about ninety degrees while cosine preserves the acute-versus-obtuse distinction. A right-triangle sanity check is immediate: a equals three, b equals four, C equals ninety degrees yields c equals five, area six, and complementary acute angles at A and B. An isosceles example with equal sides and a sixty-degree included angle closes to an equilateral triangle when the sides match.
Every step is elementary trigonometry on three scalars, so there is no iteration, no sampling, and no dependence on wall-clock time.
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 calculator?
SAS means side-angle-side: two side lengths and the angle included between them. That data uniquely determines the third side, the area, and the other two angles 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 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.
Is the SAS triangle calculator free?
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/geom/triangle-sas \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a":3,"b":4,"angle_c":90}'const res = await fetch("https://api.kit.forhosting.com/geom/triangle-sas", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a": 3,
"b": 4,
"angle_c": 90
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/triangle-sas",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a": 3,
"b": 4,
"angle_c": 90
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/triangle-sas", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a":3,"b":4,"angle_c":90}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a":3,"b":4,"angle_c":90}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/triangle-sas", 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,
"angle_c": 90
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.triangle_sas",
"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.
Limits
max_side | 1000000000000 |
min_angle_deg | 0 |
max_angle_deg | 180 |
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
Results are deterministic JSON—no computer-algebra system, no random seeds, and the same pure solve function in the free browser tool and the prepaid API path—so homework checks, grading scripts, and production pipelines all see the same numbers.
What SAS means and how the formulas work
The area is one half times a times b times sin of C, which is zero only at the degenerate endpoints zero and one hundred eighty degrees—exactly the cases this tool rejects.
How to call the API and what comes back
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 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 angle_c is the included angle between those sides, measured in degrees, strictly greater than zero and strictly less than one hundred eighty; aliases C, included_angle, and angle are accepted. On success the response echoes a, b, and angle_c, adds side c, 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 short formula block documenting the closed forms. Failed validation—missing a required field, a non-finite number, a non-positive side, an 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 and zero marginal unit price.
Practical tips, limits, and related searches
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. Keep side lengths 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. 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 calculator or a two-sides-and-included-angle solver; 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 angle_c 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, area, and remaining angles against a deterministic API or free browser result.