# Ellipse Calculator

> Computes the area, approximate perimeter (Ramanujan's second approximation), eccentricity and focal distances of an ellipse from its semi-major and semi-minor axes.

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

## Purpose

Computes the area, approximate perimeter (Ramanujan's second approximation), eccentricity and focal distances of an ellipse from its semi-major and semi-minor axes.

**Use when:** You need the area or circumference of an ellipse or oval, or the position of its foci, from the two half-axes.

**Do not use when:** Both axes are equal (use circle for exact results) or you need the arc length of part of an ellipse, which requires elliptic integrals.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `semi_major_a` | number | units | required | Half of the longest diameter (centre to the farthest point). (> 0) |
| `semi_minor_b` | number | units | required | Half of the shortest diameter. If larger than a, the two are swapped. (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `area` | number | units² | π × a × b. |
| `perimeter` | number | units | Ramanujan's second approximation; relative error below 4·10⁻⁵ % for a/b ≤ 5 and about 0.04 % as b → 0. |
| `eccentricity` | number |  | e = √(1 − b² / a²); 0 for a circle, approaching 1 for a very flat ellipse. |
| `linear_eccentricity` | number | units | c = √(a² − b²), distance from the centre to each focus. |
| `distance_between_foci` | number | units | 2 × c. |

## Formula

`area = π·a·b; h = ((a − b) / (a + b))²; perimeter ≈ π·(a + b)·(1 + 3h / (10 + √(4 − 3h))) (Ramanujan 1914, second approximation); eccentricity = √(1 − b²/a²); c = √(a² − b²)`

The exact perimeter is a complete elliptic integral of the second kind with no closed form; Ramanujan's second approximation is used because its error is negligible for practical axis ratios.

## Data Sources

- Wikipedia – Ellipse – circumference — https://en.wikipedia.org/wiki/Ellipse#Circumference (reference, retrieved 2026-09-23)
- Wolfram MathWorld – Ellipse — https://mathworld.wolfram.com/Ellipse.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/ellipse?semi_major_a=…&semi_minor_b=…`
- `POST https://tttkmbb.com/api/v1/calculate/ellipse` 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/ellipse · OpenAPI operationId `calculate_ellipse_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": "ellipse", "inputs": {…}}`

## Example

- a = 5, b = 3: inputs `{"semi_major_a":5,"semi_minor_b":3}` → `{"area":47.1239,"perimeter":25.527,"eccentricity":0.8,"linear_eccentricity":4,"distance_between_foci":8}`
- a = 7, b = 4: inputs `{"semi_major_a":7,"semi_minor_b":4}` → `{"area":87.9646,"perimeter":35.2032,"eccentricity":0.8207,"linear_eccentricity":5.7446}`

```
GET https://tttkmbb.com/api/v1/calculate/ellipse?semi_major_a=5&semi_minor_b=3
```

## Limitations

Both axes are equal (use circle for exact results) or you need the arc length of part of an ellipse, which requires elliptic integrals. The exact perimeter is a complete elliptic integral of the second kind with no closed form; Ramanujan's second approximation is used because its error is negligible for practical axis ratios. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Do I enter the full axes or the half-axes?**

The half-axes (semi-axes), measured from the centre. If you know the full width and height of the oval, halve them first.

**How accurate is the perimeter?**

Ramanujan's second formula is exact for a circle and within 0.00004 % up to an axis ratio of 5:1; the worst case (a degenerate ellipse with b = 0) is about 0.04 % low.

## Related

- [Circle Calculator](https://tttkmbb.com/geometry/circle.md) — Exact results when both axes are equal.
- [Area Converter](https://tttkmbb.com/conversion/area.md) — Convert the area to another unit.
