Vous êtes sur la page 1sur 39

AdSense on Process Hackers website

Asus UX31E setting up the Elantech touchpad driver for Windows 8


Formula for the circumference of an ellipse
Posted on December 15, 2012 by wj32

It is well known that a circle with radius r has diameter 2r. But is there a similar
formula for the circumference of an ellipse?

This is our goal:
The circumference of an ellipse defined by
x2a2+y2b2=1,a>b
is
4a(2)k=0[(2k)!4k(k!)2]2(e2k12k),
where e=1b2/a2 is the eccentricity of the ellipse.
This formula looks complicated, but its not too hard to derive as well see.
Step 1. An easy integral
Let
In=/20sinnxdx.
It is easy to show (using integration by parts) that
In=(n1n)In2,
and obviously I0=/2. Then
I2k=(2k12k)(2k32k2)(12)(2).
But
(2k)(2k2)(4)(2)=2k(k)(k1)(2)(1)=2kk!
and
(2k1)(2k3)(3)(1)=(2k)(2k1)(2)(1)(2k)(2k2)(4)(2)=(2k)!2kk!,
so
I2k=(2)(2k)!4k(k!)2.
Step 2. A square root formula
Now we use the well-known formula
(1+x)=k=0(k)xk,
where
(k)=(1)(k+1)k!.
This holds for any complex and |x|<1. Plug in x and =1/2 to get
1x=k=012(121)(12k+1)k!(x)k=k=0(1)(1)(3)(52k)(32k)2
kk!(x)k=k=0(1)(1)(3)(2k5)(32k)2kk!xk=k=0(2k)!(12k)4k(k!)2xk,
which holds for all |x|<1.
Step 3. The arc length formula

Non-rigorously, from the Pythagorean theorem you can see from the above diagram that
ds=dx2+dy2=1+(dydx)2dx,
where ds is an infinitesimal part of the circumference.
The length of the top half of the ellipse is in fact defined as
aa1+f(x)2dx,
where f(x)=(b/a)a2x2 is just the equation of the ellipse in terms of y.
Let E be the circumference of the entire ellipse. Then
E=2aa1+(bxaa2x2)2
dx=2aaa2e2x2a2x2dx
after some simplification using the fact that from the definition of the eccentricity e we
have
b2=a2(1e2)e2=a2b2a2e2a2b2=a2e2.
Finally, after applying the substitution x=asin and noting that the integrand is even,
we have
E=4a/201e2sin2d.
Step 4. Putting it together
Since e<1, the series we derived in Step 2 converges uniformly on [e2,e2]. Therefore
we can use Step 2 and Step 1 to deduce that
E=4a/20k=0(2k)!(12k)4k(k!)2(e2sin2)kd=4ak=0(2k)!(12k)4k(k!)2e2k/20si
n2kd=4ak=0(2k)!(12k)4k(k!)2e2k(2)(2k)!4k(k!)2=4a(2)k=0[(2k)!4k(k!)2]2
(e2k12k)
as desired.
Related Posts:
Some series convergence problems
Power series of tan(x), cot(x), csc(x)
Frchet derivative of the (matrix) exponential function
Line integrals: 1. Exact, conservative and closed forms
Line integrals: 3. Applications to complex analysis
This entry was posted in Mathematics. Bookmark the permalink.
AdSense on Process Hackers website
Asus UX31E setting up the Elantech touchpad driver for Windows 8
Leave a Reply
Circumference of an Ellipse
(Jaleigh. B. of Minonk, IL. 2000-11-26 twice)
What is the formula for the perimeter of an ellipse? [oval]
(S. H. of United Kingdom. 2001-01-25)
What is the formula for the circumference of an ellipse?
There is no simple exact formula: There are simple formulas but they are

not exact, and there are exact formulas but they are not simple. Here, we'll
discuss many approximations, and 3 or 4 exact expressions (infinite sums).
The complementary convergence properties of two such sums allow
an efficient computation, at any prescribed precision, of the perimeter
of anyellipse, by using one series for eccentricities below 0.96 [say] and the
other onefor higher eccentricities.

For an ellipse of cartesian equation x
2
/a
2
+ y
2
/b
2
= 1 with a > b :
- a is called the major radius or semimajor axis.
- b is the minor radius or semiminor axis.
- The quantity e = \(1-b
2
/a
2
) is the eccentricity of the ellipse.
- The unnamed quantity h = (a-b)
2
/(a+b)
2
often pops up.
An exact expression of the perimeter P of an ellipse was first
published in 1742 by the Scottish mathematician Colin
Maclaurin (1698-1746) using the sum of infinitely many terms of the
following form:
[-1 / (2n-1)] [(2n)! / (2
n
n!)
2
]
2
e
2n

The leading term (for n = 0) is equal to 1.
All the others terms are negative correction terms :
P / 2ta = 1 - [1/4]e
2
- [3/64]e
4
- [5/256]e
6
- [175/16384]e
8
- [441/65536]e
10
...
That exact expression for the perimeter of the ellipse is provedelsewhere
on this site. It gives the circumference of a circle (e = 0), as 2t times its
radius (a). Although that series can give the perimeter of any ellipse,
a better series exists that converges faster.


Still, the convergence of either of those is far too slow when the
eccentricity (e) is almost 1...

Yet another series must be used then.
For a few nice approximations to use in a pinch, read on:
The following quadratic expression is often badly butchered to the point
that only a vague typographical resemblance remains (see also below (6)
for a look-alike generalization). It is found in dictionaries and other
practical references as a simple approximation to the perimeter P of the
ellipse:


P ~ t \ 2(a
2
+b
2
) - (a-b)
2
/2
(1)
The accuracy of this approximation may be determined by expanding it as
a power series of the eccentricity e [using b = a\(1-e
2
) ] which may be
compared to the correct expansion given above. Here's what our first
approximation of P/2ta expands into:
1 - [1/4]e
2
- [3/64]e
4
- [5/256]e
6
- [89/8192]e
8
- [231/32768]e
10
...
The first 4 terms are correct! Furthermore, the fifth and sixth terms amount
to a difference of only -3e
8
/16384(1+7e
2
/4) (the approximation always
underestimates the true value). The relative error is the ratio of this
discrepancy to the whole sum, adequately represented by its first two terms,
and is thus very close to -3e
8
/16384(1+2e
2
). Therefore, if you use the
formula to compute the length of the Earth Meridian (considering it to be a
perfect ellipse of eccentricitye = 0.081819191...), you will make a relative
error of about 3.72710
13
, which amounts to less than 15 m over the
entire circumference of the Meridian; just about about one tenth the width
of a human hair!
Ramanujan (I) & Lindner
In 1914, the Indian mathematician S. Ramanujan (1887-1920) came up with
a better approximative formula, which is just about as simple as the above
one, but is two (!) orders of magnitude more accurate, namely:





