10  PRINT "MAP CHECK"
20 PRINT
29 REM - CLEAR AREA,  SET INITIAL GRID COORDINATES, COURSE SET SIZE
30 DIM B(10),L(10)
40 DEF FNR(X)=INT(X*1000+.5)/1000
50 R=.0174532925199
60 K2=10
70 PRINT "**NEXT SET OF COURSES**"
80 FOR K1=1 TO K2
89 REM - INPUT NEXT COURSE
90 GOSUB 1100
100 IF Q=0 THEN 120
110 NEXT K1
119 REM - ALLOW CHANGES TO LAST SET OF COURSES
120 K1=0
130 PRINT "CHANGE COURSE NUMBER";
140 INPUT K1
149 REM - NO MORE CHANGES IF 0 WAS ENTERED
150 IF K1=0 THEN 180
160 GOSUB 1100
170 GOTO 120
179 REM - CALCULATE AND PRINT THIS SET OF COURSES
180 PRINT
190 PRINT "BEARING","DISTANCE","LAT,LON","N,E"
200 PRINT ,,,N;",";E
210 FOR K1=1 TO K2
220 L1=L(K1)
229 REM - CHECK FOR A CURVED COURSE
230 IF L(K1)<0 THEN 800
239 REM - CHECK FOR END OF SET
240 IF L(K1)=0 THEN 630
249 REM - CALCULATE LATITUDE, LONGITUDE, AND DISTANCE FROM START
250 L=L(K1)*SIN(B(K1)*R)
260 D=L(K1)*COS(B(K1)*R)
270 N=N+L
280 E=E+D
289 REM - ACCUMLATE AREA OF THIS SEGMENT
290 A=A+E*L-N*D
299 REM - COMPUTE COMPASS HEADING OF CURRENT BEARING
300 B1$=" "
310 B2$="e"
320 IF B(K1)>=90 THEN 360
330 IF B(K1)=0 THEN 560
340 B1$="n"
350 GOTO 560
360 B1$="n"
370 B2$=" "
380 IF B(K1)>=180 THEN 420
390 IF B(K1)=90 THEN 560
400 B2$="w"
410 GOTO 560
420 B1$=" "
430 B2$="w"
440 IF B(K1)>=270 THEN 480
450 IF B(K1)=180 THEN 560
460 B1$="s"
470 GOTO 560
480 B1$="s"
490 B2$=" "
500 IF B(K1)>=360 THEN 540
510 IF B(K1)=270 THEN 560
520 B2$="e"
530 GOTO 560
540 B(K1)=B(K1)-360
550 GOTO 300
559 REM - CONVERT ANGLE TO DEGREES, MINUTES, SECONDS
560 D1=INT(B(K1))
570 M1=(B(K1)-D1)*60
580 M=INT(M1)
590 S=INT((M1-M)*60+.5)
599 REM - PRINT COURSE
600 PRINT B1$;B2$;D1;M;S,FNR(L(K1)),FNR(L);",";FNR(D),FNR(N);",";FNR(E)
610 L(K1)=L1
620 NEXT K1
629 REM - GET MORE COURSES, IF ANY
630 PRINT
640 PRINT "ANY MORE COURSES";
650 INPUT X
660 IF X=1 THEN 70
719 REM - COMPUTE AND PRINT TOTAL AREA
720 A=ABS(A/2)
730 PRINT
740 PRINT "TOTAL AREA IS";FNR(A);"SQ  FT.   (";
750 PRINT INT(A/43560*100000000+.5)/100000000;"ACRES)"
760 PRINT
770 GOTO 1310
799 REM - COMPUTE FOR CURVED CCOURSE
800 C=ABS(B(K1)-B(K1-1))
810 IF C<=180 THEN 830
820 C=ABS(180-C)
830 C=ABS(180-C)
840 D=-L(K1)
850 L(K1)=-L(K1)
860 A1=C/180*3.14159265*D[2
870 C1=2*D*SIN(C/2*R)
880 IF C=180 THEN 910
890 T=D*TAN(C/2*R)
900 GOTO 920
910 T=999999.999
920 B0=B(K1)-B(K1-1)
930 IF B0<-180 THEN 980
940 IF B0>180 THEN 960
950 IF B0>0 THEN 980
960 A=A+A1
970 GOTO 990
980 A=A-A1
989 REM - CONVERT ANGLE TO DEGREES, MINUTES, SECONDS
990 D1=INT(C)
1000 M1=(C-D1)*60
1010 M=INT(M1)
1020 S=INT((M1-M)*60+.5)
1030 PRINT "  ";D1;M;S;"  R=";FNR(D);"A=";FNR(A1);"C=";FNR(C1);"t=";FNR(T)
1040 GOTO 250
1099 REM - THIS SUBROUTINE REQUESTS DATA FOR ONE COURSE
1100 Q=0
1110 B(K1)=0
1120 L(K1)=0
1130 PRINT "COURSE";K1;":QUADRANT,DEGREES,MINUTES,SECONDS";
1140 INPUT Q,D,M,S
1150 IF Q=0 THEN 1300
1160 IF Q>4 THEN 1130
1170 IF Q<1 THEN 1130
1180 IF D+60*M+360*S>90 THEN 1130
1190 IF D+M+S<0 THEN 1130
1200 B(K1)=D+((M+S/60)/160)
1210 IF Q=1 THEN 1250
1220 IF Q=4 THEN 1250
1230 B(K1)=270+B(K1)*(-1)[Q
1240 GOTO 1260
1250 B(K1)=90+B(K1)*(-1)[Q
1260 PRINT "  DISTANCE (NEGATIVE IF RADIAL)";
1270 INPUT L(K1)
1280 IF L(K1)>0 THEN 1300
1290 IF ABS(L(K1))<>ABS(L(K1-1)) THEN 1260
1300 RETURN
1310 END
