ChipMaster's bwBASIC This also includes history going back to v2.10. *WARN* some binary files might have been corrupted by CRLF.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

172 lines
4.4 KiB

  1. 10 REM MOONRISE-MOONSET
  2. 15 GOSUB 170
  3. 20 INPUT "LAT, LONG (DEG)";B5,L5
  4. 25 INPUT "TIME ZONE (HRS)";H
  5. 30 L5=L5/360: Z0=H/24
  6. 35 GOSUB 760: T=(J-2451545)+F
  7. 40 GOSUB 245: T=T+Z0
  8. 45 REM
  9. 50 REM POSITION LOOP
  10. 55 FOR I=1 TO 3
  11. 60 GOSUB 495: MM(I,1)=A5
  12. 65 MM(I,2)=D5: MM(I,3)=R5: T=T+0.5
  13. 70 NEXT
  14. 75 IF MM(2,1)>MM(1,1) THEN 85
  15. 80 MM(2,1)=MM(2,1)+P2
  16. 85 IF MM(3,1)>MM(2,1) THEN 95
  17. 90 MM(3,1)=MM(3,1)+P2
  18. 95 Z1=R1*(90.567-41.685/MM(2,3))
  19. 100 S=SIN(B5*R1): C=COS(B5*R1)
  20. 105 Z=COS(Z1): M8=0: W8=0: PRINT
  21. 110 A0=MM(1,1): D0=MM(1,2)
  22. 115 FOR C0=0 TO 23
  23. 120 P=(C0+1)/24
  24. 125 F0=MM(1,1):F1=MM(2,1):F2=MM(3,1)
  25. 130 GOSUB 225: A2=F
  26. 135 F0=MM(1,2):F1=MM(2,2):F2=MM(3,2)
  27. 140 GOSUB 225: D2=F
  28. 145 GOSUB 285: A0=A2:D0=D2:V0=V2
  29. 150 NEXT
  30. 155 GOSUB 450: REM SPECIAL MSG?
  31. 160 END
  32. 165 REM
  33. 170 REM CONSTANTS
  34. 175 DIM MM(3,3)
  35. 180 P1=3.14159265: P2=2*P1
  36. 185 R1=P1/180: K1=15*R1*1.0027379
  37. 190 S$="MOONSET AT "
  38. 195 R$="MOONRISE AT "
  39. 200 M1$="NO MOONRISE THIS DATE"
  40. 205 M2$="NO MOONSET THIS DATE"
  41. 210 M3$="MOON DOWN ALL DAY"
  42. 215 M4$="MOON UP ALL DAY"
  43. 220 RETURN
  44. 225 REM 3-POINT INTERPOLATION
  45. 230 A=F1-F0: B=F2-F1-A
  46. 235 F=F0+P*(2*A+B*(2*P-1))
  47. 240 RETURN
  48. 245 REM LST AT 0H ZONE TIME
  49. 250 T0=T/36525
  50. 255 S=24110.5+8640184.813*T0
  51. 260 S=S+86636.6*Z0+86400*L5
  52. 265 S=S/86400: S=S-INT(S)
  53. 270 T0=S*360*R1
  54. 275 RETURN
  55. 280 REM
  56. 285 REM TEST AN HOUR FOR AN EVENT
  57. 290 L0=T0+C0*K1: L2=L0+K1
  58. 295 IF A2<A0 THEN A2=A2+2*P1
  59. 300 H0=L0-A0: H2=L2-A2
  60. 305 H1=(H2+H0)/2: REM HOUR ANGLE
  61. 310 D1=(D2+D0)/2: REM DEC
  62. 315 IF C0>0 THEN 325
  63. 320 V0=S*SIN(D0)+C*COS(D0)*COS(H0)-Z
  64. 325 V2=S*SIN(D2)+C*COS(D2)*COS(H2)-Z
  65. 330 IF SGN(V0)=SGN(V2) THEN 440
  66. 335 V1=S*SIN(D1)+C*COS(D1)*COS(H1)-Z
  67. 340 A=2*V2-4*V1+2*V0: B=4*V1-3*V0-V2
  68. 345 D=B*B-4*A*V0: IF D<0 THEN 440
  69. 350 D=SQR(D)
  70. 355 IF V0<0 AND V2>0 THEN PRINT R$;
  71. 360 IF V0<0 AND V2>0 THEN M8=1
  72. 365 IF V0>0 AND V2<0 THEN PRINT S$;
  73. 370 IF V0>0 AND V2<0 THEN W8=1
  74. 375 E=(-B+D)/(2*A)
  75. 380 IF E>1 OR E<0 THEN E=(-B-D)/(2*A)
  76. 385 T3=C0+E+1/120: REM ROUND OFF
  77. 390 H3=INT(T3): M3=INT((T3-H3)*60)
  78. 395 PRINT USING "##:##";H3;M3;
  79. 400 H7=H0+E*(H2-H0)
  80. 405 N7=-COS(D1)*SIN(H7)
  81. 410 D7=C*SIN(D1)-S*COS(D1)*COS(H7)
  82. 415 A7=ATN(N7/D7)/R1
  83. 420 IF D7<0 THEN A7=A7+180
  84. 425 IF A7<0 THEN A7=A7+360
  85. 430 IF A7>360 THEN A7=A7-360
  86. 435 PRINT USING ", AZ ###.#";A7
  87. 440 RETURN
  88. 445 REM
  89. 450 REM SPECIAL MESSAGE ROUTINE
  90. 455 IF M8=0 AND W8=0 THEN 475
  91. 460 IF M8=0 THEN PRINT M1$
  92. 465 IF W8=0 THEN PRINT M2$
  93. 470 GOTO 485
  94. 475 IF V2<0 THEN PRINT M3$
  95. 480 IF V2>0 THEN PRINT M4$
  96. 485 RETURN
  97. 490 REM
  98. 495 REM FUNDAMENTAL ARGUMENTS
  99. 500 L=0.606434+0.03660110129*T
  100. 505 M=0.374897+0.03629164709*T
  101. 510 F=0.259091+0.03674819520*T
  102. 515 D=0.827362+0.03386319198*T
  103. 520 N=0.347343-0.00014709391*T
  104. 525 G=0.993126+0.00273777850*T
  105. 530 L=L-INT(L): M=M-INT(M)
  106. 535 F=F-INT(F): D=D-INT(D)
  107. 540 N=N-INT(N): G=G-INT(G)
  108. 545 L=L*P2: M=M*P2: F=F*P2
  109. 550 D=D*P2: N=N*P2: G=G*P2
  110. 555 V=0.39558*SIN(F+N)
  111. 560 V=V+0.08200*SIN(F)
  112. 565 V=V+0.03257*SIN(M-F-N)
  113. 570 V=V+0.01092*SIN(M+F+N)
  114. 575 V=V+0.00666*SIN(M-F)
  115. 580 V=V-0.00644*SIN(M+F-2*D+N)
  116. 585 V=V-0.00331*SIN(F-2*D+N)
  117. 590 V=V-0.00304*SIN(F-2*D)
  118. 595 V=V-0.00240*SIN(M-F-2*D-N)
  119. 600 V=V+0.00226*SIN(M+F)
  120. 605 V=V-0.00108*SIN(M+F-2*D)
  121. 610 V=V-0.00079*SIN(F-N)
  122. 615 V=V+0.00078*SIN(F+2*D+N)
  123. 620 U=1-0.10828*COS(M)
  124. 625 U=U-0.01880*COS(M-2*D)
  125. 630 U=U-0.01479*COS(2*D)
  126. 635 U=U+0.00181*COS(2*M-2*D)
  127. 640 U=U-0.00147*COS(2*M)
  128. 645 U=U-0.00105*COS(2*D-G)
  129. 650 U=U-0.00075*COS(M-2*D+G)
  130. 655 W=0.10478*SIN(M)
  131. 660 W=W-0.04105*SIN(2*F+2*N)
  132. 665 W=W-0.02130*SIN(M-2*D)
  133. 670 W=W-0.01779*SIN(2*F+N)
  134. 675 W=W+0.01774*SIN(N)
  135. 680 W=W+0.00987*SIN(2*D)
  136. 685 W=W-0.00338*SIN(M-2*F-2*N)
  137. 690 W=W-0.00309*SIN(G)
  138. 695 W=W-0.00190*SIN(2*F)
  139. 700 W=W-0.00144*SIN(M+N)
  140. 705 W=W-0.00144*SIN(M-2*F-N)
  141. 710 W=W-0.00113*SIN(M+2*F+2*N)
  142. 715 W=W-0.00094*SIN(M-2*D+G)
  143. 720 W=W-0.00092*SIN(2*M-2*D)
  144. 725 REM
  145. 730 REM COMPUTE RA, DEC, DIST
  146. 735 S=W/SQR(U-V*V)
  147. 740 A5=L+ATN(S/SQR(1-S*S))
  148. 745 S=V/SQR(U):D5=ATN(S/SQR(1-S*S))
  149. 750 R5=60.40974*SQR(U)
  150. 755 RETURN
  151. 760 REM CALENDAR --> JD
  152. 765 INPUT "Y,M,D ";Y,M,D
  153. 770 G=1: IF Y<1582 THEN G=0
  154. 775 D1=INT(D): F=D-D1-0.5
  155. 780 J=-INT(7*(INT((M+9)/12)+Y)/4)
  156. 785 IF G=0 THEN 805
  157. 790 S=SGN(M-9): A=ABS(M-9)
  158. 795 J3=INT(Y+S*INT(A/7))
  159. 800 J3=-INT((INT(J3/100)+1)*3/4)
  160. 805 J=J+INT(275*M/9)+D1+G*J3
  161. 810 J=J+1721027+2*G+367*Y
  162. 815 IF F>=0 THEN 825
  163. 820 F=F+1: J=J-1
  164. 825 RETURN
  165. 900 REM ***************************
  166. 910 REM THIS PROGRAM COMPUTES THE
  167. 920 REM TIMES OF MOONRISE AND MOON-
  168. 930 REM SET ANYWHERE IN THE WORLD.
  169. 940 REM FROM SKY & TELESCOPE, JULY,
  170. 950 REM 1989, PAGE 78.
  171. 960 REM ***************************