10 REM    OBSCURED FRACTION 
12 REM    AT A SOLAR ECLIPSE
14 REM
16 P=3.14159265
18 INPUT "SUN'S SEMIDIAMETER ";S1
20 INPUT "MOON'S SEMIDIAMETER";S2
22 S=S2/S1
24 INPUT "ECLIPSE MAGNITUDE  ";M
26 IF M>(S+1)/2 OR M<0 THEN 24
28 REM
30 W=M*2
32 D=1+S-W
34 IF M<1 AND D<>0 THEN 46   
36 IF S>=1 THEN F=1: REM TOTAL
38 IF S<1 THEN F=S*S: REM ANNULAR
40 F=F*P
42 GOTO 90   
44 REM
46 REM    ANGLE B
48 B1=(D*D+1-S*S)/(2*D)
50 IF B1>1 THEN B1=1
52 IF B1<-1 THEN B1=-1
54 IF B1<>0 THEN 58   
56 B=P/2: GOTO 64   
58 B=ATN(SQR(1-B1*B1)/B1)
60 IF B1<0 THEN B=B+P
62 REM
64 REM    ANGLE C
66 C1=(S*S+1-D*D)/(2*S)
68 IF C1>1 THEN C1=1
70 IF C1<-1 THEN C1=-1
72 IF C1<>0 THEN 76   
74 C=P/2: GOTO 82   
76 C=ATN(SQR(1-C1*C1)/C1)
78 IF C1<0 THEN C=C+P
80 REM
82 REM    ANGLE A
84 A=P-B-C
86 REM
88 F=S*S*A+B-S*SIN(C)
90 PRINT "OBSCURATION:  ";F/P
92 END
100 REM ***********************
110 REM  FROM SKY & TELESCOPE'S
120 REM  ASTRONOMICAL COMPUTING
130 REM  DEPARTMENT, NOVEMBER,
140 REM  1986, PAGES 515-516.
150 REM ***********************