P ~ t [ 3(a+b) - \ (3a+b)(a+3b) ] = t (a+b) [ 3 - \ 4-h ]
Remarkably, the first 6 terms (!) of the power series for this
formula (with respect to e
2
) coincide with the corresponding terms in the
exact expansion given above. It's only with the coefficient of e
12
that things
start to differ slightly: The correct coefficient of e
12
is -4851/2
20
whereas
Ramanujan's formula gives -9703/2
21
,for a discrepancy approximately equal
to -e
12
/2
21
. Using one more term in each expansion, we find an absolute
discrepancy of -e
12
/2
21
[ 1 + 11e
2
/4 ] , which translates into a relative error
extremely close to -e
12
/2
21
[ 1 + 3e
2
] . For an ellipse of the same eccentricity
as the Earth Meridian, such a relative error is only about 4.3810
20
. For an
ellipse the size of the Earth's Meridian, this would mean a ludicrous
precision of 1.75 pm (pm = picometer), or about one sixtieth of the
conventional diameter of an hydrogen atom (which is twice the Bohr
radius)!
Ellipses of low eccentricities are thus well taken care of, by either of the
above approximations (Ramanujan's formula is always much better). Such
is not the case for very elongated ellipses (when the eccentricity e is very
(2)
close to 1): We know the correct perimeter in this case, since the entire
circumference essentially collapses down to two segments of length
2a each. Therefore,
P = 4a for a flat ellipse. [A degenerate ellipse.]
For such a flat ellipse, our first approximative formula would
give P=[t\6/2]aor about 3.84765 a, which is roughly 3.8% below the
correct value. (barely adequate for a rough estimate). Ramanujan's formula
estimates the perimeter of a flat ellipse at t (3-\3) a or about
3.983379868 a (instead of 4a) for a relative error of about -0.4155 %. For
very elongated ellipses, Ramanujan's formula is thus about 10 times better
than our first approximation and may be somewhat acceptable in practice,
although the error figure remains unimpressive.
The above Ramanujan formula is only about twice as precise as a formula
(proposed by Lindner between 1904 and 1920) which is obtained simply by
retaining only the first three terms in an exact expansion [given below] in
terms of h(these three terms happen to form a perfect square). Lindner's
formula estimates the perimeter of a flat ellipse with a relative error of
about -0.598 % :
P ~ t (a+b) [ 1 + h/8 ]
2

Ramanujan (II)
A better 1914 formula, also due to Ramanujan, gives the perimeter of flat
ellipses with the exact same precision obtained when using 7/22 to
approximate 1/t (an error of about -0.04% which is 10 times better than
Ramanujuan's first formula). Ramanujan's second formula is expressed in
terms of h = (a-b)
2
/(a+b)
2
:


P ~ t (a+b) [ 1 + 3h / ( 10+\ 4-3h ) ]
Following our established pattern, we may expand this formula
as a power series of e
2
. This is a religious experience! All the terms match
the correct series up to and including the coefficient of e
18
... It takes some
bravery to work out a precise expression for the relative
error involved. Here it is:
(-3 / 2
37
) e
20
[ 1 + 5 e
2
+
11107
/
768
e
4
+
4067
/
128
e
6
+
3860169
/
65536
e
8
+ ... ]
This would amount to a relative error of about 410
33
for the perimeter of
an ellipse similar to the Earth Meridian. That's way beyond comparison
( )
(3)
with any available physical yardstick: The physical Universe (the one we
live in) is thought to lack any smoothness at the Planck Scale, where
dimensions are on the order of the Planck Length, a unit roughly equal
to 1.61610
35
m. The accuracy of Ramanujan's (second) formula is still
about 100 million times coarser than this. However, that may not be much
in view of the fact that ordinary geometry surely breaks down in the
physical Universe well before the Planck realm is reached...
The orbit of the Earth around the Sun is an ellipse about 23 500 times as
large as the Meridian, but it is much rounder (its eccentricity is roughly
5 times smaller: e = 0.016718 at epoch 1980.0). Therefore, the second
Ramanujan formula estimates the perimeter of a perfect ellipse similar to
Earth's orbit with a relative error of about 6.510
44
, which translates into
an error slightly less than 3800 times the Planck length.

The roundest ellipse known in the physical universe is the orbit of the
"recycled" millisecond quasar known as PSR J1909-3744. It's about 50%
larger than the orbit of the Moon around the center of mass of the Earth-
Moon system. The large and small axes of that pulsar's orbit exceed one
million kilometers but differ from each other by about 10 micrometers (one
tenth the width of a human hair).
Hudson Formula and other Pad Approximations
Ralph G. Hudson is traditionally credited for a formula without square
roots which he did not invent (see Stigler's law of eponymy) and which is
intermediate in precision between the two Ramanujan formulas. It yields a
relative error of about -0.19% for flat ellipses and a relative error for low
eccentricities which equals (-9/2
30
) e
16
[ 1 + 4 e
2
+ 229/24 e
4
+ ... ] (that's
about 3.4710
26
for the Earth Meridian, corresponding to 1.4 attometer).
Hudson's formula is traditionally expressed in terms of L = h/4 = (a-
b)
2
/[2(a+b)]
2
:

P ~ t (a+b)/4 [ 3(1+L) + 1/(1-L) ] = t (a+b)

64 - 3 h
2


64 - 16 h
This formula appears without attribution on page 17 of the sixth printing
(1955) of "A Manual of Mathematics" by Ralph G. Hudson and Joseph
Lipka (thanks to David W. Cantrell for finding this out). However, what
I found on page 17 of the first edition (1917) is merely the beginning of
the Gauss-Kummer series (discussed below):
P = t (a+b) [ 1 + h/4 + h
2
/64 + h
3
/256 + ... ]
That truncated sum agrees with the aforementioned "Hudson formula" but
a discrepancy would occur with the very next term. I don't knowhow
(4)
"Hudson's formula" came about between 1917 and 1955.

Doug Coombes has pointed out (privately, on 2009-06-10) that the
"Hudson" formula predates the work of Hudson and Lipka: It appears in
the 1905 edition of a mathematical volume in the ICS Reference
Library (a collection of textbooks intended for the students of
the International Correspondence Schools ) itself refering to an earlier
compilation (1892 or 1893) from The Colliery Engineer
Company (precursor of ICS, owned by the International Textbook
Company ).
Hudson's formula involves a function of h, called a Pad approximant,
equal to the ratio of two polynomials (of degrees p and q) whose Taylor
expansion matches the Taylor expansion of the target function f up to
order p + q. (The expansion of f as a power series of h is given below.)
A more precise Pad approximant consists of the optimized ratio of two
quadratic polynomials of h and leads to the following formula, credited to
Jacobsen and Waadeland (1985). This expression gives a relative error for
the perimeter of a round ellipse (low e) roughly equal to -33 e
20
/2
38
and a
relative error of about-0.0888 % for a flat ellipse. This is directly
comparable with the accuracy of Ramanujan's second formula (3), which is
5.5 times better for the circumference of a round ellipse [and about
2.2 times better for a flat ellipse]:

P ~ t (a+b)

256 - 48 h - 21 h
2

256 - 112 h + 3 h
2

Other Pad approximant formulas of precision either lesser than Hudson's
or better than Jacobsen's are discussed below.
Peano's Formula
Hudson's formula (4) is one of only two circumference formulas quoted in
theHandbook of Bronshtein and Semendyayev. The other is merely a linear
combination of the arithmetic and geometric mean formulas (8 and 10)
optimized for an ellipse of low eccentricity. This combination was
proposed by Peano in 1889. It has about the same accuracy as our
first quadratic formula (1) for a roundish ellipse [except that the error is
positive instead of negative], but it is almost 5 times worse (+17.8 %) in the
flat case. We are told that the relative error of this formula has been shown
not to exceed 0.4 e
8
/(1-e
2
) :





P ~ t [ 3(a+b)/2 - \ ab ] = t (a+b) [ 3 - \ 1-h ] / 2
( )
( )
The YNOT formula and other optimized full-range formulas
The following so-called "YNOT formula" was first proposed by Roger
Maertens:
P ~ 4 (a
y
+b
y
)
1/y
or P ~ 4a (1 + (1-e
2
)
y/2
)
1/y
with y =
ln(2)/ln(t/2)
For any value of y, this expression would be exact for flat ellipses (P = 4a),
but it's only correct for circles (e = 0) if y has the nominal value
of ln(2)/ln(t/2), which is known as the "YNOT constant" (equal to
1.5349285356613752...). The relative error of
the YNOT formula is always less than 0.3619% (the
maximum relative error is for the circumference of an
ellipse whose eccentricity is about 0.979811, which means an ellipse
[ pictured at right ] with a minor axis very slightly less than one fifth of its
major axis). For small values of e, the relative error of the YNOT formula is
about (2y-3)e
4
/64 [1+e
2
] . Since(2y-3)/64 is a low coefficient (about
0.0010915), this is more than adequate in practice, although the relative
error for an ellipse of low eccentricity is far less impressive than with any
of the formulas discussed so far (the YNOT formula overestimates the
circumference of the Earth Meridian by about 2 meters).
This idea may well have occurred to a number of other
people... The YNOT formula may have been first published as a special
case of a formula given in 1959 by Necat Tasdelen (a Turkish engineer
who brought the fact to our attention himself, by e-mail, on 2002-10-02).
Other circumference formulas have been proposed to minimize the relative
error on some extended range of eccentricities. The most popular such
efforts revolve around a simple quadratic expression generalizing our first
formula (1):




P ~ t \ 2(a
2
+b
2
) - (a-b)
2
/D = t (a+b) \ 1 + h (1-1/D)
As shown above, D = 2 is optimal for low eccentricities. On
the other hand, a D of about 2.63949 [more precisely, t
2
/(2t
2
-16) ] is
optimal for flat ellipses. This value of D translates into the following
formula attributed to the Japanese mathematician Takakazu Seki (1642-
1708) [it was bizarrely touted it as exact by one Stephen Vadakkan (1952-
) in 1998]. This formula features a nonnegative relative error that is zero at
either extreme (ellipse of eccentricity 0 or 1-) and reaches a maximum of
about +1.354215531617% for an eccentricity near 0.9836148.
(5)
(6)




P ~ 2 \ t
2
ab + 4 (a-b)
2
= t (a+b) \ 1 + h (16/t
2
- 1)
D may also be optimized according to various other criteria. In
particular, the value of D which yields the lowest maximal relative error
over the entire range of eccentricities is slightly less than 2.458338: This
value of D yields a maximum relative error of magnitude roughly equal to
0.8647955 %, either when e is around 0.9736479 (positive error) or
when e is 1- (negative error).
For some obscure reason, the value D = 2.2 became popular... It was
probably someone's educated guess at some point... Virtually everyone
seems to have bypassed the relevant numerical analysis. Such an
expression (with D = 2.2) appears in the venerable Machinery's
Handbook by Industrial Press, Inc.
- p. 64 of the 25th edition 1996, or
- p. 65 of the 26th edition 2000, or
- p. 68 of the 27th edition 2004.
Euler's formula and the naive formula :
The Machinery's Handbook merely touts the above as a "closer
approximation" than the following formula (corresponding to D = ) given
by Euler in 1773:


P ~ t \ 2(a
2
+b
2
)
If it was not for the fact that Euler expanded this approximation
into an exact expression, the popularity of Euler's formula would be rather
surprising, since it's not much better than the following naive
formula, which happens to belong to the same family (it corresponds
to D = 1). This simplest of all formulas also corresponds to p = 1 in the
Hlder parametrization discussed below (where the formulas of Kepler and
Euler correspond respectively to p = 0 and p = 2):
P ~ t ( a + b )
For a nearly round ellipse, the precision of this formula is virtually the same
as Euler's except that the error is negative instead of positive. For elongated
ellipses, Euler's formula is pretty bad (+11%) and this one is only twice as
bad (-21.5%).
Cantrell's Formula (2001)
( )
(7)
(8)
In 2001, David W. Cantrell proposed another type of formula, which may
be optimized like our quadratic formula (6), but with numerical results that
turn out to be more than 50 times better! (See 2001-01-25, 2001-05-
08, etc.)
Cantrell's formula is expressed in terms of the Hlder mean of the principal
radii, namely H
p
= [(a
p
+b
p
)/2]
1/p
, where the value of the exponent p is
discussed below (the two forms of the formula are equivalent
because H
p
H
-p
= ab ):
P ~ 4(a+b) - 2(4-t) ab / H
p
= 4(a+b) - 2(4-t) H
-p

Unlike the YNOT formula (5), which is accurate for circles with only one
choice of exponent, Cantrell's formula (9) is accurate for both flat ellipses
(b=0) and circles (a = b = H), for any exponent p>0. The value of p may
thus be optimized for different criteria. For low eccentricities, the relative
error of Cantrell's formula is:
e
4
[1+e
2
] [p(8-2t)-(3t-8)] / 64t +
e
8
[8p(167-3p-2p
2
)(4-t) - 2007t + 5376] / 49152t + O(e
10
)
The value p = (3t-8)/(8-2t), which is about 0.829896183, is thus optimal
for round ellipses (low eccentricity e). With this value of p, the worst
relative error is about
0.0223355421282955 %, (it
is obtained for an ellipse of
eccentricity slightly below 0.99742841112, corresponding to an aspect
ratio b/a around 7.167 %, as pictured at left).
Cantrell observes that an exponent p of about 0.825056176207... yields a
worst relative error of less than 83 ppm (0.00008296523...) which is
reached for an eccentricity either around 0.9475017 (negative error) or
0.9992308 (positive error) whereas the formula is correct when e is 0, 1-,
or 0.9913373351338... In practice, an exponent p = 0.825 (or 33/40) may
be used, which yields an error of less than 85 ppm for any ellipse... Yet
another value of p is optimal for very elongated ellipses,
namely ln(2)/ln(2/[4-t]) or about 0.819493675...

From Kepler's lower bound to Muir's lower bound
We summarize the precisions of many of these approximations in the table
below, where the first entry is the simple formula given by Johannes Kepler
in 1609 as alower bound to the perimeter of an ellipse, (according
(9)
to Almkvist and Berndt):


P ~ 2t \ ab
It's worth noting that this formula is a special case of
the quadratic formula (6) with D = . It is also the limit of 2tHp when p
tends to zero (the geometric mean is sometimes said to be the zero-
exponent Hlder mean). The Kepler formula (10) thus belongs to a family
which includes the Euler formula (7) for p=2, the naive formula (8) for p=1,
and the YNOT formula (5) which corresponds to
p = y = 1.53492853566... It is thus fairly natural to include in our table the
one formula of this family (proposed by Thomas Muir in
1883) corresponding to the value of p which is optimal for low
eccentricities, namely p = 3/2 = 1.5. To quote Muir himself (1902):
"The perimeter of an ellipse is approximately equal to the circumference of
a circle the radius of which is the semi-cubic mean of the semi-axes of the
ellipse."
P ~ 2t [(a
p
+b
p
)/2]
1/p
with p = 3/2
Near e = 0, the relative error is about (2p-3) e
4
/64 [1 + e
2
] for other
formulas of this family (p = 3/2) but it's much lower for Muir's
formula itself, as shown in the table below... The original motivation of
the paper by Barnard, Pearce and Shovanec was to prove that Muir's
formula is indeed a lower bound for the circumference of any ellipse
(a question apparently first raised by Matti Vuorinen in 1996).
The first 8 tabulated entries belong to the quadratic family of formulae or
to the 2tH
p
Hlder family. The first 3 formulae belong to both families.
Perimeter
Formula
Relative Error A for Earth
Meridian
(m)
Worst (%) Low Eccentricity e
10 Kepler 1609
a
-100 -3e
4
/64 [1+e
2
+...] -84.61 m
(8) t ( a + b )
a
-21.46 -e
4
/64 [1+e
2
+...] -28.20 m
(7) Euler 1773
b
+11.072 e
4
/64 [1+e
2
+...] +28.20 m
(6)
Seki c.1680
bc
+1.3542 (
32
/t
2
-3) e
4
/64 [1+e
2
+...] +6.83 m
D = 2.458338 0.8648 (1-2/D) e
4
/64 [1+e
2
+...] +5.26 m
(5) Maertens 2000
bc
+0.3619 (2y-3)e
4
/64 [1+e
2
+...] +1.97 m
(1) D = 2
a
-3.809 -3e
8
/2
14
[1+2e
2
+...] -1.49 10
-5

(10)
(11)
11 Muir 1883
a
-1.046 -e
8
/2
14
[1+2e
2
+...] -4.97 10
-6

(9) Cantrell 2001
bc
+0.0223 [80-16t-3t
2
]e
8
/[49152(4-t)
2
] +2.83 10
-7

( ) Lindner 1904
a
-0.598 -e
12
/2
20
[1+3e
2
+...] -3.50 10
-12

(2) Ramanujan I
a
-0.416 -e
12
/2
21
[1+3e
2
+...] -1.75 10
-12

(4) Hudson 1917
a
-0.189 -9e
16
/2
30
[1+4e
2
+...] -1.39 10
-18

( ) Jacobsen 1985
a
-0.0888 -33e
20
/2
38
[1+5e
2
+...] -8.97 10
-25

(3) Ramanujan II
a
-0.0402 -3e
20
/2
37
[1+5e
2
+...] -1.63 10
-25

Notes: [ a = lower bound formula ] [ b = upper bound formula ] [ c = correct for flat ellipses ]
(2001-01-25) The relative error of symmetrical approximations:
Proportional to e
4n
(1 + ne
2
+ ...) for n
th
-order analytical expressions.
Note that all the formulas tabulated above could be cast in the same form
as the exact expression given below, namely:
t (a+b) f (h)
where f (h) can be expanded as a power series of the aforementioned h.
h = (a-b)
2
/ (a+b)
2

2

The same remark holds for any analytical expression where a and b can
be swapped, including 2tHp and the formulas of Cantrell or Zafary.
We prove that by assuming, without loss of generality, that a+b = 1
a = (1+)/2 and b = (1-)/2 [where is the square root of h ]
Expanding as a power series of any symmetrical function of a and b will
thus only yield even powers of (since interchanging a and b means
changing the sign of ). In other words, what we are left with is indeed a
power series of h =
2
.
One consequence is that the relative error for low eccentricities is also a
power series of h, whose leading term is proportional to
some h
n
. Since h happens to be equal to e
4
(1+e
2
)/16 + O(e
8
), this means
the two leading terms in the relative error expressed as a power series
of e are proportional to e
4n
(1+ne
2
) for some integer n, as may be observed in
the above table.
This argument only applies to analytical expressions [expressible as power
series about a = b] and fails for something containing |a-b| , including
the dubious "symmetrical" expression below (which is, for a>b, the
only linear function of a and b to be correct for both a circle and a flat
ellipse).
P ~ t (a+b) + (4t) |a-b| [ this is 4a + (2t4)b when a > b ]
Incidentally, that formula features a maximum error of more
than +6.87% (around an eccentricity of 0.941). Yet, it's
been described by a gullible journalist of L'Est Rpublicain (a regional
French newspaper) as a "revolutionary result" from one Jean-Pierre
Michon (unrelated to myself, I assure you) who saw fit to "check" the
thing by measuring some distorted ellipse on a tennis court !
(2001-01-25) Very Precise Fast Computations
Obtaining the circumference of any ellipse with arbitrary precision.
The exact series we first gave does converge even for e=1, but the
convergence is quite slow in that case: The partial sums (giving P for e=1
and a=1) start with 2tor about 6.283 for n=0, then 4.7124 for n=1, 4.18575
for n=5, 4.096344 for n=10, 4.01985 for n=50, 4.00996 for n=100, etc. The
asymptotic expression for the partial sum (up to and including the term of
rank n) turns out to be:
4 +1/n -3/8n
2
+3/32n
3
+3/512n
4
-33/2
11
n
5
-39/2
14
n
6
+699/2
16
n
7
+4323/2
21
n
8
-
120453/2
23
n
9
...
With a relative error roughly equal to 1/4n, the convergence is thus so poor
that the series is not usable "as is" for very precise numerical computations
about very elongated ellipses.
A similar remark applies to another exact expression of the ellipse's
perimeter, in terms of h = (a-b)
2
/(a+b)
2
, using what's now called
theGauss-Kummer Series of h, where the coefficient of h
n
is the square of
the fractional binomial coefficient C(1/2,n) = (1/2)(1/2-1)(1/2-2)...(1/2-n+1)/n! :
P = t (a+b) [ 1 + h/4 + h
2
/64 + h
3
/256 + 25h
4
/16384 + 49h
5
/65536 + ... ]
= t (a+b)


n = 0



n

)
2



