10 REM   SPHEROMETER PROGRAM
12 REM
14 PRINT "WHICH DO YOU WANT --"
16 PRINT " (1) SAGITTA"
18 PRINT " (2) RADIUS OF CURV."
20 PRINT " (3) SPHEROMETER SPAN"
22 INPUT Q
24 IF Q<1 OR Q>3 THEN 22
26 IF Q=3 THEN 30   
28 INPUT "SPHEROMETER SPAN";C
30 INPUT "BALL DIAMETER   ";B
32 PRINT "TYPE OF SURFACE --"
34 PRINT "  (1) CONCAVE"
36 PRINT "  (2) CONVEX"
38 INPUT T
40 IF T<>1 AND T<>2 THEN 38   
42 IF T=2 THEN T=-1
44 IF Q=1 THEN 50   
46 INPUT "MEASURED SAGITTA";S
48 IF Q=2 THEN 52   
50 INPUT "RADIUS OF CURVATURE";R
52 IF Q=1 AND R>0 AND C>0 THEN 62   
54 IF Q=2 AND S>0 AND C>0 THEN 72   
56 IF Q=3 AND R>0 AND S>0 THEN 86   
58 PRINT "INPUT ERROR": GOTO 14   
60 REM
62 REM   COMPUTE THE SAGITTA
64 R=R-T*B/2: S=R-SQR(R*R-C*C/4)
66 PRINT "SAGITTA FOR SPHERE ";S
68 GOTO 92   
70 REM
72 REM   COMPUTE THE R.O.C.
74 R=(C*C/4+S*S)/(2*S)+T*B/2
76 PRINT "RADIUS OF CURVATURE ";R
78 IF T=-1 THEN 82   
80 PRINT "MIRROR F.L. ";R/2
82 GOTO 92   
84 REM
86 REM   COMPUTE THE SPAN
88 R=R-T*B/2: C=2*SQR(2*R*S+S*S)
90 PRINT "SPHEROMETER SPAN ";C
92 END
100 REM ==============================
110 REM  FROM SKY & TELESCOPE'S ASTRO-
120 REM  COMPUTING DEPARTMENT FOR
130 REM  SEPTEMBER, 1986, PAGE 278
140 REM =============================
