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.
 
 
 
 
 
 

110 lines
3.6 KiB

  1. 10 REM LOCAL CIRCUMSTANCES OF A
  2. 20 REM SOLAR ECLIPSE
  3. 30 REM
  4. 40 DEFDBL A-Z
  5. 50 GOSUB 760: PRINT D$: PRINT
  6. 60 GOSUB 630
  7. 70 INPUT "Universal time (h,m)";HH,MM
  8. 80 IF HH=99 THEN 110
  9. 90 UT=HH+MM/60: REM UT in hours
  10. 100 GOSUB 140: GOTO 70
  11. 110 END
  12. 120 REM **** SUBROUTINES ****
  13. 130 REM
  14. 140 REM Compute details at time UT
  15. 150 T=UT+DT/3600-T0: REM "Element time"
  16. 160 X=FNX(T): REM x
  17. 170 Y=FNY(T): REM y
  18. 180 CD=FNC(T): REM cos(d)
  19. 190 SD=FNS(T): REM sin(d)
  20. 200 M=DR*FNM(T): REM mu
  21. 210 REM
  22. 220 REM Now find H.A. in radians
  23. 230 H=M+LO-DT/13713
  24. 240 REM
  25. 250 REM Now find xi, eta, zeta
  26. 260 X8=P9*SIN(H)
  27. 270 Y8=P8*CD-P9*SD*COS(H)
  28. 280 Z8=P8*SD+P9*CD*COS(H)
  29. 290 U0=X-X8: REM u
  30. 300 V0=Y-Y8: REM v
  31. 310 L1=FNL1(T): REM l1
  32. 320 L2=FNL2(T): REM l2
  33. 330 W1=L1-Z8*F1: REM L1
  34. 340 W2=L2-Z8*F2: REM L2
  35. 350 REM
  36. 360 REM Magnitude
  37. 370 G1=SQR(U0*U0+V0*V0)
  38. 380 G=(W1-G1)/(W1+W2)
  39. 390 REM
  40. 400 REM Position angle
  41. 410 PA=RD*ATN(U0/V0)
  42. 420 IF V0<0 THEN PA=PA+180
  43. 430 IF PA<0 THEN PA=PA+360
  44. 440 IF PA>360 THEN PA=PA-360
  45. 450 REM
  46. 460 REM Sun's altitude
  47. 470 A8=SD*SIN(LA)
  48. 480 A8=A8+CD*COS(LA)*COS(H)
  49. 490 AL=RD*ATN(A8/SQR(1-A8*A8))
  50. 500 REM
  51. 505 REM
  52. 510 REM Print out a line of data
  53. 520 REM
  54. 530 UT=T-DT/3600+T0: REM "Element time" back to UT
  55. 540 UT=UT+.5/3600: REM Round to whole second
  56. 550 HH=INT(UT): M3=60*(UT-HH): MM=INT(M3)
  57. 560 SS=INT(60*(M3-MM))
  58. 570 PA=INT(PA+.5): AR=INT(AL+.5): REM Whole degrees
  59. 580 IF AL<0 THEN PRINT "Sun below horizon": GOTO 610
  60. 590 IF G<0 THEN PRINT "No eclipse at this time": GOTO 610
  61. 600 PRINT USING A2$;HH;MM;SS;PA;AR;G
  62. 610 RETURN
  63. 620 REM
  64. 630 REM Geocentric Coordinates of Observer
  65. 640 REM
  66. 650 INPUT "North latitude (deg) ";LA
  67. 660 INPUT "East longitude (deg) ";LO
  68. 670 INPUT "Elevation (feet) ";EL
  69. 680 LA=LA*DR: LO=LO*DR: REM Lat, long in radians
  70. 690 EL=EL*12/39.37: REM Elevation in meters
  71. 700 U=ATN(.99664719#*TAN(LA))
  72. 710 P8=.99664719#*SIN(U)+EL*SIN(LA)/6378140#
  73. 720 P9=COS(U)+EL*COS(LA)/6378140#
  74. 730 REM P8 = rho sin(phi'); P9 = rho cos(phi')
  75. 740 RETURN
  76. 750 REM
  77. 760 REM Constants
  78. 770 ' PI=3.141592653589793#:
  79. 775 DR=PI/180: RD=1/DR
  80. 780 A2$=" UT ##:##:## PA ### Alt ### Mag #.###"
  81. 790 REM
  82. 800 REM
  83. 810 REM Eclipse elements
  84. 820 D$="Total Solar Eclipse of July 11, 1991"
  85. 830 T0=16: REM Reference time (hr)
  86. 840 DT=0: REM Delta-T (sec) in sense ET-UT
  87. 850 DEF FNX(T)=-1.75954169#+T*(+.56710171#+T*(+4.902E-05-T*9.60E-06))
  88. 860 DEF FNY(T)=+.42232901#+T*(-.13699808#+T*(-1.7527E-04+T*.0000025))
  89. 870 DEF FNS(T)=+.37643393#+T*(-8.389E-05+T*(-.0000001))
  90. 880 DEF FNC(T)=+.92644352#+T*(+3.404E-05+T*(+4E-08))
  91. 890 DEF FNM(T)=58.6389581#+T*(15.0000486#+T*(+1.65E-06-T*2E-08))
  92. 900 DEF FNL1(T)=.53024501#+T*(+1.0153E-04+T*(-1.278E-05))
  93. 910 DEF FNL2(T)=-.01606+T*(.000101+T*(-1.272E-05))
  94. 920 F1=.004599: REM tan(f1)
  95. 930 F2=.004576: REM tan(f2)
  96. 940 M1=.2618: REM mu' (radians/hr)
  97. 950 D1=-.000091: REM d' (radians/hr)
  98. 960 RETURN
  99. 1000 REM For the partial and total phases of the July 11, 1991,
  100. 1010 REM solar eclipse, when you enter a series of Universal times,
  101. 1020 REM this program computes the position angle of the Moon's
  102. 1030 REM center from the Sun, the Sun's altitude, and the "magnitude"
  103. 1040 REM of the eclipse (that is, the fraction of the solar disk
  104. 1050 REM diameter that is hidden). When entering your longitude and
  105. 1060 REM longitude, use positive degrees for north latitude and
  106. 1070 REM *negative* degrees for west longitude. The results of this
  107. 1080 REM program agree exactly with those published by the U. S. Naval
  108. 1090 REM Observatory in its eclipse circular. The program was written
  109. 1100 REM by Roger W. Sinnott.