h
n
where



n

)
=


2n
n

)

1



(1-2n)(-4)
n

Note that the coefficient of h
n
is 1/(1-2n) times the coefficient of
e
2n
in the above Maclaurin series, where we had factored out 2ta instead
of t(a+b).
The Gauss-Kummer series has better convergence properties than
Maclaurin's series over the whole range of eccentricities, but the relative
error for flat ellipses (~ 1/32n
2
) still leaves a lot to be desired: For the
record, the partial sum whose last term is of rank n has the following
asymptotic expression for flat ellipses:
4 -1/8n
2
-3/16n
3
-97/512n
4
-75/512n
5
-1433/2
14
n
6
-1449/2
15
n
7
-66277/2
21
n
8
-33375/2
20
n
9
-
...
Other tools are therefore clearly needed to study the behavior of P(e)
about e=1. One approach is to approximate a very elongated ellipse near its
vertex by its osculating parabola [think of the orbit of a long-period comet
near its perihelion] in order to derive a formula like:
P(e)/a = 4 - (1-e
2
) ln(1-e
2
) + O(1-e
2
)
This is the beginning of an exact expansion in terms of x = 1-
e
2
= b
2
/a
2
[due to Arthur Cayley (1876) according to D.W. Cantrell].

In
Cayley's series, the coefficient of x
n
is n(2n-1)C(,n)
2
times some square
bracket:
P/4a

