# Trapezoid Calculator

> Computes the area and midsegment of a trapezoid (trapezium) from its two parallel sides and height, and the perimeter when both non-parallel legs are given.

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

## Purpose

Computes the area and midsegment of a trapezoid (trapezium) from its two parallel sides and height, and the perimeter when both non-parallel legs are given.

**Use when:** You need the area of a quadrilateral with exactly one pair of parallel sides, or its perimeter when all four sides are known.

**Do not use when:** Both pairs of sides are parallel (use parallelogram or rectangle) or you only know the four sides without the height (the height cannot be derived without an angle in general).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `base_a` | number | units | required | First parallel side. (> 0) |
| `base_b` | number | units | required | Second parallel side. (> 0) |
| `height` | number | units | required | Perpendicular distance between the two parallel sides. (> 0) |
| `leg_c` | number | units | optional | First non-parallel side (optional, needed for the perimeter). (> 0) |
| `leg_d` | number | units | optional | Second non-parallel side (optional, needed for the perimeter). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area` | number | units² | (base_a + base_b) / 2 × height. |
| `midsegment` | number | units | Segment joining the midpoints of the legs = (base_a + base_b) / 2. |
| `perimeter` | number | units | base_a + base_b + leg_c + leg_d (only when both legs are given). |

## Formula

`area = (base_a + base_b) / 2 × height; midsegment = (base_a + base_b) / 2; perimeter = base_a + base_b + leg_c + leg_d`

Each leg must be at least as long as the height (a leg equal to the height is perpendicular to the bases, as in a right trapezoid).

## Data Sources

- Wikipedia – Trapezoid — https://en.wikipedia.org/wiki/Trapezoid (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Trapezoid — https://mathworld.wolfram.com/Trapezoid.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/trapezoid?base_a=…&base_b=…&height=…`
- `POST https://tttkmbb.com/api/v1/calculate/trapezoid` 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/trapezoid · OpenAPI operationId `calculate_trapezoid_properties` 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": "trapezoid", "inputs": {…}}`

## Example

- Bases 8 and 5, height 4, legs 4.5 and 5: inputs `{"base_a":8,"base_b":5,"height":4,"leg_c":4.5,"leg_d":5}` → `{"area":26,"midsegment":6.5,"perimeter":22.5}`
- Bases 10 and 6, height 3: inputs `{"base_a":10,"base_b":6,"height":3}` → `{"area":24,"midsegment":8}`

```
GET https://tttkmbb.com/api/v1/calculate/trapezoid?base_a=8&base_b=5&height=4&leg_c=4.5&leg_d=5
```

## Limitations

Both pairs of sides are parallel (use parallelogram or rectangle) or you only know the four sides without the height (the height cannot be derived without an angle in general). Each leg must be at least as long as the height (a leg equal to the height is perpendicular to the bases, as in a right trapezoid). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Trapezoid or trapezium?**

In US usage a trapezoid has one pair of parallel sides; in British usage that shape is called a trapezium. This calculator uses the one-pair-of-parallel-sides definition.

**Can I get the area from four sides only?**

Not in general: the shape is not rigid unless which sides are parallel and the height (or an angle) are known. Enter the height directly.

## Related

- [Parallelogram Calculator](https://tttkmbb.com/geometry/parallelogram.md) — Both pairs of sides parallel.
- [Triangle Area Calculator](https://tttkmbb.com/geometry/triangle-area.md) — A trapezoid with one base of length 0 is a triangle.
