Post Reply 
Perimeter of the Ellipse (HP-15C)
06-03-2021, 04:25 PM (This post was last modified: 06-04-2021 05:17 AM by Gerson W. Barbosa.)
Post: #15
RE: Perimeter of the Ellipse (HP-15C)
Thank you, C.Ret, for the optimization.

It appears the actual approximation should be

π(a - b)(y + 1/(4y - 1/(4y - 3/(4y - 3/(4y - 11/(12y - 149/(57y)))))))

where y = (a + b)/(a - b)

Code:

10 DATA 11/(3-149/(228*Y*Y)),3,3,1,1
15 INPUT A,B
20 IF A<>B THEN Y=(A+B)/(A-B) ELSE P=2*PI*A @ GOTO 60
25 C=0
30 D=4*Y
35 FOR I=1 TO 5
40 READ N
45 C=N/(D-C)
50 NEXT I
55 P=PI*(A-B)*(Y+C)
60 DISP P

P(20, 0) = 79.9786371734

More terms would help or perhaps an optimization of the numerators so that the lower half of the table becomes more accurate.

P. S.: The error in the length of the orbit of Halley’s Comet is about only 117 km.

P(2667950000, 678281900) = 11 464 318 867.1 km
( actual result with these data: 11 464 318 984.1 km )

P. P. S.: Unlike the previous program, the following will work also on the HP-75C.

Code:

10 DATA 11,12,3,4,3,4,1,4,1,4
15 INPUT A,B
20 IF A<>B THEN Y=(A+B)/(A-B) ELSE P=2*PI*A @ GOTO 55
25 C=149/(57*Y)
30 FOR I=1 TO 5
35 READ N,D
40 C=N/(D*Y-C)
45 NEXT I
50 P=PI*(A-B)*(Y+C)
55 DISP P
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Perimeter of the Ellipse (HP-15C) - Gerson W. Barbosa - 06-03-2021 04:25 PM



User(s) browsing this thread: 1 Guest(s)