Post Reply 
Perimeter of the Ellipse (HP-15C)
06-04-2021, 06:12 PM (This post was last modified: 06-04-2021 08:23 PM by Gerson W. Barbosa.)
Post: #18
RE: Perimeter of the Ellipse (HP-15C)
HP-71B, HP-75B:

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=4/(2*Y-1)+1/3
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

p(a, b) ~ π(a - b)(y + 1/(4y - 1/(4y - 3/(4y - 3/(4y - 11/(12y - (4/(2y - 1) + 1/3)))))))

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

This approximation could be set up to return exact results for y = 1, but it would be needlessly longer.

I have yet to see how this approximation compares to Albert Chan's formula above. If I am not mistaken P(20, 1) and P(20, 0) in this approximation are better, but only very slightly. Also, every digit in his formula takes one step on the HP-15C, but it is probable that an HP-15C version of this program takes up even more.

The results on the HP-71B have been rounded to 10 figures in the table. An HP-15C version might return occasional differences in the last significant digit.


+-----+-----+-------+-------------+-------------+
|  a  |  b  |   h   |   result    |    exact    |
+-----+-----+-------+-------------+-------------+
| 20  | 20  | 0.000 | 125.6637061 | 125.6637061 |
| 20  | 19  | 0.026 | 122.5422527 | 122.5422527 |
| 20  | 18  | 0.053 | 119.4632087 | 119.4632087 |
| 20  | 17  | 0.081 | 116.4300496 | 116.4300496 |
| 20  | 16  | 0.111 | 113.4466716 | 113.4466716 | 
| 20  | 15  | 0.143 | 110.5174608 | 110.5174608 |
| 20  | 14  | 0.176 | 107.6473797 | 107.6473796 | 
| 20  | 13  | 0.212 | 104.8420720 | 104.8420720 |
| 20  | 12  | 0.250 | 102.1079955 | 102.1079955 | 
| 20  | 11  | 0.290 | 99.45258801 | 99.45258801 |
| 20  | 10  | 0.333 | 96.88448221 | 96.88448221 | 
| 20  |  9  | 0.379 | 94.41378489 | 94.41378488 |
| 20  |  8  | 0.429 | 92.05245041 | 92.05245038 | 
| 20  |  7  | 0.481 | 89.81479158 | 89.81479146 |
| 20  |  6  | 0.538 | 87.71820187 | 87.71820139 |
| 20  |  5  | 0.600 | 85.78421973 | 85.78421775 | 
| 20  |  4  | 0.667 | 84.04018649 | 84.04017816 |
| 20  |  3  | 0.739 | 82.52204269 | 82.52200588 | 
| 20  |  2  | 0.818 | 81.27965719 | 81.27948360 |
| 20  |  1  | 0.905 | 80.38937724 | 80.38851238 | 
| 20  |  0  | 1.000 | 80.03695848 | 79.99959924 | 
+-----+-----+-------|-------------+-------------+


———————

This will return exact results when y = 1:

p(a, b) ~ π(a - b)(y + 1/(4y - 1/(4y - 3/(4y - 3/(4y - 11/(12y - (4/(2y - 1) + (2592-825π)/(588-187π))))))))

Code:


25 C=4/(2*Y-1)+(2592-825*PI)/(588-187*PI)
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-04-2021 06:12 PM



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