A Formula for the Perimeter of an Ellipse

Unlike for circles, there isn’t a simple exact closed formula for the perimeter of an ellipse. We compare several well-known approximations, and conclude that a formula discovered by Ramanujan is our favourite, due to its simplicity and extreme accuracy.

Published: 11th February 2019
Last updated: 22th November 2020


An ellipse satisfies that equation:

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

For $a=b$, we have a circle, but if $a \neq b$ the result is like a circle that has been elongated in either the horizontal or vertical direction.

Now we know that the area of a circle is $A =\pi r^2$, and some of you might also know that the area of an ellipse with semi-minor and semi-major axes $a,b$ is simply given by $A = \pi a b$.

The fact that these two formulae are very similar is probably not surprising.

Therefore, one might reasonably expect that if the formula for the perimeter of a circle is $P = 2\pi r$, then there would be a similar, and relatively simple formula for the for ellipse.

Surprisingly, and very unfortunately, this is not the case. There is no simple exact closed formula for the perimeter of an ellipse.

Now it turns out that there are some expressions that give the result exactly, but they are typically in terms of advanced functions that are not studied until the later years of undergraduate mathematics. Specifically, the exact expression for the perimeter of an ellipse is can be written as :

P_{\textrm{exact}}(a,b) \; &=   4 a \; E(1-\frac{b^2}{a^2}) \\
& =  2\pi a \;\;  _2F_1 \left( \frac{1}{2}, -\frac{1}{2}; 1;1-\frac{b^2}{a^2} \right) \\
&=  2\pi \sqrt{ab} \; P_{1/2} \left( \frac{a^2+b^2}{2ab} \right)
\nonumber \end{array}

where $E(\cdot)$ is the complete elliptic integral of the second kind, $_2F_1(\cdot)$ is the Gaussian hypergeometric function, and $P_{\nu}(z)$ is a Legendre Function.

Therefore through the use of specialist mathematical software, we can calculate the perimeter of an ellipse to arbitrary precision, and the compare this value to various simpler approximations.

The following expressions have been proposed over the centuries, with the last one discovered by Ramanujan.

P_1(a,b) &= \pi (a+b)  \nonumber \\
P_2(a,b) & = \pi \sqrt{2 (a^2+b^2)}  \nonumber  \\
P_3(a,b) &= \pi \sqrt{2(a^2+b^2)- (a-b)^2/2} \nonumber \\
P_4(a,b) &= \pi \left( 3(a+b) – \sqrt{(3a+b)(a+3b)} \right) \nonumber \end{array}

Firstly, we note that for $a=b$, these all turn out to be exactly equivalent to $P=2 \pi a$, which is a good start. Therefore, these approximations only differ from the exact value as they become more elongated.

Then for the really elongated ones, such as when it is 8x wider than it is high, the errors for $P_1, P_2, P_3,P_4$ are around 20%, 10%, 3%, 0.3%, respectively. That is, the final expression $P_4$ is by far the most accurate and yet is still relatively simple.

This last equation is traditionally called Ramanujan’s first approximation.



There are several elegant formulae which are all far are more accurate than all of the above-mentioned formulae.

They are typically expressed in terms of the particular ratio, $h = \left( \frac{a-b}{a+b} \right)^2 $.


An elegant one derived from Pade approximations

$$ P_5(h) = \pi (a+b) \frac{64-3h^2}{64-16h} .$$

And an even more accurate one (Jacobsen, 1985)

$$P_6(h) = \frac{256-48h^2-21h^4}{256-112h^2+3h^4} $$

And more accurate again, here is Ramanujan’s (more famous) second approximation

$$ P_7(h) = \pi (a+b) \left( 1+ \frac{3h}{10+\sqrt{4-3h}} \right) $$

And finally the one that is used by many computer programs is [Rackauckas]

$$ P_8(h)= \pi (a+b) \frac{135168-85760h-5568h^2+3687h^3}{135168-119552h+22208h^2-345h^3} $$

Note that although $P_5$ is the least accurate amongst these latter functions, it is still more accurate than the all the approximating functions in the earlier section of this post.

Summary of Very Accurate Approximations



My name is Dr Martin Roberts, and I’m a freelance Principal Data Science consultant, who loves working at the intersection of maths and computing.

“I transform and modernize organizations through innovative data strategies solutions.”

You can contact me through any of these channels.

LinkedIn: https://www.linkedin.com/in/martinroberts/

Twitter: @TechSparx  https://twitter.com/TechSparx

email: Martin (at) RobertsAnalytics (dot) com

More details about me can be found here.

Other Posts you may like

Leave a Reply

Your email address will not be published. Required fields are marked *