Perimeter of an ellipse

An ellipse is described by two parameters, a and b, that generalize the role of the radius r of a circle. The equation of an ellipse is

\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1

where by convention ab. The parameter a is called the semimajor axis, equal to half of the widest distance across the ellipse. The parameter b is the semiminor axis, equal to half the narrowest distance across the ellipse.

If a = b then the ellipse is a circle and its perimeter is the circumference of the circle πr. If ab then there is no equation for the perimeter in terms of elementary functions. There is an advanced function that gives the exact perimeter of an ellipse, which we will get to shortly. But first we give approximations for the perimeter in terms of elementary functions.

Simplest approximation

A simple approximation, one that is accurate when a isn’t too much larger than b, is given by

p \approx 2 \pi \left(\frac{a^{3/2} + b^{3/2}}{2} \right )^{2/3}

For more on this approximation, including details on its accuracy, see here.

Better approximation

Ernst Kummer found a series that converges quickly to the perimeter of an ellipse. The first four terms of the series would be adequate for most practical purposes.

First define

x = \left(\frac{a-b}{a+b} \right )^2

Then Kummer’s series is

\pi(a+b)\left(1 + \frac{x}{4} + \frac{x^2}{64} + \frac{x^3}{256} + \frac{25x^4}{16384} + \cdots \right )

If you don't need much accuracy, or if ab, then you will not need four terms of the series.

More on Kummer’s series here.

Exact perimeter

The perimeter of an ellipse is given exactly by a function called “the complete elliptic integral of the second kind” denoted E.

Unfortunately there are two conventions for defining E, one in terms of the “elliptic modulus” k and one in terms of the “parameter” m [1]. The relation between the two is m = k².

Let e be the eccentricity of an ellipse.

e = \sqrt{1 - \frac{b^2}{a^2}}

Then the perimeter of an ellipse is given by

p = 4aE(e^2)

when E is parameterized by the parameter m.

Python and Mathematica both use the “parameter” convention, and so you can calculate the perimeter of an ellipse in Python by using

    4*a*scipy.special.ellipe(1 - b**2/a**2)

or in Mathematica using

    4 a EllipticE[1 - b^2/a^2]

but you may see the perimeter given as 4aE(e) in sources that are using the elliptic modulus convention. If you are unsure what convention your software is using, you might check whether one of the approximations above gives similar results. Note that you cannot use a circle as your test case because then e = 0 = e².

[1] To make matters worse, m does not stand for modulus as you might reasonably expect; m stands for parameter.

Length of an elliptic arc

If you want to find the perimeter of part of an ellipse, see here.



These notes are brought to you by

John D. Cook Consulting