# 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.

- Calculator id: `triangle-solver` · Category: Geometry (`geometry`) · Tool name: `solve_triangle`
- Canonical page: https://tttkmbb.com/geometry/triangle-solver · This document: https://tttkmbb.com/geometry/triangle-solver.md · JSON definition: https://tttkmbb.com/geometry/triangle-solver.json

## Purpose

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.

**Use when:** 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.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `side_a` | number | units | required | First side. (> 0) |
| `side_b` | number | units | required | Second side. (> 0) |
| `side_c` | number | units | optional | Third side, opposite the angle between a and b (SSS). Omit for SAS. (> 0) |
| `angle_c_deg` | number | degrees | optional | Included angle between side_a and side_b in degrees (SAS). Omit when side_c is given. (> 0) |

## Output

| Field | 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. |

## 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.

## Data Sources

- Wikipedia – Law of cosines — https://en.wikipedia.org/wiki/Law_of_cosines (reference, retrieved 2026-09-23)
- Wikipedia – Solution of triangles — https://en.wikipedia.org/wiki/Solution_of_triangles (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Law of Cosines — https://mathworld.wolfram.com/LawofCosines.html (reference, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/triangle-solver?side_a=…&side_b=…`
- `POST https://tttkmbb.com/api/v1/calculate/triangle-solver` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/triangle-solver · OpenAPI operationId `solve_triangle` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "triangle-solver", "inputs": {…}}`

## Example

- Sides 3, 4, 5 (SSS): inputs `{"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): inputs `{"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: inputs `{"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
```

## Limitations

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. 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. All values are computed from the formula above; no measurement or live data is involved.

## 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

- [Triangle Area Calculator](https://tttkmbb.com/geometry/triangle-area.md) — Area only, including the base-and-height method.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Simpler solver for right-angled triangles.
- [Angle Converter](https://tttkmbb.com/conversion/angle.md) — Convert the angles to radians or gradians.
