Home › Geometry › Triangle Solver
Triangle Solver
Solves a triangle from three sides (SSS) or from two sides and their included angle in degrees (SAS) with the law of cosines, returning all sides, all angles, perimeter, area, inradius, circumradius and the classification by sides and by angles.
When to use
You know three sides, or two sides and the angle between them, and need the remaining sides and angles, the area or the triangle type.
Do not use when: You know two angles and a side (ASA/AAS) or a non-included angle (SSA), which this calculator does not accept; for right triangles from two sides use right-triangle.
Formula
SAS: side_c = √(a² + b² − 2·a·b·cos C). Angles by the law of cosines: cos A = (b² + c² − a²) / (2·b·c), cos B = (a² + c² − b²) / (2·a·c), C = 180° − A − B. area = ½·a·b·sin C; inradius = area / s with s = perimeter / 2; circumradius = a·b·c / (4·area).
Sides must satisfy the triangle inequality. A triangle is classified as right when its largest angle is within 1e-6° of 90°, so rounded side lengths such as 1, 1, 1.4142 classify as acute.
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
side_a | number | units | yes | First side. Range: > 0 |
side_b | number | units | yes | Second side. Range: > 0 |
side_c | number | units | no | Third side, opposite the angle between a and b (SSS). Omit for SAS. Range: > 0 |
angle_c_deg | number | degrees | no | Included angle between side_a and side_b in degrees (SAS). Omit when side_c is given. Range: > 0 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
side_a | number | units | Side opposite angle A. |
side_b | number | units | Side opposite angle B. |
side_c | number | units | Side opposite angle C (computed for SAS). |
angle_a_deg | number | degrees | Angle opposite side_a. |
angle_b_deg | number | degrees | Angle opposite side_b. |
angle_c_deg | number | degrees | Angle opposite side_c. |
perimeter | number | units | side_a + side_b + side_c. |
area | number | units² | ½ · side_a · side_b · sin C. |
inradius | number | units | Radius of the inscribed circle = area / semiperimeter. |
circumradius | number | units | Radius of the circumscribed circle = a·b·c / (4 · area). |
side_type | string | equilateral, isosceles or scalene. | |
angle_type | string | acute, right or obtuse. | |
method | string | SSS or SAS. |
Example
Sides 3, 4, 5 (SSS): {"side_a":3,"side_b":4,"side_c":5} → {"angle_a_deg":36.8699,"angle_b_deg":53.1301,"angle_c_deg":90,"perimeter":12,"area":6,"inradius":1,"circumradius":2.5,"side_type":"scalene","angle_type":"right","method":"SSS"}
Sides 5 and 7 with 60° between them (SAS): {"side_a":5,"side_b":7,"angle_c_deg":60} → {"side_c":6.245,"angle_a_deg":43.8979,"angle_b_deg":76.1021,"angle_c_deg":60,"perimeter":18.245,"area":15.1554,"inradius":1.6613,"circumradius":3.6056,"side_type":"scalene","angle_type":"acute","method":"SAS"}
Equilateral, side 5: {"side_a":5,"side_b":5,"side_c":5} → {"angle_a_deg":60,"area":10.8253,"inradius":1.4434,"circumradius":2.8868,"side_type":"equilateral","angle_type":"acute"}
GET https://tttkmbb.com/api/v1/calculate/triangle-solver?side_a=3&side_b=4&side_c=5
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/triangle-solver(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/triangle-solver · Markdown: https://tttkmbb.com/geometry/triangle-solver.md · JSON definition: https://tttkmbb.com/geometry/triangle-solver.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="triangle-solver" - OpenAPI operationId:
solve_triangle - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Law of cosines (reference)
- Wikipedia – Solution of triangles (reference)
- Wolfram MathWorld – Law of Cosines (reference)
FAQ
Where is angle C?
Between side_a and side_b, opposite side_c. For SAS enter that included angle; a non-included angle (SSA) can give two solutions and is not supported here.
Why do I get a triangle inequality error?
No triangle exists when one side is as long as or longer than the other two together, e.g. 1, 2, 10. Check the units and the order of the sides.
Related calculators
- Triangle Area Calculator — Area only, including the base-and-height method.
- Right Triangle Calculator — Simpler solver for right-angled triangles.
- Angle Converter — Convert the angles to radians or gradians.