How to use the ellipse calculator
Enter any two measurements of the ellipse. You can use the semi-axes a and b, the full length and width, the focal distance, the eccentricity, the area, the perimeter or the latus rectum. The calculator works out the semi-axes from them, then everything else. So if you know a rug’s area and how stretched it is, or how far a gallery’s foci are from its centre, you can still get the full shape. If you measured edge to edge with a tape, choose Major axis 2a and Minor axis 2b, and the calculator halves them for you.
To place the ellipse on a graph, enter its centre and say whether the long axis runs horizontally or vertically. You then get the foci, vertices, directrices, intercepts and both forms of the equation. Or switch to An equation and type one in, such as 5x² + 9y² − 10x + 36y − 139 = 0. The calculator completes the square and finds the centre and axes for you.
What an ellipse is
An ellipse is the set of points whose distances to two fixed points, the foci, always add up to the same total. That total is the full major axis, 2a. It is also what you get when you stretch a circle evenly in one direction, or slice a cone at a slant. The longest line through the centre is the major axis (length 2a). The shortest is the minor axis (length 2b). The foci sit on the major axis, a distance c either side of the centre.
Ellipse formulas
- Area: πab, which is a circle’s πr² with the radius replaced by the two semi-axes.
- Focal distance: c = √(a² − b²). Picture a right triangle with sides b and c and hypotenuse a. The distance from a co-vertex to either focus is exactly a.
- Eccentricity: e = c/a, which runs from 0 (a circle) towards 1 (a long, thin ellipse). Equivalently, b = a√(1 − e²).
- Directrices: lines at a distance a/e from the centre, perpendicular to the major axis. For every point on the ellipse, its distance to a focus is e times its distance to the matching directrix.
- Radius of curvature: b²/a at the pointed ends and a²/b at the flat sides. These are useful for templates and for checking tight bends.
Why the perimeter needs special treatment
Unlike the area, the perimeter of an ellipse has no formula made from ordinary functions. The exact value is a complete elliptic integral of the second kind. This calculator evaluates it with the arithmetic–geometric mean method, which is accurate to the full precision of the computer. It also shows how two popular approximations compare.
- π(a + b): treats the ellipse like a circle of average radius. It is 2% too low for a 180 × 100 cm table, and 10% too low for a 10 : 2 ellipse.
- Ramanujan’s first formula, π[3(a + b) − √((3a + b)(a + 3b))]: within 0.03% unless the ellipse is very flat.
- Ramanujan’s second formula, π(a + b)(1 + 3h/(10 + √(4 − 3h))), with h = ((a − b)/(a + b))²: better than one part in a million for everyday shapes. It is still within about 0.005% for an ellipse 20 times longer than it is wide.
The equation of an ellipse
An ellipse centred at (h, k) with a horizontal major axis has the standard form (x − h)²/a² + (y − k)²/b² = 1. If the major axis is vertical, a² goes under the y term instead. The larger denominator is always a². Expanding gives the general form Ax² + Cy² + Dx + Ey + F = 0, where A and C have the same sign.
To go back the other way, complete the square. Take 5x² + 9y² − 10x + 36y − 139 = 0. Group it as 5(x² − 2x) + 9(y² + 4y) = 139. Completing each square gives 5(x − 1)² + 9(y + 2)² = 139 + 5 + 36 = 180. Dividing by 180 gives (x − 1)²/36 + (y + 2)²/20 = 1. So the centre is (1, −2), a = 6, b = √20 = 2√5 and c = 4, which puts the foci at (−3, −2) and (5, −2). If the x² and y² terms have opposite signs, the curve is a hyperbola. An xy term means the ellipse is rotated.
Worked examples
An oval table. A top measuring 180 cm by 100 cm has a = 90 cm and b = 50 cm. Its area is π × 90 × 50 ≈ 14,137 cm², about 1.41 m². The edge is 448.8 cm, which is the length of edge banding to order before allowing for waste. The eccentricity is about 0.83, so the shape is noticeably stretched.
A rug from its area and shape. A 2 m² rug with eccentricity 0.6 has b = 0.8a. From πab = 2, a² = 2/(0.8π), so a ≈ 0.89 m and b ≈ 0.71 m. The rug is about 1.78 m by 1.43 m, and its binding is about 5.06 m long.
A whispering gallery. In an elliptical room 48 ft long with its foci 18 ft from the centre, b = √(24² − 18²) = √252 ≈ 15.9 ft, so the room is about 31.7 ft wide. A whisper at one focus reflects off the walls and arrives together at the other focus, 36 ft away.
Earth’s orbit. With a ≈ 149.6 million km and e ≈ 0.0167, the Sun sits at one focus, about 2.5 million km from the centre. Earth’s closest approach is a(1 − e) ≈ 147.1 million km, and its farthest is a(1 + e) ≈ 152.1 million km. The minor axis is only about 0.014% shorter than the major axis, so the orbit is very nearly a circle.
Drawing and marking out an ellipse
Pins and string (the gardener’s method): put a pin or stake at each focus, 2c apart. Loop a string of total length 2a + 2c around them, hold a pencil inside the loop and go round, keeping the string tight. The calculator gives both measurements. For a 12 m × 7 m bed, place the stakes about 9.75 m apart and use a loop about 21.75 m long.
Offsets (for setting out on site or on a board): measure along the major axis from the centre and mark the half-width at each point, from y = b√(1 − x²/a²). The results include a table of these offsets for one quarter of the ellipse. Mirror them for the other three quarters. Note that many shapes sold as “ovals”, such as egg shapes or a running track’s straights joined by semicircles, are not true ellipses, so these formulas only approximate them.
Where ellipses are used
- Astronomy: planets, moons and satellites move in ellipses with the central body at one focus (Kepler’s first law).
- Acoustics and medicine: sound or shock waves from one focus gather at the other. This is used in whispering galleries and in lithotripsy, which breaks up kidney stones without surgery.
- Design and building: oval tables, mirrors, arches, ponds and domes are planned using the area for material and the perimeter for edging.
- Engineering: elliptical tank heads, gears, cams and pipe sections. A round pipe cut at an angle also has an elliptical end.
- Graphics: a circle viewed at an angle appears as an ellipse, so drawing and rendering programs rely on these formulas.
Common mistakes
- Using full widths in πab. Halve the length and width first, or the area comes out four times too big.
- Using π(a + b) as the perimeter. It is always too low, and noticeably so for stretched ellipses.
- Adding instead of subtracting. For an ellipse, c² = a² − b². (For a hyperbola it is a² + b².)
- Putting a² under the wrong variable. a² is the larger denominator, whichever of x or y it sits under.
- Treating any oval as an ellipse. Check the shape before relying on the formulas for an exact answer.