Post Reply 
Perimeter of the Ellipse (HP-15C)
07-14-2021, 11:34 PM (This post was last modified: 07-14-2021 11:36 PM by Gerson W. Barbosa.)
Post: #28
RE: Perimeter of the Ellipse (HP-15C)
(06-05-2021 12:31 AM)C.Ret Wrote:  
Code:
001- ►LBL E
002-     STO 2  x²  x<>y  STO 1  x²  +  STO 3  1  STO 0        ; Initiate  R2:b  R1:a  R3:S◄a²+b²  R0:t
011-     ►LBL 0
012-        RCL 1  ENTER^  RCL*2  √x  x<> 2  -  2  STO*0  /    ; Compute   R2:b◄√ab  R0:t◄t+t     k◄(a-b)/2 
021-        STO-1  x²  RCL*0  STO-3                            ;           R1:a◄a-k            R3:S◄S-t*k²
025-        RCL+3  RCL 3  x<y?  GTO 0                          ; Repeat while  S+t*k² > S                (Test 8) 
029-    RCL/2  PI  *
032- RTN                                                       ; Return    P(a,b)◄S/B*π

Just for the record, here is a version of your program using three registers, by former forum member Mike (Stgt), from Jun/06. Actually, he wrote it for the HP-15C, like you did, but I prefer the HP-32S II, because it’s faster.

Code:

P01 LBL P
P02 STO B
P03 x²
P04 x<>y
P05 STO A
P06 x²
P07 +
P08 1
P08 STO C
Q01 LBL Q
Q02 RCL A
Q03 ENTER
Q04 RCL× B
Q05 SQRT
Q06 x<> B
Q07 -
Q08 2
Q09 STO× C
Q10 ÷
Q11 STO— A
Q12 x²
Q13 RCL× C
Q14 x<>y
Q15 R↓
Q16 -
Q17 x<>y
Q18 x>y?
Q19 GTO Q
Q20 RCL÷ B
Q21 π
Q22 ×
Q23 RTN

P: CK=F0E5 013.5 bytes
Q: CK=D8B7 034.5 bytes

Regards,

Gerson.
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 - 07-14-2021 11:34 PM



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