# Pythagorean Theorem Calculator

> Finds the missing side of a right triangle from any two of the legs a, b and hypotenuse c using a² + b² = c², and reports the area, perimeter and acute angles.

- Calculator id: `pythagorean` · Category: Math (`math`) · Tool name: `solve_pythagorean_theorem`
- Canonical page: https://tttkmbb.com/math/pythagorean · This document: https://tttkmbb.com/math/pythagorean.md · JSON definition: https://tttkmbb.com/math/pythagorean.json

## Purpose

Finds the missing side of a right triangle from any two of the legs a, b and hypotenuse c using a² + b² = c², and reports the area, perimeter and acute angles.

**Use when:** You know two sides of a right triangle and need the third, or want to check whether three lengths form a right triangle.

**Do not use when:** The triangle is not right-angled (use triangle-solver) or you need the distance between coordinates (use distance-2d).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `a` | number |  | optional | First leg (a side adjacent to the right angle). Give any two of a, b, c. (> 0) |
| `b` | number |  | optional | Second leg. (> 0) |
| `c` | number |  | optional | Hypotenuse (the longest side, opposite the right angle). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `side_a` | number |  | Length of leg a. |
| `side_b` | number |  | Length of leg b. |
| `hypotenuse_c` | number |  | Length of the hypotenuse. |
| `solved_for` | string |  | Which side was computed ('a', 'b' or 'c'), or a note that all three were given and consistent. |
| `area` | number |  | a × b / 2. |
| `perimeter` | number |  | a + b + c. |
| `angle_a_degrees` | number | ° | atan(a / b) in degrees. |
| `angle_b_degrees` | number | ° | atan(b / a) in degrees; the two acute angles sum to 90°. |

## Formula

`c = √(a² + b²); a = √(c² − b²); b = √(c² − a²); area = a·b/2; angle_a = atan(a/b), angle_b = atan(b/a)`

## Data Sources

- Wikipedia – Pythagorean theorem — https://en.wikipedia.org/wiki/Pythagorean_theorem (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Pythagorean Theorem — https://mathworld.wolfram.com/PythagoreanTheorem.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/pythagorean?`
- `POST https://tttkmbb.com/api/v1/calculate/pythagorean` 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/pythagorean · OpenAPI operationId `solve_pythagorean_theorem` 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": "pythagorean", "inputs": {…}}`

## Example

- a = 3, b = 4: inputs `{"a":3,"b":4}` → `{"side_a":3,"side_b":4,"hypotenuse_c":5,"solved_for":"c","area":6,"perimeter":12,"angle_a_degrees":36.8699,"angle_b_degrees":53.1301}`
- a = 5, c = 13: inputs `{"a":5,"c":13}` → `{"side_b":12,"solved_for":"b","area":30,"perimeter":30,"angle_a_degrees":22.6199}`

```
GET https://tttkmbb.com/api/v1/calculate/pythagorean?a=3&b=4
```

## Limitations

The triangle is not right-angled (use triangle-solver) or you need the distance between coordinates (use distance-2d). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What if I enter all three sides?**

They are checked against a² + b² = c². Consistent values are returned unchanged; otherwise an error reports the hypotenuse the two legs imply.

**Why must the hypotenuse be the longest side?**

Since c² = a² + b², c is always longer than either leg. A leg equal to or longer than c gives a negative square and no real triangle.

## Related

- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Solve a right triangle from sides and angles.
- [Distance Between Two Points Calculator](https://tttkmbb.com/math/distance-2d.md) — Distance between points uses the same theorem.
- [Triangle Solver](https://tttkmbb.com/geometry/triangle-solver.md) — General triangles (law of sines and cosines).
