home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
SIMTEL
/
CPMUG
/
CPMUG041.ARK
/
MOONLOC5.BAS
< prev
next >
Wrap
BASIC Source File
|
1984-04-29
|
5KB
|
193 lines
500 DIM F(31), V(31), Y(31), Q(31), S(31)
560 P5=2.0000000000*3.1415926535
570 D5=360.0000000000/P5
580 R5=P5/360.0000000000
582 DEF FNA(X)=INT(X*D5*10+.5)/10
584 DEF FNB(X)=(X-INT(X))*P5
585 PRINT "WHAT ARE THE STATION CALL LETTERS";
586 INPUT W$
590 PRINT "WHAT IS YOUR LATITUDE IN DEGREES, MINUTES";
600 INPUT L5,U5
610 PRINT "WHAT IS YOUR LONGITUDE IN DEGREES, MINUTES";
620 INPUT L6,U6
630 LET L5=(L5+U5/60)*R5
640 LET L6=(L6+U6/60)*R5
650 PRINT "WHAT IS THE DESIRED PRINTING INCREMENT IN MINUTES";
660 INPUT I
670 PRINT "DO YOU ONLY WANT PRINTOUT WHEN THE MOON IS NEAR THE HORIZON";
690 INPUT B$
700 IF B$="YES" THEN 730
710 LET I6=100
720 GOTO 800
730 PRINT "BELOW WHAT ELEVATION IN DEGREES DO YOU WANT PRINTOUT TO OCCUR";
740 INPUT I6
750 PRINT "WHAT ARE THE GMT MONTH,DAY,YEAR DESIRED":
760 FOR N=1 TO 31
770 INPUT F(N),V(N),Y(N)
780 IF F(N)=0 THEN 860
785 NEXT N
790 GOTO 760
800 PRINT "WHAT ARE THE GMT MONTH,DAY,YEAR,TIME BEGINNING,TIME ENDING"
820 FOR N=1 TO 31
830 INPUT F(N),V(N),Y(N),Q(N),S(N)
840 IF F(N)=0 THEN 860
845 NEXT N
850 GOTO 820
860 LET N5=N-1
870 FOR N=1 TO N5
880 IF B$="YES" THEN 900
890 GOTO 930
900 E1=2400
910 B=0
920 GOTO 950
930 E1=S(N)
940 B=Q(N)
950 M=F(N)
960 D=V(N)
970 Y=Y(N)
980 Y1=Y-(INT(Y/100)*100)
990 PRINT
1000 PRINT
1010 PRINT "POSITION OF MOON ON ";M;"/";D;"/";Y1;"GMT FROM";W$
1020 PRINT
1030 PRINT " GMT"," AZ"," EL"," GHA"," DEC"
1040 PRINT " ---"," --"," --"," ---"," ---"
1050 PRINT
1060 I1=2
1080 IF M>=3 THEN 1160
1090 IF INT((Y-1853)/4)<11 THEN 1120
1100 C1=-1
1110 GOTO 1130
1120 C1=0
1130 J1=365*(Y-1853)+D+30*(M+9)+INT((M+10)/2)
1140 J2=INT((Y-1853)/4)+1+C1
1150 GOTO 1270
1160 IF INT((Y-1852)/4)<11 THEN 1190
1170 LET C1=-1
1180 GOTO 1200
1190 LET C1=0
1200 IF M=9 THEN 1240
1210 IF M=11 THEN 1240
1220 C2=0
1230 GOTO 1250
1240 C2=1
1250 J1=365*(Y-1852)+D+30*(M-3)+INT((M-2)/2)
1260 J2=INT((Y-1852)/4)+C1+C2
1270 J=J1+J2
1280 T1=J-17472.5
1290 D9=(B-INT(B/100)*100)+INT(B/100)*60
1300 D6=(E1-INT(E1/100)*100)+INT(E1/100)*60
1310 D7=D9-D6
1320 D8=D7-I
1330 IF D7>0 THEN 1350
1340 GOTO 1380
1350 IF D8>=0 THEN 2220
1360 B=E1
1380 T=(B-INT(B/100)*100)/1440+INT(B/100)*24
1390 T5=T1+T
1400 K1=FNB(.751213+.036601102*T5)
1410 K2=FNB(.822513+.0362916457*T5)
1420 K3=FNB(.995766+.00273777852*T5)
1430 K4=FNB(.974271+.0338631922*T5)
1440 K5=FNB(.0312525+.0367481957*T5)
1450 L8=K1+.658*R5*SIN(2*K4)+6.289*R5*SIN(K2)
1460 L8=L8-1.274*R5*SIN(K2-2*K4)-.186*R5*SIN(K2-2*K4)-.186*R5*SIN(K3)
1470 L8=L8+.214*R5*SIN(2*K2)-.114*R5*SIN(2*K5)
1480 L8=L8-.059*R5*SIN(2*K2-2*K4)-.057*R5*SIN(K2+K3-2*K4)
1490 K6=K5+.6593*R5*SIN(2*K4)+6.2303*R5*SIN(K2)-1.272*R5*SIN(K2-2*K4)
1500 L7=5.144*R5*SIN(K6)-.146*R5*SIN(K5-2*K4)
1520 D1=COS(L7)*SIN(L8)*.397821+SIN(L7)*.917463
1530 D1=ATN(D1/(SQR(1-D1^2)))
1531 G1=50+.5+((D1)/(.792))*D5
1532 G2=80+((D1)/(.808))*D5
1533 G3=141.5-((D1)*(.738)*D5)
1534 G4=170.5-((D1)*(.857)*D5)
1540 A2=COS(L7)*COS(L8)/COS(D1)
1550 A1=(COS(L7)*SIN(L8)*.917463-SIN(L7)*.397821)/COS(D1)
1560 LET A=ATN(A1/A2)
1570 GOSUB 1870
1580 R1=A
1590 L1=.065709822*T1
1600 L=T*24*1.002738+6.646055+(L1-INT(L1/24)*24
1610 L=(L-INT(L/24)*24)
1630 G=(L/24)*P5-R1
1640 IF G<P5 THEN 1670
1650 G=G-P5
1660 GOTO 1710
1670 IF G<0 THEN 1690
1680 GOTO 1710
1690 G=G+P5
1710 H=L6-G
1730 E3=COS(L5)*COS(H)*COS(D1)+SIN(D1)*SIN(L5)
1740 E2=SQR(1-(E3*E3))
1750 E=ATN(E3/E2)
1755 F=ATN(E3/E2)
1760 IF E<0 THEN 2178
1770 IF E>I6*R5 THEN 2178
1790 A2=SIN(D1)/(COS(L5)*COS(F))
1800 A2=A2-(SIN(L5)/COS(L5))*(SIN(F)/COS(F))
1810 A1=SIN(L5)*SIN(D1)+COS(L5)*COS(D1)*COS(H)
1820 A1=(SIN(H)*COS(D1))/(SQR(1-A1^2))
1830 A=ATN(A1/A2)
1840 GOSUB 1870
1850 GOTO 2020
1870 IF A=0 THEN 1890
1880 GOTO 1930
1890 IF A2<0 THEN 1910
1900 GOTO 2010
1910 A=P5/2
1920 GOTO 2010
1930 IF A>0THEN 1990
1940 IF A2<0 THEN 1970
1950 A=P5+A
1960 GOTO 2010
1970 A=P5+(A-P5/2)
1980 GOTO 2010
1990 IF A2>=0 THEN 2010
2000 A=A+P5/2
2010 RETURN
2020 IF (T-I1)>(2*I)/1440 THEN 2040
2030 GOTO 2050
2040 PRINT
2050 IF INT(B+.5)>9 THEN 2080
2060 S$=" "
2070 GOTO 2142
2080 IF INT(B+.5)>99 THEN 2110
2090 S$=" "
2100 GOTO 2142
2110 IF INT(B+.5)>999 THEN 2140
2120 S$=" "
2130 GOTO 2142
2140 S$=""
2142 Z1=FNA(A)
2144 Z2=FNA(E)
2146 Z3=FNA(G)
2148 Z4=FNA(D1)
2150 IF Z4<0 THEN 2163
2151 IF Z3<G1 THEN 2163
2152 IF Z3>G2 THEN 2154
2153 GOTO 2157
2154 IF Z3<G3 THEN 2159
2155 IF Z3>G4 THEN 2163
2156 GOTO 2161
2157 Y$="U"
2158 GOTO 2170
2159 Y$="W"
2160 GOTO 2170
2161 Y$="J"
2162 GOTO 2170
2163 Y$=" "
2170 PRINT S$;STR$(INT(B+.5)),Z1,Z2,Z3,Z4;Y$
2180 Z=(B-INT(B/100)*100)-60
2190 IF Z<0 THEN 1290
2200 B=INT(B/100)*100+100+Z
2210 GOTO 1290
2220 NEXT N
2230 N=0
2240 PRINT
2260 PRINT
2270 PRINT "DO YOU WANT MORE INFORMATION":
2280 INPUT D$
2290 IF D$="YES" THEN 560
2300 END