Category : Science and Education
Archive   : DAYLIGHT.ZIP
Filename : DAYLIGHT.BAS

 
Output of file : DAYLIGHT.BAS contained in archive : DAYLIGHT.ZIP
60 REM
70 REM - START
80 REM
90 GOSUB 170
130 GOTO 240
140 REM
150 REM - SCREEN HEADER
160 REM
170 CLS
180 PRINT TAB(10);"RUN TIME CALCULATOR"
190 FOR I=1 TO 40
192 PRINT "-";
194 NEXT
196 PRINT
200 RETURN
210 REM
220 REM - BEGIN PROGRAM - CONSTANTS
230 REM
240 A=1.5708
250 B=3.14159
260 C=4.71239
270 D=6.28319
280 REM
290 REM - INPUTS
300 REM
310 GOSUB 170
320 PRINT "ENTER DATA:":PRINT
330 REM INPUT "LATITUDE DD.MMSS";Z
335 Z=51.0246
340 GOSUB 1120
350 lat=Z*.0174533
360 REM
370 REM INPUT "LONGITUDE DD.MMSS";Z
375 Z=114.0324
380 GOSUB 1120
390 long=Z*.0174533
400 REM
410 INPUT "YEAR ";H
420 INPUT "MONTH ";I
430 INPUT "DAY ";J
440 REM
450 REM INPUT "Z ";Z
455 Z=7
460 GOSUB 1120
470 zone=Z*.261799
480 REM
490 REM - DAY OF YEAR
500 REM
510 K=INT((I+9)/12)
520 X=H/4
530 Y=INT(X)
540 Z=X-Y
550 IF Z=0 THEN 570
560 K=K*2
570 H=INT(275*I/9)
580 H=H+J-K-30
590 REM
600 REM - RISING PHENOMENA
610 REM
620 I=0
630 J=A
640 GOSUB 1250
650 REM
660 R=-.309017
670 GOSUB 1780:PRINT
680 PRINT"ASTRONOMICAL DAWN:";TAB(25);V$
690 REM
700 R=-.207912
710 GOSUB 1780
720 PRINT "NAUTICAL DAWN:";TAB(25);V$
730 REM
740 R=-.104528
750 GOSUB 1780
760 PRINT "CIVIL DAWN:";TAB(25);V$
770 REM
780 R=-.0145439
790 GOSUB 1780
800 PRINT "SUNRISE:";TAB(25);V$
810 PRINT "------------------------------"
820 REM
830 REM - SETTING PHENOMENA
840 REM
850 I=1
860 J=C
870 GOSUB 1250
880 REM
890 R=-.0145439
900 GOSUB 1780
910 PRINT "SUNSET:";TAB(25);V$
920 REM
930 R=-.104528
940 GOSUB 1780
950 PRINT "CIVIL DUSK:";TAB(25);V$
960 REM
970 R=-.207912
980 GOSUB 1780
990 PRINT "NAUTICAL DUSK:";TAB(25);V$
1000 REM
1010 R=-.309017
1020 GOSUB 1780
1030 PRINT "ASTRONOMICAL DUSK:";TAB(25);V$
1040 REM
1050 PRINT:INPUT "ANOTHER CALCULATION (Y/N)";A$
1060 IF A$<>"Y" AND A$ <> "N" THEN 1050
1070 IF A$="N" THEN END
1080 CLS:GOTO 240
1090 REM
1100 REM - SEXAGESIMAL TO DECIMAL
1110 REM
1120 W=1
1130 IF Z>=0 THEN 1160
1140 W=-1
1150 Z=ABS(Z)
1160 X=INT(Z)

1170 Z=(Z-X)*100
1180 Y=INT(Z)
1190 Z=(Z-Y)*100
1200 Z=(X+Y/60+Z/3600)*W
1210 RETURN
1220 REM
1230 REM - APPROXIMATE TIME
1240 REM
1250 K=H+((J+long)/D)
1260 REM
1270 REM - SOLAR MEAN ANOMALY
1280 REM
1290 L=K*.017202
1300 L=L-.0574039
1310 REM
1320 REM - SOLAR TRUE LONGITUDE
1330 REM
1340 Z=SIN(L)
1350 M=L+.0334405*Z
1360 Z=SIN(2*L)
1370 M=M+3.49066E-04*Z
1380 M=M+4.93289
1390 REM
1400 REM - QUADRANT DETERMINATION
1410 REM
1420 Z=M
1430 GOSUB 2350
1440 M=Z
1450 X=M/A
1460 Y=INT(X)
1470 Z=X-Y
1480 IF Z<>0 THEN 1500
1490 M=M+4.84814E-06
1500 N=2
1510 IF M>C THEN 1580
1520 N=1
1530 IF M>A THEN 1580
1540 N=0
1550 REM
1560 REM - SOLAR RIGHT ASCENSION
1570 REM
1580 P=.91746*TAN(M)
1590 P=ATN(P)
1600 REM
1610 REM - QUADRANT ADJUSTMENT
1620 REM
1630 IF N=0 THEN 1710
1640 IF N=2 THEN 1670
1650 P=P+B
1660 GOTO 1710
1670 P=P+D
1680 REM
1690 REM - SOLAR DECLINATION
1700 REM
1710 Q=.39782*SIN(M)
1720 Q=Q/SQR(-Q*Q+1)
1730 Q=ATN(Q)
1740 RETURN
1750 REM
1760 REM - COORDINATE CONVERSION
1770 REM
1780 S=R-(SIN(Q)*SIN(lat))
1790 S=S/(COS(Q)*COS(lat))
1800 REM
1810 REM - NULL PHENOMENON
1820 REM
1830 Z=ABS(S)
1840 IF Z<=1 THEN 1900
1850 V=0
1860 RETURN
1870 REM
1880 REM - ADJUSTMENT
1890 REM
1900 S=S/SQR(-S*S+1)
1910 S=-ATN(S)+A
1920 IF I=1 THEN 1970
1930 S=D-S
1940 REM
1950 REM - LOVAL APPARENT TIME
1960 REM
1970 Z=.0172028*K
1980 T=S+P-Z-1.73364
1990 REM
2000 REM - UNIVERSAL TIME
2010 REM
2020 U=T+long
2030 REM
2040 REM - WALL CLOCK TIME
2050 REM
2060 V=U-zone
2070 REM
2080 REM - DECIMAL TO SEXAGESIMAL
2090 REM
2100 Z=V
2110 GOSUB 2350
2120 Z=Z*3.81972
2130 V=INT(Z)
2140 W=(Z-V)*60
2150 X=INT(W)
2160 Y=W-X
2170 IF Y<.5 THEN 2190
2180 X=X+1
2190 IF X<60 THEN 2250
2200 V=V+1
2210 X=0
2220 REM
2230 REM - CONVENTIONAL FORMAT
2240 REM
2250 Z$="00"
2260 HR$=MID$(STR$(V),2)
2270 HR$=RIGHT$(Z$+HR$,2)
2280 MI$=MID$(STR$(X),2)
2290 MI$=RIGHT$(Z$+MI$,2)
2300 V$=HR$+":"+MI$
2310 RETURN
2320 REM
2330 REM - NORMALIZATION
2340 REM
2350 IF Z>=0 THEN 2380
2360 Z=Z+D
2370 GOTO 2350
2380 IF Z 2390 Z=Z-D
2400 GOTO 2380
2410 RETURN
2420 END


  3 Responses to “Category : Science and Education
Archive   : DAYLIGHT.ZIP
Filename : DAYLIGHT.BAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/