home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 3
/
hamradioversion3.0examsandprograms1992.iso
/
satel
/
satcom
/
satcom.bas
Wrap
BASIC Source File
|
1988-05-01
|
5KB
|
169 lines
10 ON ERROR GOTO 1600
20 COLOR 5,7 : GOTO 1050' * Satellite data calculations *
30 ' Written by: Fred W. Wise P.E. - Windsor, Pa.
40 'Modified by Bruce Goldman (L/C, N.Y. default
50 ' & Satellite update of July, 1987
60 ' Ver 1.2 Placed in the public domain may 7, 1982
70 ' Provided via BB's BBB (212) 933-9459 in the Bronx, NYC.
80 ' Sat data in arrays ns()= name, st()= long. Deg.
90 ' Sd= claculated distance to sat. In km.
100 ' Rt= receiver long. Rl=receiver latitude, both are deg.
110 ' Se= calc. Elev. Sb=calc. Bng. To sat, both in deg.
120 ' Se & sb start here
130 T = ST(I) - RT
140 IF ABS(T) < 180 THEN 160
150 IF T > 0 THEN T = T - 360 ELSE T = T + 360
160 T = T / RD
170 V = COS(RL / RD) * COS(T)
180 GOSUB 430
190 S = U
200 V = SIN(T) / COS(S)
210 IF V >= 1 THEN U = 90 / RD: GOTO 240
220 IF V <= -1 THEN U = -90 / RD: GOTO 240
230 GOSUB 430
240 Z = INT(ABS(U * RD) * 10 + .5) / 10
250 U = 0
260 IF RL <> 0 THEN 280
270 U = -90 / RD
280 IF T < 0 THEN Z = -Z
290 IF S > U THEN 330
300 IF RL >= 0 THEN 340
310 SB = Z + 180
320 GOTO 360
330 IF RL > 0 THEN 310
340 SB = 360 - Z
350 IF SB >= 360 THEN SB = SB - 360
360 IF S < .115 THEN SE = 0: RETURN
370 U = RE / TAN(S)
380 V = RS - RE / SIN(S)
390 SD = SQR(U ^ 2 + V ^ 2 - 2 * U * V * COS(180 / RD - S))
400 X = (U ^ 2 + SD ^ 2 - V ^ 2) / (2 * U * SD)
410 SE = (-ATN(X / SQR(-X * X + 1)) + 1.5708) * RD
420 RETURN
430 IF V = 1 THEN U = 90 / RD: RETURN
440 U = ATN(V / SQR(-V * V + 1))
450 RETURN' Arc sin
460 CLS
470 PRINT STRING$(79, 42)
480 PRINT TAB(17); "* Geostationary Communications Satellite Data *"
490 PRINT STRING$(79, 42)
500 RETURN
510 ' General subroutines
520 GOSUB 460
530 PRINT
540 PRINT TAB(9); "SATELLITE"; TAB(28); "BNG."; TAB(41); "ELEV."; TAB(52); "DIST. KM"; TAB(64); "DEGREES"
550 PRINT TAB(9); STRING$(62, 45)
560 RETURN
570 ' **** Main program start ****
580 GOSUB 460
590 PRINT
600 PRINT "Written by: Fred W. Wise P.E. - Windsor, Pa."
610 PRINT "Ver 1.2 - Placed in the public domain - May 7, 1982"
620 PRINT "Modified by Bruce Goldman"
630 PRINT "Satellite update - July, 1987": PRINT
640 PRINT , "Enter receiver latitude and longitude"
650 PRINT , "In degrees (with decimal part..."
660 PRINT
670 PRINT , ;
680 INPUT "Longitude (N.Y. 74.00 is default): "; RT
690 IF RT = 0 THEN RT = 74
700 PRINT , ;
710 INPUT "Latitude (N.Y. 40.45 is default): "; RL
720 IF RL = 0 THEN RL = 40.45
730 GOSUB 520
740 FOR I = 1 TO 12
750 GOSUB 980
760 NEXT
770 PRINT
780 INPUT "<Enter> to continue --> "; K
790 GOSUB 520
800 FOR I = 13 TO 24
810 GOSUB 980
820 NEXT
830 PRINT
840 INPUT "<Enter> to continue --> "; K
850 GOSUB 520
860 FOR I = 25 TO 36
870 GOSUB 980
880 NEXT
890 PRINT
900 INPUT "<Enter> to continue --> "; K
910 GOSUB 520
920 FOR I = 37 TO IM
930 GOSUB 980
940 NEXT
950 PRINT
960 INPUT "<Enter> to run again --> "; K
970 GOTO 580
980 GOSUB 130
990 PRINT TAB(9); NS(I); TAB(28); USING P1$; SB;
1000 PRINT TAB(40); USING P1$; SE;
1010 PRINT TAB(52); USING P2$; SD;
1015 PRINT TAB(63); ST(I); "°"
1020 RETURN
1030 '
1040 ' * * Initialization * *
1050 CLEAR 500
1060 DEFINT I
1070 DEFSTR K,P,N
1080 IM=40' Number of birds in data statements
1090 DIM NS(IM),ST(IM)
1100 P1="###.#"
1110 P2="#####"
1120 RD=57.29578
1130 RS=42157!' Km to satelite
1140 RE=6371' Km to earth rad.
1150 FOR I=1 TO IM
1160 READ NS(I),ST(I)
1170 NEXT
1180 GOTO 580
1190 '
1200 ' *** Satelite data ***
1210 '
1220 DATA "Anik 1, D & D1", 104.5
1230 DATA Anik 2 & 3, 114
1240 DATA Anik B, 109
1260 DATA Anik C2 & D2, 110.5
1270 DATA Anik C1, 107.5
1290 DATA Anik C3, 117.5
1300 DATA ASC-1, 128
1310 DATA Aurora F5, 143
1320 DATA Comstar 2, 95
1330 DATA Comstar 3, 87
1340 DATA Comstar D3/D4, 76
1350 DATA Comstar D4, 127
1360 DATA Galaxy 1, 134
1370 DATA Galaxy 2, 74
1380 DATA Galaxy 3, 93.5
1390 DATA Gstar 1, 103
1400 DATA Gstar 2, 105
1410 DATA Morelos 1, 113.5
1420 DATA Morelos 2, 116.5
1430 DATA Satcom 1, 135
1440 DATA Satcom 2, 119
1445 DATA Satcom F2R, 72
1450 DATA Satcom 3R & F3R, 131
1460 DATA Satcom 4 & F4, 83
1470 DATA Satcom 5 & F1R, 139
1520 DATA Satcom K1, 85
1530 DATA Satcom K2, 81
1540 DATA SBS 1, 99
1550 DATA SBS 2, 97
1560 DATA SBS 3, 95
1570 DATA SBS 4, 91
1580 DATA Spacenet 1, 120
1590 DATA Spacenet 2, 69
1600 DATA Telestar 301, 96
1610 DATA Telestar 302, 86
1620 DATA Telestar 303, 125
1630 DATA Westar 1 & 2, 79
1640 DATA Westar 3, 91
1650 DATA Westar 4, 99
1660 DATA Westar 5, 122.5
1670 ' To add or change data format is as follows:
1680 ' Name,longitude,
1690 '
1700 ' Set im=# birds in data statements
1710 END'Of satellite program****
1720 RESUME