View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default Calculate the Circumference of an ellipse

M wrote:
Is there a formula to Calculate the Circumference of an ellipse in excel?


Hi. Here's something a little different that I like to do.
Here, we first use a math program to check a solution out to 29 digits.
We then convert it to excel to get the same precision.
Again, it's something most won't use. Just an educational exercise. :)

a = 10000;
b = 9000;
h = (a - b)/(a + b);
Pi*(a + b)*Hypergeometric2F1[-1/2, -1/2, 1, h^2];

59731.604325248287448200487129

And in Excel...

? EllipsePerimeter(10000, 9000)
59731.604325248287448200487129

Function EllipsePerimeter(aa, bb)
Dim a, b
Dim k, h, h2
Dim n, d, s
Dim J As Long

a = CDec(aa)
b = CDec(bb)
n = CDec(1)
d = n
h2 = n
s = n
k = -n / 2

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

For J = 1 To 10
n = n * (J - 1 + k)
d = d * J
h2 = h2 * h
s = s + (n * n) / (d * d) * h2
Next J

EllipsePerimeter = CDec("3.14159265358979323846264338328") * s * (a + b)
End Function

= = = = = = = = = = = =
Dana DeLouis