Perimeter of an Ellipse (HP42S) Message #1 Posted by Gerson W. Barbosa on 24 May 2013, 1:22 a.m.
00 { 48Byte Prgm }
01>LBL "P"
02 RCL ST Y
03 X<>Y
04 RCL+ ST L
05 /
06 LASTX
07 PI
08 *
09 X<>Y
10 X^2
11 STO ST Z
12 4
13 +
14 RCL* ST Z
15 RCL* ST Z
16 3
17 *
18 256
19 /
20 R^
21 4
22 /
23 1
24 
25 1/X
26 
27 *
28 .END.
Exact formula:
p = 4*a*E(1b^2/a^2)
where
E(x) is the complete elliptic integral of the second kind
a is the semimajor axis and
b is the semiminor axis
Example:
a = 2, b = 1
p = 4*2*E(3/4) = 9.68844822054767619842850319639...
http://www.wolframalpha.com/input/?i=4*2*E%2811%2F4%29
Approximate formula:
p ~ pi*(a + b)*(4/(4h)  3/256*h^2*(4 + h))
where
h = ((a  b)/(a + b))^2
The approximate formula is a rework of the Infinite Series 2 in this reference, whose terms are a subset of the infinite series SUM(k=0,inf,(h/4)^k), which converges to 4/(4h). The resulting expression is
4/(4h)  3/64*h^2  3/256*h^3  39/16384*h^4  15/65536*h^5 + 185/1048576*h^6 ...
This was done by hand and haven't been doublechecked. Anyway, the approximation formula above uses only terms up to h^3. The percent error ranges from 0% (circle) to about 0.1% in the worst case (two coincidental lines).
+++++
 a  b  approximate  exact 
+++++
 1  0  4.00471251023  4.00000000000 
 2  1  9.68845167284  9.68844822055 
 3  2  15.8654396854  15.8654395893 
 4  3  22.1034921699  22.1034921607 
 5  4  28.3616678905  28.3616678890 
 5  5  31.4159265359  31.4159265359 
+++++
Thanks Eduardo Duenez for his recent post below.
_{Edited to fix a typo per Ernie's observation below}
_{Edited again to correct an error in the parameter of the elliptic function per Eduardo's observatin below}
Edited: 24 May 2013, 4:44 p.m. after one or more responses were posted
