Post Reply 
Perimeter of the Ellipse (HP-15C)
06-03-2021, 09:43 AM (This post was last modified: 06-03-2021 02:52 PM by C.Ret.)
Post: #14
RE: Perimeter of the Ellipse (HP-15C)
Hello,

Great idea, but I am a bit lazy this morning to type so many lines of program on my quite full of stuff HP-71B.

\( P(a,b)=\pi(a-b)(y+\frac{1}{4y-\frac{1}{4y-\frac{3}{4y-\frac{3}{4y-\frac{4}{4y-\frac{3}{4y-\frac{2}{4y-\frac{2}{4y-\frac{5}{4y-0}}}}}}}}}) \) with \( y=\frac{a+b}{a-b} \)

Here is a version where coefficients don't have to be copied in an array; existing in program as DATA at once is enough and spare memory :

HP-71B version:

9 DATA 5,2,2,3,4,3,3,1,1
10 INPUT "ELIPSE RADII a,b ";A,B @ IF A<>B THEN Y=(A+B)/(A-B) ELSE P=2*PI*A @ GOTO 30
20 C=0 @ FOR I=1 TO 9 @ READ N @ C=N/(4*Y-C) @ NEXT I @ P=PI*(A-B)*(Y+C)
30 DISP USING 40;A,B,P
40 IMAGE "P("K",",K")=",4D.6D


Typical sample value:
P(20,20)= 125.663706
P(20,19)= 122.542253
P(19,20)= 122.542253
P(20,10)= 96.884482
P(20,1)= 80.388512

P(20,.2)= 80.016633

P(20,.1)= 79.998004
P(20,0)= 79.986832

HP-15C / HP-11C version:
Code:
001- ►LBL E
002-   STO 0  x↔y  STO+0  x=y?  GTO 1
007-   -  STO 1  STO/0  RCL-1
011-   5  GSB 0  2  GSB 0  2  GSB 0  3  GSB 0  4  GSB 0  3  GSB 0  3  GSB 0  1  GSB 0  1  GSB 0  RCL+0  RCL*1  GTO 2

032- ►LBL 0  4  RCL 0  *  R^  -  /  RTN

040- ►LBL 1  2  *
043- ►LBL 2  PI  *
046- RTN

Usage : a [ENTER^] b [ f ][ E ] returns ellipse perimeter P.

Registers:
R0: \( -y=\frac{a+b}{b-a} \)
R1: \( (b-a) \)

Edited several times to correct english, missing sentences and code typos.
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) - C.Ret - 06-03-2021 09:43 AM



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