# Regular Polygon Calculator

> Computes the area, perimeter, interior and exterior angles in degrees, apothem, circumradius and number of diagonals of a regular polygon from its number of sides and side length.

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

## Purpose

Computes the area, perimeter, interior and exterior angles in degrees, apothem, circumradius and number of diagonals of a regular polygon from its number of sides and side length.

**Use when:** You need properties of an equilateral, equiangular polygon (pentagon, hexagon, octagon, …) with 3 to 100 sides.

**Do not use when:** The polygon is irregular (split it into triangles and use triangle-area) or is a square, for which rectangle also works.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `number_of_sides` | integer |  | required | Number of sides n (3 = equilateral triangle, 4 = square, 6 = hexagon, …). (min 3, max 100) |
| `side_length` | number | units | required | Length of each side. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `polygon_name` | string |  | Common name of the polygon (e.g. hexagon), or n-gon. |
| `area` | number | units² | n × s² / (4 × tan(180° / n)). |
| `perimeter` | number | units | n × s. |
| `interior_angle_deg` | number | degrees | (n − 2) × 180° / n. |
| `exterior_angle_deg` | number | degrees | 360° / n. |
| `interior_angle_sum_deg` | number | degrees | (n − 2) × 180°. |
| `apothem` | number | units | Distance from the centre to the middle of a side = s / (2 × tan(180° / n)). |
| `circumradius` | number | units | Distance from the centre to a vertex = s / (2 × sin(180° / n)). |
| `diagonals` | integer |  | n × (n − 3) / 2. |

## Formula

`With n = number_of_sides and s = side_length: area = n·s² / (4·tan(π/n)); perimeter = n·s; interior angle = (n − 2)·180°/n; exterior angle = 360°/n; apothem = s / (2·tan(π/n)); circumradius = s / (2·sin(π/n)); diagonals = n·(n − 3)/2`

## Data Sources

- Wikipedia – Regular polygon — https://en.wikipedia.org/wiki/Regular_polygon (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Regular Polygon — https://mathworld.wolfram.com/RegularPolygon.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/regular-polygon?number_of_sides=…&side_length=…`
- `POST https://tttkmbb.com/api/v1/calculate/regular-polygon` 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/regular-polygon · OpenAPI operationId `calculate_regular_polygon_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": "regular-polygon", "inputs": {…}}`

## Example

- Hexagon, side 2: inputs `{"number_of_sides":6,"side_length":2}` → `{"polygon_name":"hexagon","area":10.3923,"perimeter":12,"interior_angle_deg":120,"exterior_angle_deg":60,"interior_angle_sum_deg":720,"apothem":1.7321,"circumradius":2,"diagonals":9}`
- Pentagon, side 10: inputs `{"number_of_sides":5,"side_length":10}` → `{"polygon_name":"pentagon","area":172.0477,"perimeter":50,"interior_angle_deg":108,"exterior_angle_deg":72,"apothem":6.8819,"circumradius":8.5065,"diagonals":5}`

```
GET https://tttkmbb.com/api/v1/calculate/regular-polygon?number_of_sides=6&side_length=2
```

## Limitations

The polygon is irregular (split it into triangles and use triangle-area) or is a square, for which rectangle also works. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is the apothem?**

The perpendicular distance from the centre to a side, equal to the radius of the inscribed circle. Area also equals perimeter × apothem / 2.

**Can I start from the circumradius instead of the side?**

Convert first: side = 2 × R × sin(180° / n), then enter that side length.

## Related

- [Circle Calculator](https://tttkmbb.com/geometry/circle.md) — Limit of a regular polygon as the number of sides grows; the circumscribed circle.
- [Triangle Area Calculator](https://tttkmbb.com/geometry/triangle-area.md) — Area of a general (irregular) triangle.
- [Angle Converter](https://tttkmbb.com/conversion/angle.md) — Convert the angles to radians.
