home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 50 / 050.d81 / astro-calc (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  16KB  |  487 lines

  1. 5 ifaz=0thenaz=1:load"dr",8,1
  2. 10 goto60
  3. 15 print"[147]";:poke53281,3:poke53280,3
  4. 20 l=len(f$):b=951:pokeb,l+2:pokeb+l+1,44:pokeb+l+2,80
  5. 25 fori=0tol-1:pokeb+i+1,asc(mid$(f$,i+1,1)):next:poke909,1
  6. 30 sys828:poke198,0:fz=0
  7. 35 poke214,23:print:iffq=0thenprint"[144]    [208]ress [211][208][193][195][197][146] to return to menu[145]":goto45
  8. 40 print"[144]  [211][208][193][195][197][146] for more     [210][197][212][213][210][206][146] for menu[145]"
  9. 45 geta$:ifa$<>" "anda$<>chr$(13)then45
  10. 50 ifa$=chr$(13)thenfz=1
  11. 55 return
  12. 60 def fna(x)=sgn(x)*(int(abs(x))+(abs(x)-int(abs(x)))*100/60):pi=3.14159265
  13. 65 dimjd$(22),m1$(13),m2$(13):deffns(x)=sin(pi/180*x)
  14. 70 deffnm(x)=x-(int(x/360)*360):deffne(x)=pi/180*x:deffnc(x)=180/pi*x
  15. 75 data"1.00","100.00","200.00","300.01","400.01","500.02","600.03","700.04"
  16. 80 data"800.04","900.05","1000.06",1100.07",1200.07","1300.08","1400.09"
  17. 85 data"1500.10","1600.10","1700.11","1800.12","1900.13","2000.13","2100.14"
  18. 90 fori=1to22:readjd$(i):next
  19. 95 data"jan000031","feb031059","mar059090","apr090120","may120151","jun151181"
  20. 100 data"jul181212","aug212243","sep243273","oct273304","nov304334","dec334365"
  21. 105 fori=1to12:readm1$(i):next
  22. 110 data"jan000031","feb031060","mar060091","apr091121",may"121152","jun152182"
  23. 115 data"jul182213","aug213244","sep244274","oct274305","nov305335","dec335366"
  24. 120 fori=1to12:readm2$(i):next
  25. 125 data"ast04","est05","cst06","mst07","pst08","yst09","aht10","bst11"
  26. 130 fori=1to8:readtz$(i):next
  27. 135 hg$=chr$(142)+"[147][149]           a s t r o - c a l c"
  28. 140 hh$="   [207][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][208]"
  29. 145 hi$="   [180]                                [170]"
  30. 150 hj$="   [204][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][186]"
  31. 155 cr$=""
  32. 160 sp$="                                       "
  33. 165 cd$=""
  34. 170 hp$= "             select a number[145]"
  35. 175 print"[147]":printchr$(142)
  36. 180 poke53280,15:poke53281,15:print"[142]"chr$(144)
  37. 185 printhg$
  38. 190 print"               [144] main menu "
  39. 195 printhh$
  40. 200 print"   [180]       [144]1[146] instructions           [170]"
  41. 205 printhi$
  42. 210 print"   [180]       [144]2[146] math for degrees       [170]"
  43. 215 printhi$
  44. 220 print"   [180]       [144]3[146] time conversions       [170]"
  45. 225 printhi$
  46. 230 print"   [180]       [144]4[146] useful formulas        [170]"
  47. 235 printhi$
  48. 240 print"   [180]       [144]5[146] quit                   [170]"
  49. 245 printhj$:printhp$
  50. 250 getg$:ifg$=""then250
  51. 255 ifval(g$)<1orval(g$)>5then250
  52. 260 onval(g$)goto265,270,365,500,2390
  53. 265 f$="mm 1":fq=0:gosub15:goto180
  54. 270 poke53280,15:poke53281,15:printhg$
  55. 275 print"           [144] math for degrees "
  56. 280 printhh$
  57. 285 print"   [180] [144]1[146] instructions                 [170]"
  58. 290 printhi$
  59. 295 print"   [180] [144]2[146] degrees dec > degrees,min,sec[170]"
  60. 300 printhi$
  61. 305 print"   [180] [144]3[146] degrees,min,sec > degrees dec[170]"
  62. 310 printhi$
  63. 315 print"   [180] [144]4[146] degree calculator            [170]"
  64. 320 printhi$
  65. 325 print"   [180] [144]5[146] main menu                    [170]"
  66. 330 printhj$
  67. 335 printhp$
  68. 340 getg$:ifg$=""then340
  69. 345 ifval(g$)<1orval(g$)>5then340
  70. 350 print"[147]":printchr$(31):onval(g$)goto355,610,650,680,185
  71. 355 f$="md 1":fq=0:gosub15
  72. 360 goto270
  73. 365 poke53280,15:poke53281,15:printhg$
  74. 370 print"           [144] time conversions [146][145]"
  75. 375 printhh$
  76. 380 printhi$
  77. 385 print"   [180] [144]1[146] instructions                 [170]"
  78. 390 printhi$
  79. 395 print"   [180] [144]2[146] local mean time > g.m.t.     [170]"
  80. 400 printhi$
  81. 405 print"   [180] [144]3[146] sidereal time of date        [170]"
  82. 410 printhi$
  83. 415 print"   [180] [144]4[146] julian day # > date          [170]"
  84. 420 printhi$
  85. 425 print"   [180] [144]5[146] date > julian day #          [170]"
  86. 430 printhi$
  87. 435 print"   [180] [144]6[146] julian > gregorian calendar  [170]"
  88. 440 printhi$
  89. 445 print"   [180] [144]7[146] main menu                    [170]"
  90. 450 printhj$
  91. 455 printhp$
  92. 460 getg$:ifg$=""then460
  93. 465 ifval(g$)<1orval(g$)>7then460
  94. 470 onval(g$)goto475,735,820,870,925,985,180
  95. 475 f$="tc 1":fq=1:gosub15:iffzthen365
  96. 480 f$="tc 2":gosub15:iffzthen365
  97. 485 f$="tc 3":gosub15:iffzthen365
  98. 490 f$="tc 4":fq=0:gosub15
  99. 495 goto365
  100. 500 poke53280,15:poke53281,15:printhg$
  101. 505 print"            [144] useful formulas "
  102. 510 printhh$
  103. 515 print"   [180]      [144]1[146] instructions            [170]"
  104. 520 printhi$
  105. 525 print"   [180]      [144]2[146] synetic vernal point    [170]"
  106. 530 printhi$
  107. 535 print"   [180]      [144]3[146] geog > geoc latitude    [170]"
  108. 540 printhi$
  109. 545 print"   [180]      [144]4[146] interpolation           [170]"
  110. 550 printhi$
  111. 555 print"   [180]      [144]5[146] main menu               [170]"
  112. 560 printhj$
  113. 565 printhp$
  114. 570 getg$:ifg$=""then570
  115. 575 ifval(g$)<1orval(g$)>5then570
  116. 580 onval(g$)goto585,1050,1125,1165,180
  117. 585 f$="uf 1":fq=1:gosub15:iffzthen500
  118. 590 f$="uf 2":gosub15:iffzthen500
  119. 595 f$="uf 3":fq=0:gosub15
  120. 600 goto500
  121. 605 rem convert deg dec to d,m,s
  122. 610 print"[147][144]  this routine converts degrees decimal"
  123. 615 print"to degrees, minutes and seconds."
  124. 620 print"    enter degrees decimal ";:ln=12:nu=2:gosub1930
  125. 625 a=val(g$):gosub1330:gosub1355
  126. 630 print"               ";h$+"d";m$+"m";s$+"s":gosub1375
  127. 635 ifg$="m"then270
  128. 640 ifg$="a"then610
  129. 645 rem convert d,m,s to deg dec
  130. 650 print"[147][144] this routine converts degrees, minutes"
  131. 655 print" and seconds to degrees decimal"
  132. 660 print" ";:gosub1995:gosub2040
  133. 665 print"         ";h;" degrees":gosub1375
  134. 670 ifg$="a"then650
  135. 675 ifg$="m"then270
  136. 680 print"[147]            degree calculator [146]"
  137. 685 print"           [207][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][208]"
  138. 690 print"           [180]                 [170]"
  139. 695 print"           [204][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][186]":sh$=""
  140. 700 print"[144]";:gosub1995
  141. 705 print"":gosub2040:a=h:t=a
  142. 710 ifsgn(h)=-1thensh$="[192]"
  143. 715 gosub1330:gosub1670:gosub1695:gosub1685
  144. 720 ifsh$="[192]"thena=a*-1
  145. 725 goto1700
  146. 730 me=c:gosub1685:sh$="":goto1700
  147. 735 rem lmt to gmt
  148. 740 print"[147]":gosub2180
  149. 745 print"         enter local mean time":print"          ";:gosub2060
  150. 750 printtab(15)"1[146] am":printtab(15)"2[146] pm":printtab(15)"3[146] noon"
  151. 755 printtab(15)"4[146] midnight"
  152. 760 gosub2095:poke214,10:print:fori=0to4:printsp$:next
  153. 765 r%=4:d%=13:gosub1655:print"enter the longitude of the place"
  154. 770 printtab(9)"";:gosub2125:b=h:ifh<0thenb%=1
  155. 775 c=b*4/60:ifb<0anda<abs(c)thena=a+24:c$=" (one day earlier)":a=a+c:goto785
  156. 780 a=a+c:c$=" (the same day)":ifa>=24thena=a-24:c$=" (one day later)"
  157. 785 ap$=" am":ifa=12thenap$=" noon"
  158. 790 ifa>12thena=a-12:ap$=" pm"
  159. 795 ifa=0thena=12:ap$=" mid"
  160. 800 gosub1330:gosub1355
  161. 805 print"    ";" gmt = [151]";h$+":";m$;ap$;c$:gosub1375
  162. 810 ifg$="a"then735
  163. 815 ifg$="m"then365
  164. 820 rem sidereal time for a date
  165. 825 print"[147]":gosub2145:gosub2165
  166. 830 ify<1583thengosub1855:goto820
  167. 835 gosub1420:jd=jd+.5
  168. 840 x=jd/365.2421988:y=x-int(x):z=y+.67128:a=z*24:a=a-12.03285
  169. 845 ifa>=24thena=a-24
  170. 850 gosub1330:gosub1355:printtab(7)"siderial time = "+h$+"h";m$+"m";s$+"s"
  171. 855 gosub1375
  172. 860 ifg$="m"then365
  173. 865 ifg$="a"then820
  174. 870 rem julian day # to a date
  175. 875 print"[147]":gosub2195
  176. 880 print"    enter julian day number  ";:nu=2:ln=7:gosub1930:jd=val(g$)
  177. 885 print"    date =";:z%=0
  178. 890 ifz%=0thengosub1555:e=abs(y):gosub1475:jd=jd+u:z%=1:gosub1555
  179. 895 ifjd>2488082thenwp%=2:goto1615
  180. 900 co$=",":y$=str$(abs(y)):da$=str$(da):s$="[157]":da$=da$+co$+   y$
  181. 905 print" ";mo$;da$;bc$;"  (new style)"
  182. 910 gosub1375
  183. 915 ifg$="m"then365
  184. 920 ifg$="a"then870
  185. 925 rem date to julian day #
  186. 930 print"[147]":gosub2210:printtab(13)"enter the date":print"[145][145]";:gosub2165:
  187. 935 wp%=0
  188. 940 ca$="n":gosub2225:ify>2099andbc$<>"b"thenwp%=1:goto1615
  189. 945 ify>4713andbc$="b"thenwp%=1:goto2250
  190. 950 gosub15