# Polygon Area Calculator (Shoelace Formula)

> Computes the area of a simple polygon from its vertex coordinates with the shoelace (Gauss) formula, plus its perimeter, centroid, orientation and whether it is convex.

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

## Purpose

Computes the area of a simple polygon from its vertex coordinates with the shoelace (Gauss) formula, plus its perimeter, centroid, orientation and whether it is convex.

**Use when:** You have the (x, y) coordinates of a polygon's vertices in order around its boundary and need its area, centroid or perimeter, e.g. a land parcel, floor plan or map shape.

**Do not use when:** The polygon is regular and you know only its side length (use regular-polygon), it is a triangle given by side lengths (use triangle-area), or the edges cross each other (the shoelace formula is not valid for self-intersecting polygons).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `points` | string_list |  | required | Vertices as x,y pairs in boundary order (clockwise or counter-clockwise), at least 3, e.g. 0,0 4,0 4,3 0,3. A repeated first point at the end is ignored. |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area` | number |  | \|Σ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)\| / 2 in the coordinate unit squared. |
| `perimeter` | number |  | Sum of the edge lengths, including the closing edge. |
| `centroid_x` | number |  | x of the area centroid, Σ (xᵢ + xᵢ₊₁)(xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ) / (6·A). |
| `centroid_y` | number |  | y of the area centroid. |
| `centroid` | string |  | The centroid as a coordinate pair, e.g. '(2, 1.5)'. |
| `is_convex` | boolean |  | true when every turn along the boundary is in the same direction. |
| `orientation` | string |  | 'counter-clockwise' (positive signed area) or 'clockwise'. |
| `vertex_count` | integer |  | Vertices used after dropping a repeated closing point. |

## Formula

`A = ½ |Σᵢ (xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ)| (indices wrap around); perimeter = Σ √((xᵢ₊₁ − xᵢ)² + (yᵢ₊₁ − yᵢ)²); centroid = (Σ (xᵢ + xᵢ₊₁)·cᵢ, Σ (yᵢ + yᵢ₊₁)·cᵢ) / (6·A_signed) with cᵢ = xᵢ·yᵢ₊₁ − xᵢ₊₁·yᵢ`

## Data Sources

- Wikipedia – Shoelace formula — https://en.wikipedia.org/wiki/Shoelace_formula (reference, retrieved 2026-09-24)
- Wikipedia – Centroid – of a polygon — https://en.wikipedia.org/wiki/Centroid#Of_a_polygon (reference, retrieved 2026-09-24)
- Wolfram MathWorld – Polygon Area — https://mathworld.wolfram.com/PolygonArea.html (reference, retrieved 2026-09-24)

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/polygon-area?points=…`
- `POST https://tttkmbb.com/api/v1/calculate/polygon-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/polygon-area · OpenAPI operationId `calculate_polygon_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": "polygon-area", "inputs": {…}}`

## Example

- Rectangle 4 × 3: inputs `{"points":["0,0","4,0","4,3","0,3"]}` → `{"area":12,"perimeter":14,"centroid_x":2,"centroid_y":1.5,"centroid":"(2, 1.5)","is_convex":true,"orientation":"counter-clockwise","vertex_count":4}`
- Pentagon (3,4) (5,11) (12,8) (9,5) (5,6): inputs `{"points":["3,4","5,11","12,8","9,5","5,6"]}` → `{"area":30,"perimeter":26.090056,"centroid_x":7.166667,"centroid_y":7.611111,"is_convex":false,"orientation":"clockwise","vertex_count":5}`

```
GET https://tttkmbb.com/api/v1/calculate/polygon-area?points=0%2C0%2C4%2C0%2C4%2C3%2C0%2C3
```

## Limitations

The polygon is regular and you know only its side length (use regular-polygon), it is a triangle given by side lengths (use triangle-area), or the edges cross each other (the shoelace formula is not valid for self-intersecting polygons). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Does the vertex order matter?**

The vertices must follow the boundary (either direction); listing them in a different order describes a different, possibly self-intersecting, polygon. Clockwise input only changes the sign of the signed area, which is reported as orientation.

**Can I use latitude/longitude?**

Only for small areas after projecting to metres (e.g. UTM); degrees of longitude are not the same length as degrees of latitude, so raw coordinates give wrong areas.

## Related

- [Regular Polygon Calculator](https://tttkmbb.com/geometry/regular-polygon.md) — Regular polygons from side length or radius.
- [Triangle Area Calculator](https://tttkmbb.com/geometry/triangle-area.md) — Triangle area from sides, base and height or coordinates.
- [Distance Between Two Points Calculator](https://tttkmbb.com/math/distance-2d.md) — Length of a single edge between two points.
