home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RBBS in a Box Volume 1 #3.1
/
RBBSIABOX31.cdr
/
gprt
/
geosyc.bas
< prev
next >
Wrap
BASIC Source File
|
1990-09-29
|
12KB
|
384 lines
10 FG=0
20 GOTO 1150
30 T=M2-M1
40 TA=ABS(T)
50 IF TA<= 180 THEN GOTO 80
60 TS= SGN(T)
70 T= -1*((TS*360)-T)
80 EP=T
90 T= T/RD: L1= L1/RD: EP= EP/RD
100 X= SQR(1-.5*(COS(L1)+COS(EP)))
110 ML= 2* FN ARCSYN(X)
120 EL= (PI/2)-(ML+ATN (R*SIN(ML)/(R*(1-COS(ML)*H))))
130 IF EP=0 THEN YA=PI: GOTO 170
140 ZA= 1/TAN(EP/2)
150 ZB= TAN(L1/2)
160 YA= ATN(ZA*ZB)+ ATN(ZA*(1/ZB))
170 YA= YA*RD: EL= INT(EL*RD): L1= L1*RD
180 ZF=360
190 IF L1<0 THEN GOTO 230
200 YA= 360+YA
210 Y=YA MOD 360
220 RETURN
230 Y= INT(180+YA)
240 RETURN
250 PRINT CHR$(12);
260 INPUT"WHAT IS THE NAME OF THE CITY "; NC$
270 PRINT:PRINT
280 INPUT"ENTER THE CITY LATITUDE USING SPACES TO SEPERATE DEGREES MINUTES AND N(ORTH) OR S(OUTH). "; DL$
290 LE= LEN(DL$)
300 I=1
310 IF MID$(DL$,I,1)=" " THEN GOTO 360
320 IF (I=LE) THEN GOTO 340
330 I= I+1: GOTO 310
340 PRINT"WHEN YOU ENTER THE LATITUDE, BE SURE TO USE SPACES TO SEPERATE THE ENTRIES. ":PRINT"PRESS ANY KEY TO CONTINUE";:K$=INPUT$(1)
350 PRINT CHR$(12);: GOTO 280
360 J=I-1
370 DG= VAL(MID$(DL$,1,J))
380 MN=0: KK=0
390 I=I+1
400 IF MID$(DL$,I,1)=" " THEN GOTO 430
410 IF (I=LE) THEN 340
420 I= I+1: KK=1: GOTO 400
430 JK= I-1
440 IF KK<> 0 THEN MN= VAL(MID$(DL$,J+1,JK))
450 IF NOT (DG>90 OR DG<0 OR MN>60 OR MN<0) THEN 480
460 PRINT"DEGREES ARE BETWEEN 0 AND 90 AND MINUTES ARE BETWEEN 0 AND 60.":PRINT"PRESS ANY KEY TO CONTINUE ";:K$=INPUT$(1)
470 PRINT CHR$(12);: GOTO 280
480 L1= DG+(MN/60)
490 I=I+1
500 NS$= MID$(DL$,I,1)
510 IF NS$="N" OR NS$="S" THEN GOTO 540
520 PRINT"ENTER EITHER N FOR NORTH OR S FOR SOUTH. PRESS ANY KEY TO CONTINUE ";:K$=INPUT$(1)
530 PRINT CHR$(12);: GOTO 280
540 IF NS$= "S" THEN L1=-L1
550 PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT
560 INPUT"ENTER THE CITY LONGITUDE USING SPACES TO SEPARATE DEGREES MINUTES AND E(AST OR W(EST). ";DL$
570 LE= LEN(DL$)
580 I=1
590 IF MID$(DL$,I,1)=" " THEN GOTO 640
600 IF (I=LE) THEN GOTO 620
610 I= I+1: GOTO 590
620 INPUT"WHEN YOU ENTER THE LONGITUDE, BE SURE TO USE SPACES TO SEPERATE THE ENTRIES. PRESS ANY KEY TO CONTINUE";K$
630 PRINT CHR$(12);: GOTO 550
640 J= I-1
650 DG= VAL(MID$(DL$,1,J))
660 MN=0: KK=0
670 I=I+1
680 IF MID$(DL$,I,1)=" " THEN GOTO 710
690 IF (I=LE) THEN GOTO 620
700 I= I+1:KK=1: GOTO 680
710 JK=I-1
720 IF KK<> 0 THEN MN= VAL(MID$(DL$,J+1,JK))
730 IF NOT (DG> 180 OR DG< 0 OR MN> 60 OR MN < 0) THEN GOTO 760
740 PRINT"DEGREES ARE BETWEEN 0 AND 180 AND MINUTES ARE BETWEEN 0 AND 60.":PRINT"PRESS ANY KEY TO CONTINUE ";:K$=INPUT$(1)
750 PRINT CHR$(12);: GOTO 1750
760 M1= DG+(MN/60)
770 I= I+1
780 EW$= MID$(DL$,I,1)
790 IF EW$= "E" OR EW$= "W" THEN GOTO 820
800 PRINT"ENTER EITHER E FOR EAST OR W FOR WEST. PRESS ANY KEY TO CONTINUE ";:K$=INPUT$(1)
810 PRINT CHR$(12);: GOTO 550
820 IF EW$= "W" THEN M1= -M1
830 RETURN
840 PRINT CHR$(12)
850 INPUT"WHAT IS THE NAME OF THE SATELLITE ";NS$
860 PRINT:PRINT
870 INPUT"ENTER THE SATELITE LONGITUDE USING SPACES TO SEPERATE DEGREES MINUTES AND E(AST) OR W(EST) ";SL$
880 LE= LEN(SL$)
890 I=1
900 IF MID$(SL$,I,1)=" " THEN GOTO 950
910 IF (I=LE) THEN GOTO 930
920 I=I+1: GOTO 900
930 PRINT"WHEN YOU ENTER THE LONGITUDE, BE SURE TO USE SPACES TO SEPARATE THE ENTRIES. ":PRINT"PRESS ANY KEY TO CONTINUE ";:K$=INPUT$(1)
940 PRINT CHR$(12);: GOTO 550
950 J=I-1
960 DG= VAL(MID$(SL$,I,J))
970 MN= 0: KK=0
980 I= I+1
990 IF MID$(SL$,I,1)=" " THEN GOTO 1020
1000 IF (I=LE) THEN GOTO 2010
1010 I= I+1: KK=1: GOTO 990
1020 JK=I-1
1030 IF KK<> 0 THEN MN= VAL(MID$(SL$,J+1,JK))
1040 IF NOT (DG>180 OR DG<0 OR MN>60 OR MN<0) THEN GOTO 1070
1050 PRINT"DEGREES ARE BETWEEN 0 AND 180 AND MINUTES ARE BETWEEN 0 AND 60.":PRINT"PRESS ANY KEY TO CONTINUE ";: K$=INPUT$(1)
1060 PRINT CHR$(12);: GOTO 870
1070 M2= DG+(MN/60)
1080 I= I+1
1090 EW$= MID$(SL$,I,1)
1100 IF EW$="E" OR EW$= "W" THEN GOTO 1130
1110 PRINT"ENTER EITHER E FOR EAST OR W FOR WEST. PRESS ANY KEY TO CONTINUE. ";:K$=INPUT$(1)
1120 PRINT CHR$(12);: GOTO 550
1130 IF EW$= "W" THEN M2= -M2
1140 RETURN
1150 PRINT CHR$(12);:
1160 PRINT TAB(34);"G E O S A T"
1170 PRINT:PRINT:PRINT:PRINT TAB(29);"LOOK ANGLE CALCULATOR"
1180 FOR I= 1 TO 2000:NEXT I
1190 PRINT CHR$(12);
1200 PRINT:PRINT TAB(21);
1210 PRINT"THIS PROGRAM WILL ALLOW YOU TO"
1220 PRINT TAB(21)"DETERMINE WHERE YOU HAVE TO POINT"
1230 PRINT TAB(21)"AN ANTENNA TO PERMIT RECEPTION OF"
1240 PRINT TAB(21)"SIGNALS TRANSMITTED FROM A"
1250 PRINT TAB(21)"GEOSYNCHRONOUS SATELLITE."
1260 PRINT:PRINT
1270 PRINT"IF YOU NEED INSTRUCTIONS ON THE OPERATION OF THIS PROGRAM,"
1280 PRINT"PRESS THE <ESC> KEY. OTHERWISE ANY OTHER KEY WILL START THE PROGRAM."
1290 PRINT
1300 PRINT
1310 PRINT
1320 PRINT" THE INSTRUCTIONS ARE CONTAINED ON SEVERAL PAGES. TO SEE THE VARIOUS PAGES, USE <RTN> TO CHANGE THE DISPLAY."
1330 PRINT
1340 PRINT"<ESC> TO GET INSTRUCTIONS";
1350 PRINT" ANY OTHER KEY TO START ";
1360 KB$=INPUT$(1)
1370 IF KB$< CHR$(12) THEN 1360
1380 IF KB$<> CHR$(27) THEN GOTO 2080
1390 PRINT CHR$(12);:
1400 PRINT:PRINT
1410 PRINT"WHEREVER THERE ARE PARENTHESES AROUND WORDS OR GROUPS OF LETTERS IN THE"
1420 PRINT
1430 PRINT"INSTRUCTIONS, THIS MEANS THAT THE THINGS INSIDE THE PARENTHESES ARE OPTIONAL."
1440 PRINT
1450 PRINT
1460 PRINT"ITEMS INSIDE THE SYMBOLS < > ARE REQUIRED OPERATIONS OR ENTRIES."
1470 PRINT
1480 PRINT
1490 PRINT" <SP> IS THE SPACE KEY."
1500 PRINT" <RTN> IS THE RETURN KEY."
1510 PRINT" <ESC> IS THE ESCAPE KEY."
1520 PRINT:INPUT"<RTN> TO CONTINUE";KB$
1530 PRINT CHR$(12);:
1540 PRINT
1550 PRINT" AS A PART OF THIS PROGRAM, THERE ARE 2 DATA SETS. ONE CONSISTS OF A NUMBER OF"
1560 PRINT
1570 PRINT"SATELLITES AND THEIR LONGITUDES. THE OTHER IS A NUMBER OF CITIES AND THEIR"
1580 PRINT
1590 PRINT"LATITUDES AND LONGITUDES."
1600 PRINT
1610 PRINT"FOR EACH DATA SET, YOU WIL BE ASKED WHETHER YOU WISH TO USE THE INFORMATION"
1620 PRINT
1630 PRINT"ALREADY IN THE PROGRAM OR WISH TO ENTER NEW INFORMATION."
1640 PRINT
1650 PRINT
1660 PRINT"IF YOU CHOOSE TO USE THE INFORMATION ALREADY IN THE PROGRAM, SIMPLY ENTER"
1670 PRINT
1680 PRINT"THE NUMBER THAT CORRESPONDS TO THE CITY OR SATELLITE YOU DESIRE AND PRESS"
1690 PRINT
1700 PRINT"THE <RTN> KEY."
1710 PRINT
1720 PRINT"IF YOU WISH TO ENTER YOUR OWN CITY OR SATELLITE, PRESS ANY KEY THAT DOES NOT"
1730 PRINT
1740 PRINT"CORRESPOND TO A CITY OR SATELLITE AND PRESS <RTN>."
1750 PRINT
1760 INPUT "<RTN> TO CONTINUE";KB$
1770 PRINT CHR$(12)
1780 PRINT
1790 PRINT"YOU WILL BE ASKED SEVERAL QUESTIONS."
1800 PRINT
1810 PRINT"FOR THE NAMES OF CITIES OR SATELLITES ENTER WHATEVER YOU WISH."
1820 PRINT
1830 PRINT"USE SPACES AND NOT COMMAS AS SEPERATORS IF NEEDED."
1840 PRINT
1850 PRINT"WHEN LATITUDE INFORMATION IS REQUESTED, ENTER THE DATA IN THE FORMAT: "
1860 PRINT
1870 PRINT"DEGREES <SP> MINUTES <SP> N OR S <RTN>"
1880 PRINT
1890 PRINT
1900 PRINT"N(ORTH) OR S(OUTH) MUST BE ENTERED, BUT IF YOU WISH TO SKIP THE DEGREE OR"
1910 PRINT
1920 PRINT"MINUTE ENTRY JUST ENTER A SPACE INSTEAD OF THE NUMBER. COMPLETE THE ENTRY BY"
1930 PRINT
1940 PRINT"PRESSING THE RETURN KEY."
1950 PRINT
1960 PRINT"THE IDENTICAL FORMAT IS USED FOR LONGITUDE DATA. JUST REPLACE N OR S BY"
1970 PRINT
1980 PRINT"E(AST) OR W(EST)"
1990 PRINT
2000 INPUT "<RTN> TO CONTINUE ";KB$
2010 PRINT CHR$(12);
2020 PRINT:PRINT:PRINT
2030 PRINT"IF YOU NEED TO SEE THE INSTRUCTIONS AGAIN, PRESS <ESC>. OTHERWISE, USE ANY"
2040 PRINT
2050 PRINT"OTHER KEY TO START THE PROGRAM."
2060 KB$=INPUT$(1)
2070 IF KB$= CHR$(27) THEN GOTO 1390
2080 PRINT CHR$(12);: R=6378: H=35500!: PI= 3.14159
2090 RD= 360/(2*PI)
2100 DEF FN ARCSYN(X)= ATN(X/SQR(-X*X+1))
2110 RESTORE
2120 READ N
2130 IF FG=1 THEN GOTO 2150
2140 DIM SN$(N),SN(N),DS$(N),DS(N),P(24)
2150 FOR I= 1 TO N
2160 READ SN$(I)
2170 READ SN(I)
2180 NEXT I
2190 SN(0)=N
2200 IF FG=1 THEN GOTO 2220
2210 DIM A(N),E(N)
2220 READ M
2230 IF FG=1 THEN GOTO 2250
2240 DIM CN$(M),CL(M),CM(M)
2250 FOR I= 1 TO M
2260 READ CN$(I)
2270 READ CL(I)
2280 READ CM(I)
2290 NEXT I
2300 CL(0)= M
2310 PRINT CHR$(12);
2320 PRINT"THESE CITIES ARE AVAILABLE: "
2330 M= CL(0)
2340 IF M>30 THEN M=30
2350 M1= M/2: M2= INT(M1): MP= M1-M2
2360 HL= 3: HR=23
2370 FOR I= 1 TO M2
2380 J= I+ M2
2390 IF MP < > 0 THEN J= J+1
2400 GOSUB 3600
2410 PRINT TAB( HL-H1);I;TAB(HL+2);CN$(I);TAB(HR-H2);J;TAB(HR+2);CN$(J)
2420 NEXT I
2430 IF MP <> 0 THEN GOSUB 3600:PRINT TAB(HL-H1);I; TAB(HL+2);CN$(I)
2440 PRINT"ENTER YOUR CHOICE BY INDICATING: "
2450 PRINT TAB(2);"A NUMBER BETWEEN 1 AND ";M;" OR USING ";
2460 PRINT"ANY OTHER KEY FOR A NEW CITY ";:INPUT KB$
2470 CK= VAL(KB$)
2480 IF CK<1 OR CK>M THEN GOSUB 250: CK= M+1
2490 PRINT CHR$(12);
2500 PRINT"THESE SATELLITES ARE AVAILABLE; "
2510 N=SN(0)
2520 IF N>30 THEN N=30
2530 N1=N/2: N2= INT(N1): NP=N1-N2
2540 HL=3: HR=23
2550 FOR I= 1 TO N2
2560 J= I+N2
2570 IF NP <>0 THEN J=J+1
2580 GOSUB 3600
2590 PRINT TAB(HL-H1);I;TAB(HL+2);SN$(I);TAB(HR-H2);J;TAB(HR+2);SN$(J)
2600 NEXT I
2610 IF NP <> 0 THEN GOSUB 3600:PRINT TAB(HL-H1);I;TAB(HL+2);SN$(I)
2620 PRINT"ENTER YOUR CHOICE: "
2630 PRINT TAB(2);"ZERO(0) TO USE ALL OR ANY NUMBER BETWEN 1 AND ";N;" OR"
2640 PRINT TAB(2);"ANY OTHER KEY FOR A NEW SATELLITE ";:INPUT KB$
2650 SQ= ASC(KB$)
2660 SK= VAL(KB$)
2670 IF SK=0 AND (SQ<48 OR SQ>57) THEN GOSUB 840:SK=N+1
2680 IF CK>M THEN DC$=NC$
2690 IF CK<=M THEN DC$=CN$(CK):L1= CL(CK): M1=CM(CK)
2700 N=SN(0)
2710 FOR I= 0 TO N
2720 DS$(I)= SN$(I)
2730 DS(I)= SN(I)
2740 NEXT I
2750 IF SK=0 THEN GOTO 2830
2760 DS(0)=1
2770 IF SK>N THEN GOTO 2810
2780 DS$(1)=DS$(SK)
2790 DS(1)=DS(SK)
2800 GOTO 2830
2810 DS$(1)=NS$
2820 DS(1)=M2
2830 MX=DS(0)
2840 FOR I= 1 TO MX
2850 M2= DS(I)
2860 GOSUB 30
2870 A(I)= Y: E(I)=EL
2880 NEXT I
2890 PRINT CHR$(12);
2900 PRINT TAB(4);"FROM: ";DC$
2910 PRINT:PRINT:PRINT TAB(29);"ANTENNA"
2920 PRINT TAB(4);"TO";TAB(26);"AZIMUTH";TAB(35);"ELEV."
2930 LP=15: ST=1: SP=LP: HL=31: HR=38
2940 Z1= INT(N/15)
2950 ZP=Z1+1
2960 FOR ZQ=1 TO ZP
2970 IF DS(0)< SP THEN SP=DS(0)
2980 FOR ZR= ST TO SP
2990 I=INT(A(ZR)): J=E(ZR)
3000 GOSUB 3600
3010 PRINT TAB(2);DS$(ZR);TAB(HL-H1);I;TAB(HR-H2);J
3020 NEXT ZR
3030 PRINT"PRESS <ESC> TO PRINT/ANY KEY TO CONTINUE ";
3040 KB$=INPUT$(1)
3050 IF KB$= CHR$(27) THEN GOSUB 3660
3060 ST=SP+1: SP=SP+LP: PRINT CHR$(12);
3070 NEXT ZQ
3080 PRINT:PRINT
3090 PRINT"USE <ESC> TO USE THE PROGRAM AGAIN."
3100 PRINT"USE <RTN> TO LEAVE THE PROGRAM."
3110 KB$=INPUT$(1)
3120 IF KB$= CHR$(27) THEN FG=1: GOTO 2080
3130 IF KB$= CHR$(13) THEN GOTO 3150
3140 GOTO 3110
3150 PRINT CHR$(12);:END
3160 DATA 30
3170 DATA ATS-3,-69
3180 DATA COMSTAR 3,-87
3190 DATA GOES-1,-75
3200 DATA WESTAR 3,-91
3210 DATA SMS-1,-105
3220 DATA COMSTAR 2,-95
3230 DATA WESTAR 4,-99
3240 DATA WESTAR 1,-79
3250 DATA WESTAR 5,-123
3260 DATA ANIK 1,-104
3270 DATA COMSTAR D-4,-127
3280 DATA ANIK B,-109
3290 DATA SATCOM 3R,-127
3300 DATA ANIK 2 & 3,-114
3310 DATA SATCOM 5,-139
3320 DATA SATCOM 2,-119
3330 DATA SATCOM 3R,-131
3340 DATA WESTAR 2,-123.5
3350 DATA SATCOM 4,-83
3360 DATA COMSTAR 1,-128
3370 DATA GTS,-116
3380 DATA SMS-2,-135
3390 DATA ATS-6,-140
3400 DATA ATS-1,-149
3410 DATA SATCOM 3,-132
3420 DATA STATIONAR 10,-170
3430 DATA INTELSAT TV F4,-181
3440 DATA MARISAT 2,-183
3450 DATA INTELSAT TV F8,-186
3460 DATA SATCOM 1,-135
3470 DATA 12
3480 DATA WASHINGTON D.C.,39,-77
3490 DATA LOS ANGELES,34,-118
3500 DATA NEW YORK,40.5,-74
3510 DATA ATLANTA,33.5,-84.5
3520 DATA MIAMI,25.75,-80.25
3530 DATA JACKSONVILLE,30.5,-81.5
3540 DATA TAMPA,28,-82.75
3550 DATA ANCHORAGE,60.8,-147
3560 DATA NOME,65,-165
3570 DATA PHOENIX,33.5,-112
3580 DATA LITTLE ROCK,34.75,-92.25
3590 DATA SUNNYVALE,37.2,-122.3
3600 H1=3: H2=3
3610 IF I<100 THEN H1=2
3620 IF I<10 THEN H1=1
3630 IF J<100 THEN H2=2
3640 IF J<10 THEN H2=1
3650 RETURN
3660 LPRINT TAB(4);"FROM: ";DC$
3670 LPRINT TAB(29);"ANTENNA"
3680 LPRINT TAB(4);"TO";TAB(26);"AZIMUTH";TAB(35);"ELEV."
3690 LP=30: ST=1: SP=LP: HL=31: HR=38
3700 Z1= INT(N/15)
3710 ZP=Z1+1
3720 IF DS(0)< SP THEN SP=DS(0)
3730 FOR ZR= ST TO SP
3740 I=INT(A(ZR)):J=E(ZR)
3750 GOSUB 3600
3760 LPRINT TAB(2);DS$(ZR);TAB(HL-H1);I;TAB(HR-H2);J
3770 NEXT ZR
3780 RETURN
3740 I=INT(A(ZR)):J=E(ZR)
3750 GOSUB 3600
3760 LPRINT TAB(2);DS$(ZR);TAB(HL-H1);I;TAB(HR-H2);J
3770 NEXT ZR