1 DIM D(30):REM PROGRAM TO DETERMINE WHICH ORBITS ARE USABLE AND
2 REM PROVIDE ANTENNA INFORMATION
5 REM PARAMETERS
6 DEFINT N,M,U,T,Z
7 REM RESTORE TO ORIGINAL BY 'GOTO100' AT END OF 73
10 DIM H(3), I(3), P(3)
20 H(1)=901
21 I(1)=102
22 P(1)=114.942
23 H(2)=543
24 I(2)=99
25 P(2)=103.204
26 H(3)=1060
27 I(3)=82.56
28 P(3)=120.393
29 S=77.178:REM QTH LONG, CLE WAS 81.55
30 A=40.192:REM QTH LAT, CLE WAS 41.47
31 R=3957
50 PRINT "WHICH SATELLITE? ENTER 1 FOR OSCAR 7"
51 PRINT "                 ENTER 2 FOR OSCAR 8"
52 PRINT "                 ENTER 3 FOR RS"
53 INPUT N
60 PRINT "ENTER TIME YOU DESIRE (EST,EDT,UTC)"
61 INPUT Q$
70 PRINT "ENTER REFERENCE ORBIT NUMBER, TIME (HR,MIN)"
71 PRINT "AND CROSSING LONGITUDE"
72 INPUT O1,U1,M1,R1
73 H=0:X6=0
75 INPUT "ENTER CURRENT HOUR--SAME TIME ZONE AS REQUESTED (99 FOR REF ORB)";HR:IF HR=99 THEN 100
76 IF Q$="EST" THEN HR=HR+5 ELSE IF Q$="EDT" THEN HR=HR+4 ELSE IF HR>24 THEN HR=HR-24
77 IF U1=>HR-1 THEN 100 ELSE U1=U1+INT(P(N)/60):M1=M1+P(N)-60:IF N=3 THEN M1=M1-60
78 IF M1>60 THEN U1=U1+1:M1=M1-60:GOTO78
79 O1=O1+1:R1=R1+P(N)*360/(24*60):IF R1>360 THEN R1=R1-360
80 GOTO77
100 REM COMPUTATION FOR REF AND NEXT 13 ORBITS TO SEE AVAILABILITY
110 K=R/(R+H(N))
111 D1 =(-ATN(K/SQR(-K*K+1))+1.5708)*57.2958
120 FOR Z=1 TO 13
125   FOR T=1  TO 60 STEP 5
126   O=O1+Z-1
130   A1=.0174533
132   K=(SIN(I(N)*A1))*(SIN(A1*360*T/P(N)))
133   B=(ATN(K/SQR(-K*K+1)))*57.2958
134  K=COS(A1*360*T/P(N))/COS(A1*B)
135  C=(-ATN(K/SQR(-K*K+1))+1.5708)*57.2958+.25*T+R1+.25*(Z-1     )*P(N)
136  K=SIN(A*A1)*SIN(B*A1)+COS(A*A1)*COS(B*A1)*COS(A1*(S-C))
137  D=(-ATN(K/SQR(-K*K+1))+1.5708)*57.2958
145   IFD<=D1 THEN 200
146   NEXT T
147 H=0:X6=0:NEXT Z
148 PRINT "END AVAILABLE ORBITS"
149 GOTO 570
200 REM THIS SECTION ENTERED IF AN ORBIT AVAILABLE
205 M=INT(M1+P(N)*(Z-1))
206 U=U1
207 IF M<60 THEN 230
210 M=M-60
215 U=U+1
216 GOTO 207
230 IF Q$="UTC" THEN 260
231 IF Q$="EDT" THEN 250
235 U=U-5
240 IF U=>0 THEN 260
245 U=U+24
246 GOTO 260
250 U=U-4
251 IFU=>0 THEN 260
252 U=U+24
260 PRINT "FOR ORBIT NUMBER";O;"AT";U;M;" ";Q$;" SATELLITE USABLE"
265 PRINT "DO YOU WANT ANTENNA BEARINGS?(Y/n)
266 INPUT X$
270 IF X$="Y" THEN INPUT"DO YOU WISH LINEPRINT(Y/N)";X$:GOTO300
271 PRINT "DO YOU WANT FURTHER ORBITS?(Y/N)
272 INPUT X$
273 H=0
274 IF X$="N" THEN 570
275 GOTO 147
300 REM DETERMINE WHEN TO CALCULATE HEADINGS
301 CLS:IF X$="Y" THEN LPRINT "ANTENNA BEARINGS FOR ORBIT NUMBER";O ELSE PRINT "ANTENNA BEARINGS FOR ORBIT NUMBER";O
303 I9=0:IF X$="Y" THEN LPRINT "TIME","AZIMUTH","ELEVATION" ELSE PRINT "TIME","AZIMUTH","ELEVATION"
304 X6=0
310   FOR T=1 TO 60
311   K=SIN(A1*I(N))*SIN(A1*360*T/P(N))
312   B=(ATN(K/SQR(-K*K+1)))*57.2958
313   K=COS(A1*360*T/P(N))/COS(A1*B)
314   C=(-ATN(K/SQR(-K*K+1))+1.5708)*57.2958+.25*T+R1+.25*(Z-1)      *P(N):IF C=>360 THEN C=C-360
315   K=SIN(A*A1)*SIN(B*A1)+COS(A*A1)*COS(B*A1)*COS(A1*(S-C))
316   D=(-ATN(K/SQR(-K*K+1))+1.5708)*57.2958
318   IF D<=D1 THEN 330
319 IFH>0 THEN 550
320   NEXT T
321 I9=0:GOTO 550
330 IFX6>0 THEN 350
349 M=M+T-1
350 M=M+1
351 IF M<60 THEN 450
352 U=U+1
353 M=M-60
354 GOTO 351
450 REM AZ/EL AND OUTPUT
455 K=(SIN(A1*B)-SIN(A1*A)*COS(A1*D))/(COS(A*A1)*SIN(A1*D))
456 A4=(-ATN(K/SQR(-K*K+1))+1.5708)*57.2958
457 A4=INT(A4)
458 IF (C-S)>0 THEN A4=360-A4
460 A5=90-(ATN(((R+H(N))*SIN(A1*D))/((R+H(N))*COS(A1*D)-R)))*57.2958
461 X6=1
462 A5=INT(A5)
500 I9=I9+1:D(I9)=A4
505 IF X0%=0 THEN Z2=U:Z1=M:X0%=1
507 IF X$="Y" THEN LPRINT U;M,A4,A5 ELSE PRINT U;M,A4,A5
510 H=1
515 GOTO 320
550 PRINT"END OF USABLE ORBIT":INPUT "DO YOU WISH ANTENNA CONTROL";X$:IF X$="Y" THEN 600
555 PRINT "DO YOU WISH COMPUTATION FOR ANOTHER ORBIT?(Y/N)"
560 INPUT X$
565 IF X$="Y" THEN 147
570 PRINT "DO YOU WISH COMPUTATION FOR ANOTHER SATELLITE?(Y/n)"
575 INPUT X$
580 IF X$="Y" THEN 50 ELSE END
600 IF(D(INT(I9/2))<360 AND D(INT(I9/2))>180) THEN FOR I=1 TO I9:IF D(I)<90 THEN D(I)=360:NEXT ELSE NEXT
604 REM GOTO700 IN 605 ENABLES NEW MACH ANTTRK PROGRAM
605 I9=I9-1:FOR I=1 TO I9:D(I)=(ABS(D(I)-D(I+1)))/6:NEXT:X=INP(3):GOTO700:PRINT "SET ANTENNA TO PROPER INITIAL HEADING AND SET TRACKING SWITCH":INPUT "HIT 'ENTER' TO START TRACKING";X$
610 FOR I=1 TO I9:FOR J=1 TO 15000:NEXT:REM 30 SEC DELAY
615 X=INP(4):FOR J=1 TO 500*D(I):NEXT:X=INP(3)
620 FOR J=500*D(I) TO 15000:NEXT:NEXT:GOTO555
700 DEFUSR0=&HFE49:REM CALL TO ROUTINE IDENT
705 FOR J=1TO I:IF D(I)>30 THEN D(I)=0
707 NEXT:FOR J=1TOI:D(J)=INT(D(J)):NEXT
708 M=0:FOR J=1 TO I:IF D(J)=0 THEN M=M+1:NEXT
710 X=&HFE01:FOR J=M+1TO I:X=X+1:POKE X,D(J):NEXT:X=X+1:POKE X,0:REM PUT TIMES INTO MACHINE PROGRAM
730 Z1=Z1+M+1:IF Z1>59 THEN Z1=Z1-60:Z2=Z2+1:IF Z2=24 THEN Z2=0
740 X=&HFE00:POKE X,Z2:POKE X+1,Z1:X=USR(0):CMD"R"
999 END
