HomeGeometry › Ellipse Calculator

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.

When to use

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.

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.

Inputs

ParameterTypeUnitRequiredDescription
semi_major_anumberunitsyesHalf of the longest diameter (centre to the farthest point). Range: > 0
semi_minor_bnumberunitsyesHalf of the shortest diameter. If larger than a, the two are swapped. Range: > 0

Outputs

OutputTypeUnitDescription
areanumberunits²π × a × b.
perimeternumberunitsRamanujan's second approximation; relative error below 4·10⁻⁵ % for a/b ≤ 5 and about 0.04 % as b → 0.
eccentricitynumbere = √(1 − b² / a²); 0 for a circle, approaching 1 for a very flat ellipse.
linear_eccentricitynumberunitsc = √(a² − b²), distance from the centre to each focus.
distance_between_focinumberunits2 × c.

Example

a = 5, b = 3: {"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: {"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

Machine access

Sources

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 calculators