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 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. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)