Ellipse calculator
Enter the semi-axes, get perimeter, area and foci.
What is the perimeter of an ellipse?
There is no simple exact formula. The calculator computes it exactly with the complete elliptic integral of the second kind, and also shows Ramanujan’s approximation π(a + b)(1 + 3h ÷ (10 + √(4 − 3h))), with h = (a − b)² ÷ (a + b)² (NIST Digital Library of Mathematical Functions, 19.9).
Example
Semi-axes 5 and 3: the perimeter is 25.527, the area π × 5 × 3 = 47.124, the eccentricity 0.8, and the foci sit 4 units from the center.
How accurate is Ramanujan’s formula?
Very — for a = 5 and b = 3 it matches the exact value to eight digits. The error grows only for very flat ellipses.
What is the eccentricity?
e = √(1 − b²/a²), from 0 for a circle toward 1 for a very flat ellipse. The foci are at a distance c = √(a² − b²) from the center.
What are semi-axes?
Half the longest and shortest widths. For an oval 10 inches by 6 inches, enter 5 and 3.
Can I just use π × (a + b) for the perimeter?
Only for a circle. π(a + b) is the first term of the series for the exact perimeter, so it always comes out too small: for semi-axes 5 and 3 it gives 25.13 against the true 25.53 (1.5% low), and for a = 99, b = 1 it gives 314.2 against 396.1, about 21% low.
How accurate is Ramanujan’s formula for a very flat ellipse?
NIST’s DLMF section 19.9 tests it on the extreme case a = 99, b = 1. The exact perimeter is 396.111 and the formula gives 396.017, only 0.024% less.
How do I draw an ellipse with string and two stakes?
Put stakes at the two foci and tie a string between them whose length is the long axis 2a (the constant sum of distances to the foci); keep a marker pulled against the string as you move around (OpenStax Precalculus 2e, section 10.1). For a bed 12 ft by 8 ft, a = 6 and b = 4, so the foci are 4.47 ft either side of the center and the string is 12 ft long.
The formulas and what they assume
Here a is the semi-major axis and b the semi-minor axis; the calculator treats the larger entry as a. The area is πab, the foci lie c = √(a² − b²) from the center along the long axis, and the eccentricity is e = c ÷ a (Wolfram MathWorld, “Ellipse”). The perimeter is 4aE(k), where E is the complete elliptic integral of the second kind and k² = 1 − b²/a² (NIST DLMF, section 19.9). The calculator evaluates that integral numerically and shows Ramanujan’s approximation next to it as a check.
Worked example: a whispering room
OpenStax Precalculus 2e, Example 7, models a room 96 feet long and 46 feet wide as an ellipse, so a = 48 and b = 23. The area is π × 48 × 23 = 3,468.3 ft², and the foci are c = √(48² − 23²) = 42.13 ft from the center (the book rounds to 42, so two people at the foci stand about 84 feet apart). The eccentricity is 0.878 and the perimeter, the wall you would walk around, is 230.0 ft.
Common mistakes
The usual error is entering full widths instead of semi-axes. For the 12 ft by 8 ft bed, typing 12 and 8 gives a perimeter of 63.5 ft and an area of 301.6 ft², twice and four times the true 31.7 ft and 75.4 ft². The other is reading the two outputs as the same kind of number: the perimeter is a length, the area is in square units.
Sources: Wolfram MathWorld, “Ellipse” (area, eccentricity, foci, perimeter series and Ramanujan’s approximations); NIST Digital Library of Mathematical Functions, section 19.9 (perimeter 4aE(k), Ramanujan’s approximation and the a = 99, b = 1 case); OpenStax, Precalculus 2e, section 10.1 “The Ellipse” (definition, Example 7). Related tools: circle calculator, hyperbola calculator, parabola calculator and area calculator. How we check our calculators.