= 1 + (x/4) [ln(16/x)-1] + (3x
2
/32) [ln(16/x)-13/6] +
(15x
3
/256) [ln(16/x)-12/5] + (175x
4
/4096) [ln(16/x)-1051/420] + ...
+
x
n


1
2
3
2
... (2n-3)
2
(2n-
1)
[
ln(16/x)
4

4

4

2

]
+ ...

2
2
2
4
2
... (2n-2)
2
2n

12

34

(2n-3)(2n-
2)

(2n-1)2n
The above square brackets are all positive. In fact, their greatest lower
bound is simply the positive quantity ln(1/x). [ Since 1/(2k-
1)2k is 1/(2k-1) 1/2k, the sums involved are partial sums of the Taylor
series of 4 ln(1+z) with z = 1.]
When a very precise value of the circumference of an ellipse is needed at a
reasonable computational cost over the whole range of eccentricities
(including both extremes), a very good idea is therefore to use the above
expansion if the ellipse is somewhat elongated and
the Gauss-Kummer
expansion otherwise... In thrifty implementations,
a Gauss-Kummer term is roughly twice as fast to
compute (3 additions, 3 multiplications, 1 division) as a term in Cayley's
series (6 additions, 5 multiplications, 2 divisions). This makes it most
efficient to switch from one method to the other at an eccentricity of about
96%, which may be considered an arbitrary boundary
between round and elongated ellipses (corresponding to an aspect
ratio b/a of exactly 28 %, as pictured above).
Below is an optimized way to compute the perimeter of any ellipse
in QBASIC, which makes full use of whatever precision is available, through
a generic test used in each "while" summation loop... Each loop computes
only a correction to a main term that's added aftwerwards in order
to drown the rounding errors which occurred in the successive
additions. The only downside is that sums may be carried
out slightly beyond what's necessary... In the worst case, this simple trick
provides about one extra digit of accuracy here, which is more than enough
to drown random rounding errors in the summation of about three dozen
terms required (in the worst case) to reach QBASIC's "double-precision"
accuracy. The trick is thus about as good as the recommended general
procedure of adding first the least elements in a sum of many positive
terms... [ Fixed-precision floating-point addition is a commutative
operation which is not associative ! ]
DECLARE FUNCTION gk# (h#)
DECLARE FUNCTION cayley# (x#)
DEFDBL A-Z
CONST pi = 3.141592653589793#
Perimeter of an Ellipse
in QBASIC
2002, Grard P. Michon
INPUT "a,b="; a, b
a=ABS(a): b=ABS(b)
IF a < b THEN x=a: a=b: b=x
IF b < 0.28*a THEN
P = 4*a*cayley((b/a)^2)
ELSE
h = ((a-b)/(a+b))^2
P = pi*(a+b)*gk(h)
ENDIF
PRINT "Ellipse Perimeter ="; P
END

DEFDBL A-Z
FUNCTION gk (h)
z = 0: x = 1: n = 0
REM Add 1 (to z) afterwards...
WHILE z + x <> z
n = n + 1
x = h * x * ((n-1.5)/n)^2
z = z + x
WEND
gk = 1 + z
END FUNCTION

