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.
 
 
 
 
 
 

137 lines
5.0 KiB

  1. 10 ' RINGS OF SATURN
  2. 20 DEFDBL A-Z
  3. 30 CLS ' : PI=4 *ATN(1 ):
  4. 35 RD=PI/180 : DL=9
  5. 40 INPUT "Year of interest"; Y
  6. 50 A=INT((Y-1 )/100 ): B=2 -A+INT(A/4 )
  7. 60 IF Y<1583 THEN B=0
  8. 70 JD=INT(365.25*(Y+4715))+INT(30.6001*(14))
  9. 80 JD=JD+B-1523.5
  10. 90 JE=JD+365
  11. 100 T=(JD-2451545 )/365250
  12. 110 I=(28.04922 -.13 *T+.0004 *T*T)*RD
  13. 120 OM=(169.53 +13.826 *T+.04 *T*T)*RD
  14. 130 GOSUB 550: ' Get planet positions
  15. 140 X=SR*COS(SB)*COS(SL)-ER*COS(EL)
  16. 150 Y=SR*COS(SB)*SIN(SL)-ER*SIN(EL)
  17. 160 Z=SR*SIN(SB)-ER*SIN(EB)
  18. 170 DL=SQR(X*X+Y*Y+Z*Z)
  19. 180 LA=ATN(Y/X): IF X<0 THEN LA=LA+PI
  20. 190 BE=ATN(Z/SQR(X*X+Y*Y))
  21. 200 S=SIN(I)*COS(BE)*SIN(LA-OM)-COS(I)*SIN(BE)
  22. 210 B=ATN(S/SQR(1 -S*S))
  23. 220 SP=SIN(I)*COS(SB)*SIN(SL-OM)-COS(I)*SIN(SB)
  24. 230 BP=ATN(SP/SQR(1 -SP*SP))
  25. 240 ' Check for crossing of ring plane
  26. 250 IF B*XB>=0 THEN GOTO 280
  27. 260 N$="(N to S)": IF B>0 THEN N$="(S to N)"
  28. 270 PRINT "< Earth crosses ring plane "; N$; " >"
  29. 280 IF BP*XP>=0 THEN GOTO 310
  30. 290 N$="(N to S)": IF BP>0 THEN N$="(S to N)"
  31. 300 PRINT "< Sun crosses ring plane "; N$; " >"
  32. 310 Z=INT(JD+1): AL=INT((Z-1867216.25 )/36524.25 )
  33. 320 AJ=Z+1 +AL-INT(AL/4 ): IF Z<2299161 THEN AJ=Z
  34. 330 BJ=AJ+1524: CJ=INT((BJ-122.1)/365.25)
  35. 340 DJ=INT(365.25 *CJ): EJ=INT((BJ-DJ)/30.6001)
  36. 350 D=BJ-DJ-INT(30.6001*EJ)
  37. 360 M=EJ-1: IF EJ>13.5 THEN M=M-12
  38. 370 Y=CJ-4715: IF M>2 THEN Y=Y-1
  39. 380 PRINT USING "## ## #####"; M; D; Y;
  40. 390 PRINT USING " B =###.## deg"; B/RD;
  41. 400 PRINT USING " B'=###.## deg"; BP/RD;
  42. 440 '
  43. 450 CI=(SR^2+DL^2-ER^2)/(2*SR*DL)
  44. 460 ID=ATN(SQR(1-CI*CI)/CI)/RD
  45. 470 MV=-8.88+5*LOG(SR*DL)/LOG(10)
  46. 480 MV=MV+.044*ID-2.6*ABS(S)+1.25*S*S
  47. 490 PRINT USING " Mv =##.#"; MV
  48. 500 IF B*XB<0 THEN WHILE INKEY$="": WEND
  49. 510 IF BP*XP<0 THEN WHILE INKEY$="": WEND
  50. 520 JD=JD+1 : XB=B: XP=BP
  51. 530 IF JD<=JE THEN GOTO 100
  52. 540 END
  53. 550 ' Calculate position of Earth
  54. 560 L0=175347046
  55. 570 L0=L0+3341656 *COS(4.66926+6283.07585 *T)
  56. 580 L0=L0+34894 *COS(4.6261+12566.1517 *T)
  57. 590 L1=628331966747
  58. 600 L1=L1+206059 *COS(2.67824+6283.07585 *T)
  59. 610 L2=52919
  60. 620 EL=(L0+L1*T+L2*T*T)/(1E+08): EB=0
  61. 630 R0=100013989
  62. 640 R0=R0+1670700 *COS(3.09846+6283.07585 *T)
  63. 650 R0=R0+13956 *COS(3.05525+12566.1517 *T)
  64. 660 R1=103019 *COS(1.10749+6283.07585 *T)
  65. 670 R2=4359 *COS(5.7846+6283.0758 *T)
  66. 680 ER=(R0+R1*T+R2*T*T)/(1E+08)
  67. 690 ' Calculate position of Saturn
  68. 700 T=T-(.00578 *DL)/365250
  69. 710 L0=87401354
  70. 720 L0=L0+11107660 *COS(3.96205+213.2991 *T)
  71. 730 L0=L0+1414151 *COS(4.58582+7.11355*T)
  72. 740 L0=L0+398379 *COS(.52112+206.18555 *T)
  73. 750 L0=L0+350769 *COS(3.3033+426.598191 *T)
  74. 760 L0=L0+206816 *COS(.24658+103.09277 *T)
  75. 770 L0=L0+79271 *COS(3.84007+220.41264 *T)
  76. 780 L0=L0+23990*COS(4.66977+110.20632 *T)
  77. 790 L0=L0+16574*COS(.43719+419.48464 *T)
  78. 800 L0=L0+15820*COS(.93809+632.78374 *T)
  79. 810 L0=L0+15054*COS(2.7167+639.89729 *T)
  80. 820 L0=L0+14907*COS(5.76903+316.39187 *T)
  81. 830 L0=L0+14610*COS(1.56519+3.93215*T)
  82. 840 L0=L0+13160*COS(4.44891+14.22709*T)
  83. 850 L0=L0+13005*COS(5.98119+11.0457*T)
  84. 860 L0=L0+10725*COS(3.1294+202.2534*T)
  85. 870 L1=21354295596
  86. 880 L1=L1+1296855 *COS(1.82821+213.2991 *T)
  87. 890 L1=L1+564348 *COS(2.885+7.11355*T)
  88. 900 L1=L1+107679 *COS(2.2777+206.18555 *T)
  89. 910 L1=L1+98323 *COS(1.0807+426.59819 *T)
  90. 920 L1=L1+40255 *COS(2.04128+220.41264 *T)
  91. 930 L2=116441 *COS(1.17988+7.11355*T)
  92. 940 L2=L2+91921 *COS(.07425+213.2991*T)
  93. 950 L2=L2+90592
  94. 960 L2=L2+15277*COS(4.06492+206.18555 *T)
  95. 970 L3=16039*COS(5.73945+7.11355*T)
  96. 980 L4=1662*COS(3.9983+7.1135*T)
  97. 990 SL=(L0+L1*T+L2*T*T+L3*T^3+L4*T^4)/(1E+08)
  98. 1000 B0=4330678 *COS(3.60284+213.2991 *T)
  99. 1010 B0=B0+240348 *COS(2.85238+426.59819 *T)
  100. 1020 B0=B0+84746
  101. 1030 B0=B0+34116 *COS(.57297+206.18555 *T)
  102. 1040 B0=B0+30863*COS(3.48442+220.41264 *T)
  103. 1050 B0=B0+14734*COS(2.11847+639.89729 *T)
  104. 1060 B0=B0+9917*COS(5.79+419.4846*T)
  105. 1070 B0=B0+6994*COS(4.736+7.1135*T)
  106. 1080 B1=397555 *COS(5.3329+213.2991 *T)
  107. 1090 B1=B1+49479 *COS(3.14159)
  108. 1100 B1=B1+18572*COS(6.09919+426.59819 *T)
  109. 1110 B1=B1+14801*COS(2.30586+206.18555 *T)
  110. 1120 B1=B1+9644*COS(1.6967+220.4126*T)
  111. 1130 B2=20630*COS(.50482+213.2991*T)
  112. 1140 SB=(B0+B1*T+B2*T*T)/(1E+08)
  113. 1150 R0=955758136
  114. 1160 R0=R0+52921382 *COS(2.39226+213.2991 *T)
  115. 1170 R0=R0+1873680 *COS(5.2355+206.18555 *T)
  116. 1180 R0=R0+1464664 *COS(1.64763+426.59819 *T)
  117. 1190 R0=R0+821891 *COS(5.9352+316.39187 *T)
  118. 1200 R0=R0+547507 *COS(5.01533+103.09277 *T)
  119. 1210 R0=R0+371684 *COS(2.27115+220.41264 *T)
  120. 1220 R0=R0+361778 *COS(3.13904+7.11355*T)
  121. 1230 R1=6182981 *COS(.25844+213.2991 *T)
  122. 1240 R1=R1+506578 *COS(.71115+206.18555 *T)
  123. 1250 R1=R1+341394 *COS(5.79636+426.59819 *T)
  124. 1260 R2=436902 *COS(4.78672+213.2991 *T)
  125. 1270 R3=20315*COS(3.02187+213.2991*T)
  126. 1280 SR=(R0+R1*T+R2*T*T+R3*T^3)/(1E+08)
  127. 1290 RETURN
  128. 1300 '
  129. 1310 ' This program by Donald W. Olson, Russell L. Doescher, and
  130. 1320 ' Jonathan Gallmeier appeared in an article titled "The Rings
  131. 1330 ' of Saturn" in Sky & Telescope for May 1995, pages 92-95.
  132. 1340 ' It computes the tilt of the rings as seen from the Earth (B)
  133. 1350 ' and the Sun (B'). The program pauses when ring-plane crossings
  134. 1360 ' occur. It also computes the apparent visual magnitude of
  135. 1370 ' Saturn (Mv), a quantity that depends strongly on the amount
  136. 1380 ' of ring tilt on a given date. Valid for at least 2,000 years.