-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBPEREL.TXT
73 lines (73 loc) · 1.53 KB
/
BPEREL.TXT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
LBL "BPEREL" ;search halfparameter b of and ellipse according a and perimeter P
;
;Entry:
; a ENTER P XEQ BPEREL
;
;Output:
; b in X
;
;under CC BY SA creative commons 4.0 pascaldagornet at yahoo dot de
;
;R 20-21 (R 00-19 are used in PERELS and 3 and 4)
;
;create raw files with "hp41uc.exe /t=BPEREL.TXT /r /k"
; then upload in PC emulator / virtual drive / HP41 hardware
;
;change log:
;2021 10 05 update comments
;2021 10 12 update header/comments/ASTO 06
;2021 10 28 Update PERELC instead of PERELS: AVIEW instead of AON
;2021 11 03 Header update w/ create raw file
;
;
STO 20 ;P in R20
CF 03
X<>Y
STO 21 ;a temporary stored there in order to decide if a or b a > b
X<>Y
4
/
X=Y? ;check if this is a degenerated ellipse = a line which mean P = 4*a
RTN
X<Y?
GOTO 01 ;check if a not larger than 4*P because that cannot be possible
2
*
PI
/
X<Y? ;check if a is smaller than the searched b.
;if not, we will search a instead of b
SF 03
0,000000001
-
0,000000001
FC?C 03
XEQ 02
"ZWFFB"
ASTO 06 ;for using SOL of MATH instead of SOLVE from Advantage
XEQ "SOLVE" ;or SOL of MATH module
RTN
LBL "ZWFFB"
RCL 21
XEQ "PERELC" ;or XEQ "PERELS"
RCL 20
-
RTN
LBL 02
RCL 20
4
/
0,000000001
-
RCL 20
2
/
PI
/
0,000000001
+
RTN
LBL 01
"a TOO LARGE"
AVIEW
END