# Triangle Area Calculator

> Computes the area of any triangle from base and height, from three sides (Heron's formula) or from two sides and their included angle in degrees, and reports which method was used.

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

## Purpose

Computes the area of any triangle from base and height, from three sides (Heron's formula) or from two sides and their included angle in degrees, and reports which method was used.

**Use when:** You need the area of a triangle and know either its base and height, all three sides, or two sides and the angle between them.

**Do not use when:** You need the missing sides or angles as well (use triangle-solver), or the triangle is right-angled and you want all its parts (use right-triangle).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `base` | number | units | optional | Length of one side chosen as the base (method 1, with height). (> 0) |
| `height` | number | units | optional | Perpendicular distance from the base to the opposite vertex (method 1). (> 0) |
| `side_a` | number | units | optional | First side (methods 2 and 3). (> 0) |
| `side_b` | number | units | optional | Second side (methods 2 and 3). (> 0) |
| `side_c` | number | units | optional | Third side (method 2, Heron's formula). (> 0) |
| `included_angle_deg` | number | degrees | optional | Angle between side_a and side_b in degrees (method 3). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area` | number | units² | Triangle area in the square of the input unit. |
| `perimeter` | number | units | Sum of the three sides (only for the three-side and two-sides-plus-angle methods). |
| `method` | string |  | Which of the three formulas was applied. |

## Formula

`Method 1: area = base × height / 2. Method 2 (Heron): s = (side_a + side_b + side_c) / 2, area = √(s·(s − side_a)·(s − side_b)·(s − side_c)). Method 3: area = ½ · side_a · side_b · sin(included_angle_deg).`

Inputs are checked in that order: base and height first, then three sides, then two sides with the included angle. Three sides must satisfy the triangle inequality.

## Data Sources

- Wikipedia – Heron's formula — https://en.wikipedia.org/wiki/Heron%27s_formula (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Triangle Area — https://mathworld.wolfram.com/TriangleArea.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-area?`
- `POST https://tttkmbb.com/api/v1/calculate/triangle-area` 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-area · OpenAPI operationId `calculate_triangle_area` 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-area", "inputs": {…}}`

## Example

- Base 10, height 4: inputs `{"base":10,"height":4}` → `{"area":20,"method":"Base × height / 2"}`
- Sides 7, 8, 9 (Heron): inputs `{"side_a":7,"side_b":8,"side_c":9}` → `{"area":26.8328,"perimeter":24,"method":"Heron's formula (three sides)"}`
- Sides 5 and 7 with 60° between them: inputs `{"side_a":5,"side_b":7,"included_angle_deg":60}` → `{"area":15.1554,"perimeter":18.245,"method":"Two sides and included angle (½·a·b·sin C)"}`

```
GET https://tttkmbb.com/api/v1/calculate/triangle-area?base=10&height=4
```

## Limitations

You need the missing sides or angles as well (use triangle-solver), or the triangle is right-angled and you want all its parts (use right-triangle). Inputs are checked in that order: base and height first, then three sides, then two sides with the included angle. Three sides must satisfy the triangle inequality. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which height do I use?**

The perpendicular distance from the chosen base to the opposite vertex, not the length of another side. For an obtuse triangle the foot of the height can lie outside the base.

**Is the angle in degrees or radians?**

Degrees. Convert radians with degrees = radians × 180 / π before entering them.

**Why does Heron's formula return an error?**

The three sides must satisfy the triangle inequality (each side shorter than the sum of the other two); otherwise no triangle exists.

## Related

- [Triangle Solver](https://tttkmbb.com/geometry/triangle-solver.md) — Get all sides and angles, not just the area.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Right triangles from any two sides.
- [Regular Polygon Calculator](https://tttkmbb.com/geometry/regular-polygon.md) — Area of an equilateral triangle as a 3-sided regular polygon.