DEFDBL A-Z
FUNCTION cayley (x)
y = LOG(16# / x) - 1
t = x / 4
n = 1
z = 0: REM Add 1 afterwards.
u = t * y
v = (n - .5) / n
w = .5 / ((n - .5) * n)
WHILE z <> z + u
z = z + u
n = n + 1
t = x * t * v
v = (n - .5) / n
t = t * v
y = y - w
w = .5 / ((n - .5) * n)
y = y - w
u = t * y
WEND
cayley = 1 + z
END FUNCTION
REM Multiplications minimized
The orbit of Halley's comet (pictured below) is an ellipse with an
eccentricity of about 0.9673. Its shape is thus
only slightly more elongated than the above
threshold. This is a far cry from the "extremely
elongated" ellipse described in many popular
accounts about the Comet (whose authors may have been impressed by a
number "so close" to unity). Unlike the aspect ratio (b/a = 25% in the case
of Halley's comet), the eccentricity e is a misunderstood measure of the
elongation of an ellipse. This is why we felt compelled to sprinkle this
page with small graphics indicating what the ellipses of various
eccentricities actually look like...
(2011-05-13) Elliptic Integrals and Elliptic Functions
Setting the record straight about functional notations.
Elliptic integrals are to an ellipse what inverse trigonometric functions
are to a circle, whereas elliptic functions are the elliptic equivalents of
trigonometric functions.
Under the traditional definition of the function E (the so-called complete
elliptic integral of the second kind) the exact perimeter P of an ellipse of
semi-major axis a and eccentricity e is given by the following relation,
where F is the hypergeometric function of Gauss (1812).
P = 4 a E(e) = 2 t a F (

; 1 ; e
2
)
So defined, E is an even function of its argument, traditionally
called modulus of the elliptic integral (the French word module is also
used). Thus, E expands as a power series of the square of the modulus.
Unfortunately, that traditional notation is often hijacked or
butchered: Some authors may write E(z) when E(\z) is meant. In
particular, the implementation of the relevant function in Mathematica is
not properly documented (at this writing, at least). The documentation
ought to read:
EllipticE (z) = E ( z

)
Be aware of the misguided equating of E and EllipticE throughout the
extensiveWolfram documentation on the subject.
In the mathematical literature, the perimeter of the ellipse is rarely
discussed directly. Instead, the function E is investigated. In particular,
the 3 exact expansions we gave appear [with different notations] in section
8.114 ofGradshteyn & Ryzhik (6th edition p.853, or 4th edition pp.905-
906).
References
1. G. Almkvist and B. Berndt ( MR89j:01028 )
"Gauss, Landen, Ramanujan, the Arithmetic-Geometric Mean,
Ellipses, t, and the Ladies' Diary"
The American Mathematical Monthly,

v.95 (1988, #7) 585-608.
2. Roger W. Barnard, Kent Pearce, Kendall C. Richards.
"A Monotonicity Property Involving 3F2 and Comparisons of the
Classical Approximations of Elliptical Arc Length"
2000 SIAM J. Math. Anal. Vol. 32, No. 2,

pp. 403-419.
3. Roger W. Barnard, Kent Pearce, Lawrence Schovanec
"Inequalities for the Perimeter of an Ellipse"
Online preprint

(Mathematics and Statistics, Texas Tech
University)
4. I.N. Bronshtein, K.A. Semendyayev
"Handbook of Mathematics" translated from Russian and German
1985 3rd English Edition,

Van Nostrand Reinhold Co., New York.
5. I.S. Gradshteyn, I.M. Ryzhik
"Table of Integrals, Series, and Products" translated from
Russian
Edited by Alan Jeffrey and Daniel Zwillinger. Errata updated online
(pdf).
6th edition 2000 Academic
Press,

ISBN 0-12-294757-6
6. E.H. Lockwood "Length of Ellipse"
Note 1045 [pp. 269-270]
Mathematical Gazette

Vol. 16 (1932).
7. Arthur Cayley (1821-1895)
"An Elementary Treatise on Elliptic
Functions" (1876) Art. 78
Second edition (1895) reprinted by
Dover Books in 1961. [pp. 52-55]



Perimeter of an Ellipse Revisited...
Footnotes
The above presentation of approximative and exact expressions for the perimeter of an

ellipse cannot be entirely exhaustive. Several readers have brought to our attention a
number of significant omissions and/or new developments. At first, we were working these
into the main discussion, but this got out of hand... Instead, we are now listing below
whatever new contributions could be skipped on a first reading. We've also moved parts
of our original discussion here, in order to streamline it.

Most of the items below may thus be considered footnotes to the main presentation.

On 2005-12-27, Stanislav Skora based his own review on the discussion presented here.
(2001-01-25) Formulas involving Pad approximants
This family of formulas used to be part of our main discussion...
A Pad approximant is the ratio of two polynomials (of degrees p and q)
whose Taylor expansion matches the Taylor expansion of the target
function f up to order p + q. Hudson's formula and Jacobsen's formula are
both obtained usingPad approximants of the Gauss-Kummer power series
of h.
Such things were first systematically investigated in the prize-winning
doctoral thesis of Henri [Eugne] Pad (1863-1953) entitled: Sur la
representation approche d'une fonction par des fractions
rationelles(1892) supervised by Charles Hermite (1822-1901, X1842).
At the next level, we find the following expression, which is much more
accuratethan Ramanujan's second formula for a round ellipse but it's not
nearly as simple. It's almost as good for a flat ellipse [with a relative error
of about -0.046 %].

P ~ t (a+b)

3072 - 1280 h - 252 h
2
+ 33 h
3

3072 - 2048 h + 212 h
2

The next formula along the same road features a ratio of two cubic
polynomials. It's certainly not an easy-to-remember expression, but it's
much more accurate than any of the above for round ellipses, as it boasts a
relative error of about-(14627/33) e
28
/2
54
, translating into a laughable
accuracy for the Meridian roughly 45 times smaller than the Planck Length.
However, the relative error of this formula for the perimeter of a flat ellipse
is still no better than -0.0267 % :

P ~ t (a+b)

135168 - 85760 h - 5568 h
2
+ 3867 h
3


135168 - 119552 h + 22208 h
2
- 345 h
3

Such formulas are probably best obtained using a device which is to
analytic functions what truncated continued fractions are to real numbers.
( )
( )
The above ratio is equal to the following expression, truncated "at order
m=6", where the coefficients to use are: a
0
= 1, a
1
= 4, a
2
= -4, a
3
=
4/3, a
4
= -4, a
5
= 12/11,a
6
= -484/115. [The sequence would go on with a
7
=
158700/160897, etc.]

a
0
+
h


a
1
+
h



a
2
+
h



a
3
+
h



a
4
+
h


a
5
+
h


a
6

Truncating at m=3 gives Hudson's formula, while Jacobsen's
formula corresponds to m=4. Truncation at m=2 yields a -0.516233% error
for a flat ellipse, with the simpler of two circumference formulae given in
1975 by Ernst S. Selmer (1920-):

P ~ t (a+b) [ 1 +

4 (a-b)
2

] = t (a+b)

16 + 3 h

(5a+3b)(3a+5b) 16 - h
The proper sequence of coefficients [1, 4, -4, 4/3, -4, 12/11...] is not too
difficult to obtain: Consider a function f(h) which is to be approximated in
this way [if we only want the above coefficients up to a
m
, we may replace
an analytic function f(h)by its partial Taylor expansion up to --and
including-- the term or order h
m
]. The Taylor expansion of f will then
match that of the above rational expression up to --and including--
the order m of the last coefficient used, if a
n
= f
n
(0), where f
n
is recursively
defined via: f
0
(h) = f(h) and f
n+1
(h) = h / [ f
n
(h) - a
n
].
In general, a relation of the type f
n+1
(h) = h
k
/ [f
n
(h)- a
n
] should be used
with whatever value of k leads to a nonzero finite value of
a
n+1
(thisusually means k=1). These successive values of k would appear
as exponents of h in the final rational expression (in particular, if f is an
even function of h, then h
2
would normally appear at each stage of the
rational approximation). Things may thus be slightly more complicated
than with the case discussed here.
In the above, an odd order of truncation (m) gives a rational approximation
where the degree of the numerator is one unit higher than the degree of the
denominator. If we apply the method to 1/f(h) instead [and take the
reciprocal of the result] we obtain a numerator of lower degree than the
denominator. (At even orders of truncation, the results of the two
approaches coincide.) For this "reciprocal" approach, the sequence of
( )
coefficients is: 1, -4, -4/3, -12, 4/21, -588/11, 484/9023, -19938252/160897,
855796516/33965156445, etc. With truncation at order m=3 [which gave
Hudson's formula in the direct approach] we obtain the following
expression, which turns out to be slightly inferior to Hudson's formula. Its
relative error for the circumference of a round ellipse is about -
21 e
16
/2
30
[this is 7/3 ~ 2.3 times worse than Hudson's formula] and roughly
-0.267 % for a flat ellipse [1.4 times worse than Hudson's expression].

P ~ t (a+b)

64 + 16 h
64 - h
2

David W. Cantrell (2004-05-24)
Improving Ramanujan's second formula [over the entire range of h].
Like most historical approximations to the perimeter of an ellipse,
the second formula of Ramanujan reaches its worst relative error for a
degenerate ellipse: Its O(h
5
) relative error reaches a maximum of (7t/22-1)
for a flat ellipse (h = 1).
Therefore, the following formula is exact for a flat ellipse while retaining
the same leading error term for a roundish ellipse as Ramanujan's second
formula, provided f is O(1) and equal to 1 for a flat ellipse (h = 1):


P ~ t (a+b) [ 1 + 3h / ( 10+\ 4-3h ) + 4 h
6
(1/t 7/22) f ]
David W. Cantrell has proposed the O(h
12
) correction f = h
6
,
for a relative error never worse than 15 ppm. This proposal was spurred
by a more complex correction term presented to him by Edgar Erives. The
exponent 6 is merely the integer closest to an optimal exponent which is
only minutely better.
Ricardo Bartolomeu (2004-06-06; e-mail) Beginner's Luck...
On 2004-06-06, Ricardo Bartolomeu asked us to evaluate a [very messy]
trigonometric approximation of the perimeter of an ellipse, which he had
stumbled upon, with apparently good results. Miraculously, Bartolomeu's
expression happens to be equivalent to a nice symmetric function
of a and b:
P ~ t (a-b) / arctg [ (a-b) / (a+b) ] = t (a+b) [ 1 + h/3 + O(h
2
) ]
This simple formula is defined by continuity for a = b. It's exact for a circle
and a flat ellipse and is about 5 times less accurate than
( )
( )
the YNOT formula (both for low eccentricities and over the entire range,
with a worst relative error exceeding 1.72 % for an ellipse of eccentricity
near 0.983). This goes to show that even wild guesses can be fairly
accurate if they turn out to be symmetrical.
In 1932, E.H. Lockwood had proposed a similar approximation of the
perimeter of an ellipse, which has a worst relative error of almost -0.9%
(when e~0.9598). It's about four times less accurate than the YNOT formula
for a round ellipse:
P ~ (4b
2
/a) arctg (a/b) + (4a
2
/b) arctg (b/a) = t (a+b) [1 + (4-12/t)h + ...]
Another attempt...
On 2004-08-02, Ricardo Bartolomeu asked us again to evaluate
yet another[slightly less messy] trigonometric approximation for the
perimeter of an ellipse, which could be reduced to the
following asymmetrical formula:



P ~ t \ 2(a
2
+b
2
) sin(x) / x where x = (1b/a) t/4
Again, this is defined by continuity for a = b (sin(x)/x tends to 1 as x tends
to 0) and the formula is exact for a circle, a flat ellipse, or an ellipse of
eccentricity:
0.88729428292031793745442629632208285906244622844440758655...
Below that, the relative error is negative but never worse than -
0.184 % (for eccentricities around 0.766764) above that, it's positive but
never worse than +0.9822 % (almost reached for an ellipse of eccentricity
around 0.991233).
For the perimeter of an ellipse of low eccentricity e, the relative error is:
-e
4
(t
2
-6) / 384 + e
6
(12-t
2
) / 768 + O(e
8
)
That's more than 9.23 times worse than the
commensurable YNOT formula...
Khaled Abed (2009-04-16) Hassan Abed's Formula (2008-10-22)
Evaluating the performance of yet another proposal...
Although I no longer honor requests to evaluate the performance of new
approximative formulas for the perimeter of an ellipse, the following
formula submitted by Khaled Abed (on behalf of his father
Hassan) deserves a second look, especially if we put it
in parametric form (the nonparametric form originally proposed by Abed
corresponds to k = 1/
512
).
P ~ t (a+b) (1 + h/4)
(1/2 + k h4 )
(1 +h
2
/16)
-
(1 - h/4)
-

= t (a+b) [ 1 + h/4 + h
2
/64 + h
3
/256 + 26h
4
/16384 + ... ]
In the main, the above square bracket differs from the correct Gauss-
Kummer series by the following quantity, which is therefore the relative
error for the perimeter of a roundish ellipse using Abed's
formula (see above analysis).
+h
4
/ 16384 + O( h
5
) = e
16
/2
30
[ 1 + 4e
2
] + O( e
20
)
For a roundish ellipse, this is commensurate with Hudson's formula (the
relative error is 9 times smaller than with Hudson's formula and it's of
opposite sign).
What's interesting is that this nice performance about h = 0 does not
depend on the value of k (which affects only the fifth order in h ). So, the
parameter k can be adjusted to optimize whatever characteristic is deemed
desirable outside the immediate neighborhood of zero...
To make the formula exact for h = 1 (a flat degenerate ellipse) we'd put:
4 / t = (5/4)
(1/2 + k)
(17/16)
-
(3/4)
-

That's k = (1/4) Log ( 2448 / 25t
4
) / Log ( 5/4 ) = 3.00077346... / 512
This value of k is the lowest which will make Abed's formula a lower
bound to the perimeter of the ellipse and it will never exceed the true value
by more than 213.86 ppm The worst case being reached when b/a is
around cos(88.317).
For k = 3/512 the worst case is a relative error of +213.67 ppm (it is then
equal to -0.337 ppm for a flat ellipse).
The value k = 2.676464 / 512 optimizes the worst relative error over the
whole range of aspect ratios, making it equal to 141.333 ppm.
The value k = 1/512 originally advocated by Abed, yields a relative error
between +871.62 ppm and -1.02 ppm.
(2009-06-11) Zafary's Formula
On 2009-04-21, Shahram Zafary (from Semnan, Iran) posted
a noteintroducing the following approximation for the circumference of an
ellipse:
P ~ 4 ( a + b ) (t/4)
4 ab / (a+b)2

With our usual notations, this is equivalent to a very simple expression:
P

~ t ( a + b ) (4/t)
h

In the main, for a roundish ellipse, this yields a negative relative error of
- e
4
( 1 + e
2
) ( 1+ 4 Log t - 8 Log 2 ) / 64 + O(e
8
)
That's about -0.00052722 e
4
(roughly half the error of the YNOT formula).
Overall, the relative error is negative for low eccentricities, reaches a
minimum of-0.0012763550197171 when e is around 0.96205913313,
rises to a maximum of +0.000272056188 when e is
around 0.999729 before falling down to 0 again for a flat ellipse. The
accuracy of Zafary's approximation is thus better
than 1277 ppm or 0.13%.
David F. Rivera (2004-02-24; e-mail) Rivera's Formula
David Rivera (of the Naval Undersea Warfare Center, RI) has contacted us
to share this approximation, developed around 1997 for his antenna work:

P ~ 4

|
\
t ab + (a-b)
2

|
.



89

|
\
a\b b\a
|
.
2



a + b 146 a + b
This formula clearly gives the correct circumference for a circle (a = b) and
a flat ellipse (b = 0). It is also exact for an ellipse of eccentricity
e = 0.986118932960305275314772672749686388...
For a rounder ellipse, Rivera's formula features a negative error which is
never worse than -103.70 ppm (when e is around 0.9329538). For a flater
ellipse, the error is positive, but never worse than +103.73 ppm
(for e around 0.99811). All told, the relative error of Rivera's 1997 formula
is always better than 104 ppm and is thus almost as good as Cantrell's 2001
formula. (104 ppm vs. 83 ppm)
The value p = 89/146 is an approximation for the value that minimizes
the magnitude of the worst relative error(s) in a parametrized formula
which, incidentally, could be rewritten as follows, for any value of p :
P ~ t (a+b) [ 1 + (4/t1) h (p/4t) {1 - h - (1-h)
3/2
} ]
For any p, that parametrized version is exact for a circle (h=0) or a flat
ellipse (h=1). The optimal value of p for low eccentricities is 3210t.

David F. Rivera had submitted another approximation among errata to the
30th edition of the Standard Mathematical Tables and Formulae (CRC
Press)... This formula is the only one of its kind given in the 31st edition. [
Thanks to David Cantrell for pointing this out. ]
P ~ 2a [ 2 + (t 2) (b/a)
1.456
]
This asymmetrical expression is exact for a circle or a flat ellipse. The
relative error is also zero for an ellipse of eccentricity around
0.921271. Below that point, it's negative but never worse than -0.447 %
(around 0.7129); above that point, it's positive but never worse than
+0.439 % (around 0.9883).
David W. Cantrell (2004-05-23) Cantrell's 2004 Ellipse Formula
Cantrell considers approximations to the perimeter of the ellipse of the
form:
P ~ 4(a+b) - 2(4-t) ab / f
This always gives an exact result for flat ellipses (b = 0). Furthermore,
if f (a,b) = a when a = b, then it's also exact for circles...
In his original 2001 proposal, Cantrell had used f = [ (a
p
+b
p
) ]
1/p
,
the Hlder mean of the principal radii ( p = 33/40 yields an 85 ppm
accuracy).
Seeking better accuracy and computational simplicity, he now introduces a
two-parameter expression for f (the more parameters to optimize, the
better) which makes f equal to a when a = b, for any choice (within limits)
of p and k :


f = p (a + b) + [ (1-2p) / (k+1) ] \ (a + kb)(ka + b)
For an ellipse of low eccentricity, this yields an optimal O(h
3
) error when:
- (k-1)
2
/ (k+1)
2
= t(60-19t) / [4 (4-t) (16-5t) ]
- p = (380t-69t
2
-512) / [ 2 t (60-19t) ]
Numerically, that's approximatively k = 133 and p = 0.412. However,
Cantrell's primary concern is to minimize the worst relative
error. For this, he settles on k = 74 and uses an approximation of the
corresponding optimal value of p (0.410117...) to claim an overall
accuracy of 4.2 ppm.
Lu Chee Ket (Malaysia. 2004-06-23 e-mail, and 2004-06-25)
C.K. Lu rediscovers (2003) an expansion due to Euler (1773).
In 1773, Leonhard Euler (1707-1783) gave an exact expansion for
the perimeter of an ellipse which may be expressed as a power series of the
quantity o defined below. By itself, the first term of this expansion gives
Euler's crude approximation, which has been discussed above...


P = t \ 2(a
2
+b
2
)

| 1 2
4
o 152
10
o
2
1052
16
o
3
... |


= t \ 2(a
2
+b
2
)
n
(o/16)
n
(4n-3)!! / (n!)
2

where o = [ (a
2
- b
2
) / (a
2
+ b
2
) ]
2
= 4h / (1+h)
2

This series converges slightly faster than Maclaurin's asymmetrical
expansion in terms of powers of e [with the major radius factored
out] but it's much worse than the symmetrical Gauss-
Kummer expression [with thesum of the radii factored out].
The partial expansion up to o
n
yields a relative error
of 1/16n+O(1/n
2
) for a flat ellipse (another approach is recommended in
that case).
(2004-07-06) Exact Expansions for the Perimeter of an Ellipse :
Some of the above exact series may be expressed using Gauss's
(1812)hypergeometric function F (also denoted
2
F
1
).
Author
Date Perimeter of the Ellipse
Colin Maclaurin 1742 2ta F(-, ; 1; e
2
)
Leonhard Euler 1773


t \ 2(a
2
+b
2
) F(-, ; 1; o)
James Ivory (*) 1796 t(a+b) F(-, -; 1; h)
Arthur Cayley 1876 Best for high eccentricities.
(*) The Gauss-Kummer series first appeared in the earliest memoir ever
published by the Scottish mathematician Sir James Ivory (1765-1842;
knighted in 1831): A New Series for the Rectification of the
Ellipse, Transactions of the Royal Society of Edinburgh, 4, II, pp.177-190
(1796).
Credit is given to Eduard Kummer (1810-1893) because he established (in
1836) two general transformations of the hypergeometric function F, that
prove the equivalence of the three hypergeometric formulas, namely:
F(u,v;2v;z) = (1-z/2)
-u
F( u/2, (u+1)/2; v+; [ z / (2-z) ]
2
)

F(2u,2u+1-w;w;z) = (1+z)
-2u
F( u, u+; w; 4z / (1+z)
2
)
To apply these two transforms here, the reader may want to remark that:
o = 4h / (1+h)
2
= [ e
2
/ (2-e
2
) ]
2





www.numericana.com/answer/ellipse.htm updated 2014-02-28 20:48

i rcumf erence of an
El l i pse
Collected by Paul Bourke
Corrections and contributions by David Cantrell and
Charles Karney.
Paper by Paul Abbott: Abbott.pdf
Update (June 2013) by Charles Karney and the AGM
(Arithmetic Geometric Mean) algorithm.

a - Major axis radius
b - Minor axis radius
e - eccentricity = (1 - b
2
/ a
2
)
1/2

f - focus = (a
2
- b
2
)
1/2

h = (a - b)
2
/ (a + b)
2

area = pi a b
The following lists and evaluates some of the approximations that can be used to
calculate the circumference of an ellipse. To some, perhaps surprising that there is not
a simple closed solution, as there is for the special case, a circle. All the expressions
below reduce to the equation of a circle when a=b. Most (not all) perform more poorly
as the ratio b/a increases.
Anonymous
pi [ 2*(a*a + b*b) - 0.5*(a-b)*(a-b) ]
1/2

Ramanujan, first approximation
pi ( 3 (a + b) - [ (a + 3 b) (3 a + b) ]
1/2
)
Ramanujan, second approximation
pi (a + b) [ 1 + 3 h / (10 + (4 - 3 h)
1/2
) ]
This is one of the more accurate approximation presented here although it degrades
for large b/a ratios.
Hudson
0.25 pi (a + b) [ 3 (1 + h/4) + 1 / (1 - h/4) ]
This does not use any computationally expensive functions.
Holder mean
4 [ a
s
+ b
s
]
1/s
where s = log(2) / log(pi/2)
Similarly for low eccentricities (Muir, 1883).
2 pi [ a
s
/2 + b
s
/2 ]
1/s
where s = 1.5
David Cantrell
4 (a + b) - 2 (4 - pi) a b / [ a
s
/2 + b
s
/2 ]
1/s
where s = 0.825056.
Exact
There is an exact series expansion but it converges rather slowly and it has numerical
issues due to the need for large factorials.
infinity
2 pi a

-e
2i
[ (2i)! / (2
i
i!)
2
]
2


2i - 1
i = 0
Integral (exact)
The following can be derived directly from the line integral of the equation of an
ellipse.
pi/2
4 a

sqrt[ 1 - e
2
sin
2
(t) ]dt
0
Necat Tasdelen
Various approximations are provided by Necat Tasdelen, they consist of improved
estimates of "s" for what is referred to as the Holder method above. Three estimates of
"s" are provided in the examples below, a constant value (same as Holder), a linear,
and a power fit estimate. The later is one of the more accurate approximations
presented here for extreme eccentricities. For the further details the reader is directed
to the documents above.
Ellipse Perimeter Estimation by Necat Tasdelen: Necat.pdf and the equivalent elliptic
integrals: eliptic.pdf
Bessel
Charles Karney contributed this rapidly converging series attributed to Bessel (1825).

Code contributions
Contribution by Bill Gran: gran.png and a nifty little Excel
Calculator: GRAN_Method_Calculator.xlsx.zip. Appears in ANC-5 Strength of Metal
Aircraft Elements March 1955 Revised Edition Section 1.535, pages 11-13. GRAN
Formula for the Complete Elliptic Integral of the Second Kind.
Adjustments to Ramanujan's formula and tables Ramanujan.xls.zip by Hassan Abed,
as well as modifications to Hudson formula and correction, and his own
approximations AbedsFormulas.xls.zip
AGM algorithm contributed by Charles Karney and based upon Carlson, B. C. (1995).
"Computation of real or complex elliptic integrals". Numerical Algorithms 10. This
algorithm converses quadratically, that is, the number of correct digits doubles on
each iteration so the fastest converging series of those presented here.
Versions: Maxima, Python and C. The series was first proposed by James Ivory, A
new series for the rectification of the ellipsis, Trans. Roy. Soc. Edinburgh 4, 177-190
(1798).
This simple C code evaluates the various estimates given above. Some example
output is given below. All methods give exact estimates for a circle, for example, a
unit circle. This is hardly unexpected since they reduce to the equation of a circle for
a=b. All error are given as relative error (estimate - actual) / actual. In the following
the "ground truth" is taken to be the AGM algorihm.
Example: a=1, b=1
e : 0.0000000000
h : 0.0000000000
b/a: 1.0000000000
Numerical : 6.27672765822760 Error: 0.001028
( 10 segments)
Numerical : 6.28312071096907 Error: 0.010 x10(-
3) ( 100 segments)
Numerical : 6.28318466121547 Error: 0.103 x10(-
6) ( 1000 segments)
Numerical : 6.28318530072077 Error: 0.001 x10(-
6) ( 10000 segments)
Numerical : 6.28318530710706 Error: 0.012 x10(-
9) ( 100000 segments)
Numerical : 6.28318530717921 Error: 0.059 x10(-
12) ( 1000000 segments)
Numerical : 6.28318530717957 Error: 0.002 x10(-
12) ( 10000000 segments)
Numerical : 6.28318530717915 Error: 0.069 x10(-
12) (100000000 segments)
Integral : 6.28318530717959 Error: 0.000 x10(-
12) ( 10 segments)
Integral : 6.28318530717958 Error: 0.001 x10(-
12) ( 100 segments)
Integral : 6.28318530717947 Error: 0.018 x10(-
12) ( 1000 segments)
Integral : 6.28318530718043 Error: 0.134 x10(-
12) ( 10000 segments)
Integral : 6.28318530717586 Error: 0.593 x10(-
12) ( 100000 segments)
Integral : 6.28318530715542 Error: 0.004 x10(-
9) ( 1000000 segments)
Integral : 6.28318530604334 Error: 0.181 x10(-
9) ( 10000000 segments)
Integral : 6.28318532160340 Error: 0.002 x10(-
6) (100000000 segments)
Circle circumference : 6.28318530717959 Error: 0.000 x10(-
12)
Anonymous : 6.28318530717959 Error: 0.000 x10(-
12)
Hudson : 6.28318530717959 Error: 0.000 x10(-
12)
Ramanujan 1 : 6.28318530717959 Error: 0.000 x10(-
12)
Ramanujan 11 : 6.28318530717959 Error: 0.000 x10(-
12)
Holder mean : 6.28318530717959 Error: 0.000 x10(-
12) (s: 1.534928535661375)
Cantrell : 6.28318530717959 Error: 0.000 x10(-
12) (s: 0.829896183162743)
Exact : 6.28318530717959 Error: 0.000 x10(-
12) ( 10 terms)
Exact : 6.28318530717959 Error: 0.000 x10(-
12) ( 50 terms)
Exact : 6.28318530717959 Error: 0.000 x10(-
12) ( 250 terms)
Exact : 6.28318530717959 Error: 0.000 x10(-
12) ( 1250 terms)
Necat (constant s) : 6.28318530717959 Error: 0.000 x10(-
12) (s: 1.534928535661375)
Necat (linear s) : 6.28318530717958 Error: 0.001 x10(-
12) (s: 1.534928535661380)
Necat (power s) : 6.28318530717958 Error: 0.001 x10(-
12) (s: 1.534928535661380)
Bessel : 6.28318530717959 Error: 0.000 x10(-
12) ( 10 terms)
Bessel : 6.28318530717959 Error: 0.000 x10(-
12) ( 100 terms)
Bessel : 6.28318530717959 Error: 0.000 x10(-
12) ( 1000 terms)
Example: a=1, b=2 (Modest eccentricity)
e : 0.8660254038
h : 0.1111111111
b/a: 0.5000000000
Numerical : 9.67849075560978 Error: 0.001028
( 10 segments)
Numerical : 9.68834861548905 Error: 0.010 x10(-
3) ( 100 segments)
Numerical : 9.68844722449405 Error: 0.103 x10(-
6) ( 1000 segments)
Numerical : 9.68844821058716 Error: 0.001 x10(-
6) ( 10000 segments)
Numerical : 9.68844822044810 Error: 0.010 x10(-
9) ( 100000 segments)
Numerical : 9.68844822054622 Error: 0.150 x10(-
12) ( 1000000 segments)
Numerical : 9.68844822054806 Error: 0.040 x10(-
12) ( 10000000 segments)
Numerical : 9.68844822054901 Error: 0.138 x10(-
12) (100000000 segments)
Integral : 9.68844822056413 Error: 0.002 x10(-
9) ( 10 segments)
Integral : 9.68844822054768 Error: 0.000 x10(-
12) ( 100 segments)
Integral : 9.68844822054768 Error: 0.000 x10(-
12) ( 1000 segments)
Integral : 9.68844822054761 Error: 0.006 x10(-
12) ( 10000 segments)
Integral : 9.68844822054766 Error: 0.002 x10(-
12) ( 100000 segments)
Integral : 9.68844822054803 Error: 0.036 x10(-
12) ( 1000000 segments)
Integral : 9.68844822054681 Error: 0.089 x10(-
12) ( 10000000 segments)
Integral : 9.68844822054597 Error: 0.176 x10(-
12) (100000000 segments)
Anonymous : 9.68303887270669 Error: 0.558 x10(-
3)
Hudson : 9.68844734419566 Error: 0.090 x10(-
6)
Ramanujan 1 : 9.68842109767129 Error: 0.003 x10(-
3)
Ramanujan 11 : 9.68844821613009 Error: 0.456 x10(-
9)
Holder mean : 9.70448163064351 Error: 0.001655
(s: 1.534928535661375)
Cantrell : 9.68854806636610 Error: 0.010 x10(-
3) (s: 0.829896183162743)
Exact : 9.69160447929656 Error: 0.326 x10(-
3) ( 10 terms)
Exact : 9.68844822218643 Error: 0.169 x10(-
9) ( 50 terms)
Exact : 9.68844822054768 Error: 0.000 x10(-
12) ( 250 terms)
Exact : 9.68844822054768 Error: 0.000 x10(-
12) ( 1250 terms)
Necat (constant s) : 9.70448163064351 Error: 0.001655
(s: 1.534928535661375)
Necat (linear s) : 9.68804165995463 Error: 0.042 x10(-
3) (s: 1.541982035153419)
Necat (power s) : 9.68839441141184 Error: 0.006 x10(-
3) (s: 1.541829751678717)
Bessel : 9.68844822054742 Error: 0.026 x10(-
12) ( 10 terms)
Bessel : 9.68844822054768 Error: 0.000 x10(-
12) ( 100 terms)
Bessel : 9.68844822054768 Error: 0.000 x10(-
12) ( 1000 terms)
Example: a=1, b=10
e : 0.9949874371
h : 0.6694214876
b/a: 0.1000000000
Numerical : 40.60042321878313 Error: 0.967 x10(-
3) ( 10 segments)
Numerical : 40.63932399169911 Error: 0.010 x10(-
3) ( 100 segments)
Numerical : 40.63973762290312 Error: 0.103 x10(-
6) ( 1000 segments)
Numerical : 40.63974175922775 Error: 0.001 x10(-
6) ( 10000 segments)
Numerical : 40.63974180059099 Error: 0.010 x10(-
9) ( 100000 segments)
Numerical : 40.63974180100578 Error: 0.078 x10(-
12) ( 1000000 segments)
Numerical : 40.63974180101561 Error: 0.164 x10(-
12) ( 10000000 segments)
Numerical : 40.63974180100927 Error: 0.008 x10(-
12) (100000000 segments)
Integral : 40.64219391439480 Error: 0.060 x10(-
3) ( 10 segments)
Integral : 40.63974180100898 Error: 0.001 x10(-
12) ( 100 segments)
Integral : 40.63974180100900 Error: 0.001 x10(-
12) ( 1000 segments)
Integral : 40.63974180100901 Error: 0.001 x10(-
12) ( 10000 segments)
Integral : 40.63974180100879 Error: 0.004 x10(-
12) ( 100000 segments)
Integral : 40.63974180101027 Error: 0.032 x10(-
12) ( 1000000 segments)
Integral : 40.63974180100751 Error: 0.036 x10(-
12) ( 10000000 segments)
Integral : 40.63974180107515 Error: 0.002 x10(-
9) (100000000 segments)
Anonymous : 39.92419204913146 Error: 0.017607
Hudson : 40.63151007270351 Error: 0.203 x10(-
3)
Ramanujan 1 : 40.60552518514097 Error: 0.842 x10(-
3)
Ramanujan 11 : 40.63927210018871 Error: 0.012 x10(-
3)
Holder mean : 40.75658566530318 Error: 0.002875
(s: 1.534928535661375)
Cantrell : 40.63266238102069 Error: 0.174 x10(-
3) (s: 0.819493675056663)
Exact : 41.42030490115282 Error: 0.019207
( 10 terms)
Exact : 40.70623873690818 Error: 0.001636
( 50 terms)
Exact : 40.64052842541464 Error: 0.019 x10(-
3) ( 250 terms)
Exact : 40.63974180295930 Error: 0.048 x10(-
9) ( 1250 terms)
Necat (constant s) : 40.75658566530318 Error: 0.002875
(s: 1.534928535661375)
Necat (linear s) : 40.64117543670444 Error: 0.035 x10(-
3) (s: 1.591286056206585)
Necat (power s) : 40.63991083864542 Error: 0.004 x10(-
3) (s: 1.591960989144423)
Bessel : 40.63963178516602 Error: 0.003 x10(-
3) ( 10 terms)
Bessel : 40.63974180100895 Error: 0.000 x10(-
12) ( 100 terms)
Bessel : 40.63974180100895 Error: 0.000 x10(-
12) ( 1000 terms)
Example: a = 1, b = 1000 (Extreme eccentricity)
Arc length of an ellipse

On this page: Derivation of the arc length formula Circumference of the ellipse
Arc length formula Series convergence and calculations
Derivation
The formula for the length of an arc is
Length =



1 +
(
dy
dx
)
2

dx

The equation of an ellipse such as
the one in the in the diagram, where
the width = a, theheight = b, and
where a > b, is
x
2

a
2

+
y
2

b
2

= 1

Note that for a vertical ellipse where
b > a, the ellipse can be rotated into
the form in the diagram, the
integration limits reversed, and the
arc length will be the same.
The ellipse

To compute the arc length of the ellipse, express the ellipse equation in terms of x, then
calculate the derivative.
y = b


1 -
x
2

a
2




y' =
-bx
a
2



1 -
x
2

a
2




Then apply the length formula:
Length =



1 +
(
dy
dx
)
2

dx =


1 +
b
2
x
2

a
4
-a
2
x
2

dx



=


a
4
-a
2
x
2
+ b
2
x
2

a
4
-a
2
x
2

dx =
1
a



a
4
-(a
2
-b
2
)x
2

a
2
-x
2

dx

Use a trigonometric substitution to simplify the integral:
x = a sin ... Also, sin =
x
a
and cos =


a
2
- x
2


a


dx = a cos d

Length =
1
a




a
4
- (a
2
-b
2
)sin
2


a cos
a cos d = a


1 -
a
2
-b
2

a
2

sin
2


d

The eccentricity of an ellipse (using a capital E in this document to avoid
confusion with the base of the natural logarithm, e) is defined as
E =


1 -
(
b
a )
2



Length = a



1 - E
2
sin
2

d

This function cannot be integrated, so convert it to a series using the
binomial theorem and then integrate:
Length = a

(
1 - E
2
sin
2

)
1/2 d

= a

(
1


+
1
2
(-E
2
sin
2
) +
1
2

-1
4
(-E
2
sin
2
)
2




+
1
2

-1
4

-3
6
(-E
2
sin
2
)
3
+
1
2

-1
4

-3
6

-5
8
(-E
2
sin
2
)
4
+ ...
)
d

= a

(
1 -
1
2
E
2
sin
2
-
1
2

1
4
E
4
sin
4
-
1
2

1
4

3
6
E
6
sin
6
-
1
2

1
4

3
6

5
8
E
8
sin
8
- ...
)
d

= a
(


d

-
1
2
E
2


sin
2
d -
1
2

1
4
E
4


sin
4
d



-
1
2

1
4

3
6
E
6


sin
6
d -
1
2

1
4

3
6

5
8
E
8


sin
8
d - ...
)
+ C

Apply the reduction formula for each integral of sin
n
x
Length = a
(


-
1
2
E
2

(
-
1
2
sin cos +
1
2

)


-
1
2

1
4
E
4

(
-
1
4
sin
3
cos +
3
4
sin
2
d
)


-
1
2

1
4

3
6
E
6

(
-
1
6
sin
5
cos +
5
6
sin
4
d
)


-
1
2

1
4

3
6

5
8
E
8

(
-
1
8
sin
7
cos +
7
8
sin
6
d
)
- ...
)
+ C

Length = a
(


-
1
2

1
2
E
2

(
-sin cos +
)


-
1
2

1
4

1
4
E
4

(
-sin
3
cos + 3

sin
2
d
)


-
1
2

1
4

3
6

1
6
E
6

(
-sin
5
cos + 5

sin
4
d
)


-
1
2

1
4

3
6

5
8

1
8
E
8

(
-sin
7
cos + 7

sin
6
d
)
- ...
)
+ C

At this point, the length of the desired arc can be computed using the above series, by
substituting the values of , sin and cos obtained by converting the upper and lower
limits of the definite integral to trigonometric form using the trigonometric substitution.
Arc length in terms of x. Although it isn't necessary to express the arc
length formula in terms of x, it can be done by replacing the values of , sin and cos
with their x values, and with E in terms of a and b. The arc length formula in terms of
x becomes
Length = a
[
sin
-1

(
x
a
)


-
1
2

1
2
E
2


(
-
x


a
2
-x
2


a
2

+ sin
-1

(
x
a
)

)


-
1
2

1
4

1
4
E
4


(
-
x
3



a
2
-x
2


a
4

+ 3 ( above integral in blue )
)


-
1
2

1
4

3
6

1
6
E
6


(
-
x
5



a
2
-x
2


a
6

+ 5 ( above integral in green )
)


-
1
2

1
4

3
6

5
8

1
8
E
8


(
-
x
7



a
2
-x
2


a
8

+ 7 ( above integral in magenta )
)
- ...
]
+ C

Some calculations of arc lengths may be viewed on this page. They use different values
of a and b, and values of x from zero to a in order to produce lengths from x=0 to x=a,
and making sure to include very flat ellipses as well as problematic values of x for some
computations.
Total circumference. To compute the circumference of the ellipse, the definite
integral from x=0 to x=a will yield the length of the arc in quadrant I, so multiply the
result by 4 to obtain the circumference. Using the following values,
for x = 0, = 0 produces Length = 0
for x = a, = sin
-1
(a/a) = /2
sin( /2) = 1
cos( /2) = 0
Circumference =
4a (

2
-

1
2
E
2
(
1
2


2 )
-

1
2

1
4
E
4
(
3
4

1
2


2 )
-

1
2

1
4

3
6
E
6
(
5
6

3
4

1
2


2 )
-

1
2

1
4

3
6

5
8
E
8
(
7
8

5
6

3
4

1
2


2 )
-
... )



Circumference = 2 a
(
1 -
(
1
2
)
2 E
2
-
(
1
2

3
4
)
2
E
4

3
-
(
1
2

3
4

5
6
)
2
E
6

5
-
(
1
2

3
4

5
6

7
8
)
2
E
8

7
- ...
)



As a series, circumference = 2 a


n=0
(
-
(
(2n-1)!!

(2n)!!
)
n
( 1-(b/a)
2
)
n

2n-1
)



where !! is the double factorial: for odd n, n!! = n(n-2)(n-4)...1; for even n, n!! = n(n-2)(n-4)...2. Note that (-
1)!! = 0!! = 1
Series convergence
Based on the formula for the eccentricity E of the ellipse, E has the range 0 E < 1. A
value of E 0 will clearly cause both series to converge rapidly - the condition arising
when b a, which is when the ellipse is almost a circle.
When E 1, either b must be close to zero, or a must be much larger than b; in either
case it means the ellipse is very flat. This is one condition where convergence may be
slow because each term's multiplier decays very slowly; it ultimately depends on the
value of x in the following condition.
Convergence is slow when x a: In the arc length series, after the arc sine term, the
part of each term with the square root is close to zero so it is not a problem. However,
the other part of the term that is calculated from the prior term is using an arc sine
value that is close to /2 (because x/a 1), so that part decays slowly. Many articles
that discuss these slow convergence difficulties seem to be from old publications, or are
possibly being presented as a matter of interest or formality, because with modern
computers there is no practical problem with the rate of convergence of these series... I
even got good results on an old Pentium!

Vous aimerez peut-être aussi