home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 50
/
050.d81
/
astro-calc
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
16KB
|
487 lines
5 ifaz=0thenaz=1:load"dr",8,1
10 goto60
15 print"[147]";:poke53281,3:poke53280,3
20 l=len(f$):b=951:pokeb,l+2:pokeb+l+1,44:pokeb+l+2,80
25 fori=0tol-1:pokeb+i+1,asc(mid$(f$,i+1,1)):next:poke909,1
30 sys828:poke198,0:fz=0
35 poke214,23:print:iffq=0thenprint"[144] [208]ress [211][208][193][195][197][146] to return to menu[145]":goto45
40 print"[144] [211][208][193][195][197][146] for more [210][197][212][213][210][206][146] for menu[145]"
45 geta$:ifa$<>" "anda$<>chr$(13)then45
50 ifa$=chr$(13)thenfz=1
55 return
60 def fna(x)=sgn(x)*(int(abs(x))+(abs(x)-int(abs(x)))*100/60):pi=3.14159265
65 dimjd$(22),m1$(13),m2$(13):deffns(x)=sin(pi/180*x)
70 deffnm(x)=x-(int(x/360)*360):deffne(x)=pi/180*x:deffnc(x)=180/pi*x
75 data"1.00","100.00","200.00","300.01","400.01","500.02","600.03","700.04"
80 data"800.04","900.05","1000.06",1100.07",1200.07","1300.08","1400.09"
85 data"1500.10","1600.10","1700.11","1800.12","1900.13","2000.13","2100.14"
90 fori=1to22:readjd$(i):next
95 data"jan000031","feb031059","mar059090","apr090120","may120151","jun151181"
100 data"jul181212","aug212243","sep243273","oct273304","nov304334","dec334365"
105 fori=1to12:readm1$(i):next
110 data"jan000031","feb031060","mar060091","apr091121",may"121152","jun152182"
115 data"jul182213","aug213244","sep244274","oct274305","nov305335","dec335366"
120 fori=1to12:readm2$(i):next
125 data"ast04","est05","cst06","mst07","pst08","yst09","aht10","bst11"
130 fori=1to8:readtz$(i):next
135 hg$=chr$(142)+"[147][149] a s t r o - c a l c"
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]"
145 hi$=" [180] [170]"
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]"
155 cr$=""
160 sp$=" "
165 cd$=""
170 hp$= " select a number[145]"
175 print"[147]":printchr$(142)
180 poke53280,15:poke53281,15:print"[142]"chr$(144)
185 printhg$
190 print" [144] main menu "
195 printhh$
200 print" [180] [144]1[146] instructions [170]"
205 printhi$
210 print" [180] [144]2[146] math for degrees [170]"
215 printhi$
220 print" [180] [144]3[146] time conversions [170]"
225 printhi$
230 print" [180] [144]4[146] useful formulas [170]"
235 printhi$
240 print" [180] [144]5[146] quit [170]"
245 printhj$:printhp$
250 getg$:ifg$=""then250
255 ifval(g$)<1orval(g$)>5then250
260 onval(g$)goto265,270,365,500,2390
265 f$="mm 1":fq=0:gosub15:goto180
270 poke53280,15:poke53281,15:printhg$
275 print" [144] math for degrees "
280 printhh$
285 print" [180] [144]1[146] instructions [170]"
290 printhi$
295 print" [180] [144]2[146] degrees dec > degrees,min,sec[170]"
300 printhi$
305 print" [180] [144]3[146] degrees,min,sec > degrees dec[170]"
310 printhi$
315 print" [180] [144]4[146] degree calculator [170]"
320 printhi$
325 print" [180] [144]5[146] main menu [170]"
330 printhj$
335 printhp$
340 getg$:ifg$=""then340
345 ifval(g$)<1orval(g$)>5then340
350 print"[147]":printchr$(31):onval(g$)goto355,610,650,680,185
355 f$="md 1":fq=0:gosub15
360 goto270
365 poke53280,15:poke53281,15:printhg$
370 print" [144] time conversions [146][145]"
375 printhh$
380 printhi$
385 print" [180] [144]1[146] instructions [170]"
390 printhi$
395 print" [180] [144]2[146] local mean time > g.m.t. [170]"
400 printhi$
405 print" [180] [144]3[146] sidereal time of date [170]"
410 printhi$
415 print" [180] [144]4[146] julian day # > date [170]"
420 printhi$
425 print" [180] [144]5[146] date > julian day # [170]"
430 printhi$
435 print" [180] [144]6[146] julian > gregorian calendar [170]"
440 printhi$
445 print" [180] [144]7[146] main menu [170]"
450 printhj$
455 printhp$
460 getg$:ifg$=""then460
465 ifval(g$)<1orval(g$)>7then460
470 onval(g$)goto475,735,820,870,925,985,180
475 f$="tc 1":fq=1:gosub15:iffzthen365
480 f$="tc 2":gosub15:iffzthen365
485 f$="tc 3":gosub15:iffzthen365
490 f$="tc 4":fq=0:gosub15
495 goto365
500 poke53280,15:poke53281,15:printhg$
505 print" [144] useful formulas "
510 printhh$
515 print" [180] [144]1[146] instructions [170]"
520 printhi$
525 print" [180] [144]2[146] synetic vernal point [170]"
530 printhi$
535 print" [180] [144]3[146] geog > geoc latitude [170]"
540 printhi$
545 print" [180] [144]4[146] interpolation [170]"
550 printhi$
555 print" [180] [144]5[146] main menu [170]"
560 printhj$
565 printhp$
570 getg$:ifg$=""then570
575 ifval(g$)<1orval(g$)>5then570
580 onval(g$)goto585,1050,1125,1165,180
585 f$="uf 1":fq=1:gosub15:iffzthen500
590 f$="uf 2":gosub15:iffzthen500
595 f$="uf 3":fq=0:gosub15
600 goto500
605 rem convert deg dec to d,m,s
610 print"[147][144] this routine converts degrees decimal"
615 print"to degrees, minutes and seconds."
620 print" enter degrees decimal ";:ln=12:nu=2:gosub1930
625 a=val(g$):gosub1330:gosub1355
630 print" ";h$+"d";m$+"m";s$+"s":gosub1375
635 ifg$="m"then270
640 ifg$="a"then610
645 rem convert d,m,s to deg dec
650 print"[147][144] this routine converts degrees, minutes"
655 print" and seconds to degrees decimal"
660 print" ";:gosub1995:gosub2040
665 print" ";h;" degrees":gosub1375
670 ifg$="a"then650
675 ifg$="m"then270
680 print"[147] degree calculator [146]"
685 print" [207][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][208]"
690 print" [180] [170]"
695 print" [204][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][186]":sh$=""
700 print"[144]";:gosub1995
705 print"":gosub2040:a=h:t=a
710 ifsgn(h)=-1thensh$="[192]"
715 gosub1330:gosub1670:gosub1695:gosub1685
720 ifsh$="[192]"thena=a*-1
725 goto1700
730 me=c:gosub1685:sh$="":goto1700
735 rem lmt to gmt
740 print"[147]":gosub2180
745 print" enter local mean time":print" ";:gosub2060
750 printtab(15)"1[146] am":printtab(15)"2[146] pm":printtab(15)"3[146] noon"
755 printtab(15)"4[146] midnight"
760 gosub2095:poke214,10:print:fori=0to4:printsp$:next
765 r%=4:d%=13:gosub1655:print"enter the longitude of the place"
770 printtab(9)"";:gosub2125:b=h:ifh<0thenb%=1
775 c=b*4/60:ifb<0anda<abs(c)thena=a+24:c$=" (one day earlier)":a=a+c:goto785
780 a=a+c:c$=" (the same day)":ifa>=24thena=a-24:c$=" (one day later)"
785 ap$=" am":ifa=12thenap$=" noon"
790 ifa>12thena=a-12:ap$=" pm"
795 ifa=0thena=12:ap$=" mid"
800 gosub1330:gosub1355
805 print" ";" gmt = [151]";h$+":";m$;ap$;c$:gosub1375
810 ifg$="a"then735
815 ifg$="m"then365
820 rem sidereal time for a date
825 print"[147]":gosub2145:gosub2165
830 ify<1583thengosub1855:goto820
835 gosub1420:jd=jd+.5
840 x=jd/365.2421988:y=x-int(x):z=y+.67128:a=z*24:a=a-12.03285
845 ifa>=24thena=a-24
850 gosub1330:gosub1355:printtab(7)"siderial time = "+h$+"h";m$+"m";s$+"s"
855 gosub1375
860 ifg$="m"then365
865 ifg$="a"then820
870 rem julian day # to a date
875 print"[147]":gosub2195
880 print" enter julian day number ";:nu=2:ln=7:gosub1930:jd=val(g$)
885 print" date =";:z%=0
890 ifz%=0thengosub1555:e=abs(y):gosub1475:jd=jd+u:z%=1:gosub1555
895 ifjd>2488082thenwp%=2:goto1615
900 co$=",":y$=str$(abs(y)):da$=str$(da):s$="[157]":da$=da$+co$+ y$
905 print" ";mo$;da$;bc$;" (new style)"
910 gosub1375
915 ifg$="m"then365
920 ifg$="a"then870
925 rem date to julian day #
930 print"[147]":gosub2210:printtab(13)"enter the date":print"[145][145]";:gosub2165:
935 wp%=0
940 ca$="n":gosub2225:ify>2099andbc$<>"b"thenwp%=1:goto1615
945 ify>4713andbc$="b"thenwp%=1:goto2250
950 gosub15