Professional Documents
Culture Documents
1 / 73
Sky & Telescope magazine is pleased to make available in machine-readable form the programs that
have been published in its monthly Astronomical Computing department, which first appeared in April 1984,
and later in the Computers in Astronomy department. These are offered as-is and without support.
The table on the following three pages lists the programs in reverse chronological order. Each name is a
hyperlink; if you select the name and your Web browser supports simple ASCII file transfers, you'll
automatically download the BASIC program.
Whenever possible the programs are written in simple generic BASIC, but there are unavoidable
variations from one interpreter to another. In case of difficulties, check your BASIC manual. A few programs
require specific graphics adapters or printers. To run these programs, you will need a BASIC interpreter for
your computer. If you do not know if your computer has one, see Stuart Goldman's article, "BASICally
Speaking," adapted from the April 1996 issue of S&T.
At the end of each program is a block indicating the issue of the magazine in which the program
appeared together with supporting text and instructions. If you have any questions, please consult the
original articles.
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 2 / 73
051 GALISA.BAS Plot Galilean moons of Jupiter (Apple II) Jun 89 650
052 SPACE.BAS Space motion of a star May 89 531
053 CHART.BAS Find atlas charts for any celestial coordinates Apr 89 420
054 REFR1.BAS Compute atmospheric refraction Mar 89 311
055 TAKI.BAS How to aim an alt-az (Dobsonian) telescope Feb 89 194
056 FRACTS.BAS Represent a decimal as a continued fraction Jan 89 080
057 PERIOD.BAS Period search by Fourier transform Sep 88 288
058 LUNAR.BAS Compute dates of lunar eclipses Jun 88 640
059 SHADOW.BAS Modeling mountain shadows Apr 88 417
060 CIRCLE.BAS Make setting circles and scales on a printer Mar 88 304
061 DIAL.BAS Design a vertical sundial Dec 87 646
062 PERIAP.BAS Compute lunar apogee and perigee Nov 87 527
063 STEREO.BAS Plot stars in stereographic projection Oct 87 407
064 DIFPAT.BAS Compute and display diffraction patterns Sep 87 294
065 BINARY.BAS Orbital ephemeris of a binary star Jul 87 071
066 CLOCK.BAS Add Moon to a real-time clock (Apple II) May 87 535
067 ORBITS.BAS Positions in near-parabolic orbits May 87 535
068 EXTINC.BAS Compute extinction of starlight Apr 87 426
069 PATH.BAS Interpolate comet positions Feb 87 196
070 METEOR.BAS Compute flight of meteors Jan 87 083
071 OBSCUR.BAS Obscuration at a solar eclipse Nov 86 515
072 SURF.BAS Surface brightness of an extended object Oct 86 392
073 SPHE.BAS Measure radius of curvature with a spherometer Sep 86 278
074 REACT.BAS Test your personal reaction time Aug 86 174
075 ALTAZ2.BAS How to correct altitudes for refraction Jul 86 070
076 MODEL.BAS Create model of star cluster Apr 86 398
077 EASTER.BAS Compute date of Easter Mar 86 294
078 TRACK.BAS Astrophoto tracking tolerances Feb 86 190
079 COMET.BAS Compute the ephemeris of a comet Dec 85 590
080 XYZ.BAS X,Y,Z coordinates of the Sun Nov 85 470
081 SAROS.BAS Saros numbers for solar eclipses Oct 85 366
082 HELIAC.BAS Heliacal rise and set times Sep 85 261
083 KEPLER.BAS Solve Kepler's equation (celestial mechanics) Aug 85 158
084 CALENDAR.BAS Perpetual calendar (Gregorian) Jul 85 062
085 SHUTTR.BAS Shutter speeds for astrophotography Jun 85 158
086 WAVEL.BAS Positions of absorption lines in a spectrum Jun 85 544
087 STEPPR.BAS Controlling a stepper motor Apr 85 350
088 MOONS.BAS Dates and times of new and full Moon Mar 85 254
089 PHOTOM.BAS Reducing photometric observations Feb 85 158
090 LHEIGHT.BAS Compute heights of lunar features Jan 85 062
091 GLOB1.BAS Distribution of globular clusters (Apple II) Dec 84 555
092 GLOB2.BAS Distribution of globular clusters (Apple II) Dec 84 555
093 LENS.BAS Calculate curves for an aplanatic lens Nov 84 450
094 GWMONTH.BAS Convert month number to name Oct 84 347
095 SUNSHINE.BAS Hours of sunshine for a specific latitude Sep 84 254
096 ANGSEP.BAS Angular separation of two celestial objects Aug 84 159
097 STAY.BAS Comet's time spent inside Earth's orbit Jul 84 062
098 ALTAZ.BAS Star altitude and azimuth at a given time Jun 84 558
099 GMST.BAS Sidereal time for Greenwich meridian Jun 84 558
100 CALJD.BAS Convert calendar date to Julian day May 84 454
101 JDCAL.BAS Convert Julian day to calendar date May 84 454
102 ADDMAG.BAS Combined magnitude of two or more stars Apr 84 359
103 INTERP.BAS Lagrange interpolation (multiple data points) Apr 84 359
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 4 / 73
62 REM
64 F=1: A1=ABS(VAL(A$)) BINARY.BAS ; 065;
66 IF LEFT$(A$,1)="-" THEN F=-1 Orbital ephemeris of a binary star
68 A=F*(A1+A2/60+A3/3600)
70 RETURN
80 REM ------------------------ 10 REM BINARY STAR ORBIT
85 REM APPEARED IN ASTRONOMICAL 12 REM
90 REM COMPUTING, SKY & TELE- 14 P1=4*ATN(1): R1=180/P1
95 REM SCOPE, AUGUST, 1984 16 C=2*P1: A1=0.0000005
99 REM ------------------------ 18 REM
20 INPUT "SEMIMAJOR AXIS";A
22 INPUT "ECCENTRICITY ";E0
24 IF INT(E0)=0 THEN 30
26 PRINT "NOT VALID; REENTER"
ASTEROID.BAS ; 027; 28 GOTO 22
The size of an asteroid from its brightness 30 INPUT "EPOCH OF PERIASTRON";T
32 INPUT "PERIOD IN YEARS ";P
34 INPUT "INCLINATION ";I
10 ' The Size of an Asteroid 36 INPUT "ARG OF PERIASTRON ";W
20 ' 38 INPUT "P.A. OF ASC NODE ";L
30 RD=180/3.14159: ' Radians to degrees 40 I=I/R1: W=W/R1: L=L/R1
40 INPUT "Apparent visual magnitude, V";V 42 REM
50 INPUT "Distance from Sun (au) ";R0 44 INPUT "DATE OF OBS (YR) ";D
60 INPUT "Distance from Earth (au) ";D0 46 T1=D-T: M=C*T1/P
70 INPUT "Earth-Sun distance (au) ";R 48 E=M+E0*SIN(M)+E0*E0*SIN(2*M)/2
80 PRINT "Asteroid type --" 50 N=E-E0*SIN(E): G=M-N
90 INPUT " C, S, or O(ther)";T$ 52 F=G/(1-E0*COS(E)): E=E+F
100 IF T$="c" OR T$="C" THEN P=.037 54 IF ABS(G)>A1 THEN 50
110 IF T$="s" OR T$="S" THEN P=.14 56 U=(1+E0)/(1-E0): H=COS(E/2)
120 IF T$="o" OR T$="O" THEN INPUT "What 58 IF H=0 THEN V=P1: GOTO 62
is the albedo";P 60 V=2*ATN(SQR(U)*SIN(E/2)/H)
130 IF P>1 OR P<=0 THEN 120 62 K=V+W: Y=SIN(K)*COS(I)
140 PRINT "Now enter the photometric 64 X=COS(K): Q=ATN(Y/X)
slope" 66 IF X<0 THEN Q=Q+P1
142 PRINT "parameter (G), or if unknown" 68 IF X<0 THEN 72
143 INPUT "enter 0.15. Value of G ";G 70 IF Y<0 THEN Q=Q+C
150 PRINT 72 P2=Q+L: IF P2>C THEN P2=P2-C
160 CI=(R0^2+D0^2-R^2)/(2*R0*D0) 74 R=A-A*E0*COS(E)
170 F=ATN(SQR(1-CI*CI)/CI) 76 S=R*X/COS(Q)
180 IF CI<0 THEN F=F+3.14159 78 P3=INT(P2*R1*10+0.5)/10
190 ' F = solar phase angle in radians 80 S3=INT(S*100+0.5)/100
200 PRINT USING "Solar phase angle, phi: 82 PRINT "P.A. ";P3;" DEG"
###.#";F*RD 84 PRINT "SEP. ";S3;" ARC SEC"
210 P1=EXP(-3.33*(TAN(F/2))^.63) 86 PRINT
220 P2=EXP(-1.87*(TAN(F/2))^1.22) 88 INPUT "ANOTHER (Y OR N)";Q$
230 H=V-5*LOG(D0*R0)/LOG(10)+2.5*LOG((1- 90 IF Q$<>"N" THEN 44
G)*P1+G*P2)/LOG(10) 92 REM ====================
240 PRINT USING "Absolute mag (H): 94 REM FROM "ASTRONOMICAL
###.#";H 96 REM COMPUTING," SKY & TELE-
250 LD=3.12-.2*H-.5*LOG(P)/LOG(10) 98 REM SCOPE, JULY, 1987
260 D=10^LD 100 REM ====================
270 PRINT USING "Diameter (km): 102 END
####.#";D
280 END
290 '
300 ' Basil Rowe's program calculates the
size of an asteroid from BLKHOLE1.BAS ; 013;
310 ' its apparent brightness and an Determine the mass of a black hole
assumption about its reflectivity
320 ' (albedo). The calculation is
explained on page 83 of the 10 REM Compute Mass of Black Hole
330 ' June 1993 issue of Sky & Telescope. 20 REM Print Data for M vs C vs P Plot
Carbonaceous asteroids 30 REM C0 = orbital circumference, km
340 ' have albedos of about 0.04, while 40 REM P0 = orbital period, seconds
S-type (stony) asteroids 50 REM G = gravitational constant
350 ' reflect about 0.14 of the light. 60 G=1.327E11
70 P=3.14159
80 OPEN "OUTPUT.TXT" FOR OUTPUT AS #1
90 FOR C0=1E5 TO 1E7 STEP 2E5
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 9 / 73
BLKHOLE2.BAS ; 014;
Calculate black-hole tidal forces
CALENDAR.BAS ; 084;
Perpetual calendar (Gregorian)
10 REM Compute Black-Hole Tidal Force
Upon Body
20 REM G = Grav. constant 10 REM PERPETUAL GREGORIAN CALENDAR
30 REM M = Mass, solar masses 12 REM
40 REM L = separation, km 14 DIM C$(42), D$(31), E(12)
50 REM C = circumference, km 16 FOR I=1 TO 31: READ D$(I): NEXT I
60 REM A = difference in acceleration, 18 FOR I=1 TO 12: READ E(I): NEXT I
km/sec**2 20 DATA " 1"," 2"," 3"," 4"," 5","
70 C=100000 6"," 7"," 8"," 9"," 10"
80 G=1.327E11 22 DATA " 11"," 12"," 13"," 14"," 15","
90 P=3.14159 16"," 17"," 18"," 19"," 20"
100 M=303 24 DATA " 21"," 22"," 23"," 24"," 25","
110 FOR L=.002 TO .004 STEP .001 26"," 27"," 28"," 29"," 30"," 31"
120 A=16*P*P*P*G*M*L/(C*C*C) 26 DATA 31, 28, 31, 30, 31, 30, 31, 31,
130 REM Convert to meters and g units 30, 31, 30, 31
140 L1=L*1000: A=(A*1000)/9.81 28 PRINT: INPUT "MONTH, YEAR";M,Y: IF
150 PRINT USING "Length: ###.# meters, Y<100 THEN Y=Y+1900
Tidal Force: ###.# g";L1;A 30 PRINT: PRINT " SU MO TU WE TH FR SA":
160 NEXT L PRINT
170 REM ====================== 32 J=367*Y-
180 REM FROM "ASTRONOMICAL INT(7*(Y+INT((M+9)/12))/4)+INT(275*M/9
190 REM COMPUTING," SKY & TELE- )+1721031
200 REM SCOPE, MAY 1996 34 K=0: IF M<=2 THEN K=-1
210 REM ====================== 36 J=J-INT(3*(INT((Y+K)/100)+1)/4)
220 END 38 K=E(M): IF M<>2 THEN 48
40 W=INT(Y-100*INT(Y/100)): X=INT(Y-
4*INT(Y/4)): Z=INT(Y-400*INT(Y/400))
42 IF X<>0 THEN 48
44 IF W=0 AND Z<>0 THEN 48
BLKHOLE3.BAS ; 015; 46 K=29
Generate a black-hole "accelergram" 48 X=J-7*INT(J/7)
50 FOR I=1 TO 42: C$(I)=" ": NEXT I
52 FOR I=1 TO K: C$(I+X)=D$(I): NEXT I
10 REM Compute Black-Hole Accelergram 54 FOR I=1 TO 6: J=7*I
20 P = 3.14159 56 PRINT C$(J-6);C$(J-5);C$(J-4);C$(J-
30 A$="##.### ##.### ##.### ##.###" 3);C$(J-2);C$(J-1);C$(J)
40 OPEN "OUTPUT.TXT" FOR OUTPUT AS #1 58 NEXT I
50 FOR I=0 TO 1000 60 PRINT: INPUT "ANOTHER";A$: IF A$="Y"
60 REM Generate random circumference THEN 28
70 C=2!*P*RND 62 END
80 REM Generate random angle 63 REM -------------------------
90 T=2!*P*RND: R=C/(2!*P) 64 REM APPEARED IN ASTRONOMICAL
100 X1=R*COS(T): Y1=R*SIN(T) COMPUTING, SKY & TELESCOPE, JULY, 1985
110 REM Determine vector length 65 REM -------------------------
120 R=R-.001/(C*C*C)
130 IF R<0 THEN R=0
140 X2=R*COS(T): Y2=R*SIN(T)
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 10 / 73
2330 FS=FS+(10^5.36)*(1.06+
((COS(RS*RD))^2))
2340 BD=10^(-.4*(MS(I)-MO(I)+43.27)) CCDLIMIT.BAS ; 028;
2350 BD=BD*(1-10^(-.4*K(I)*X)) Compute the signal-to-noise ratio of a CCD
2360 BD=BD*(FS*C4+440000.0*(1-C4))
2370 REM Total sky brightness
2380 IF BD>BT THEN GOTO 2410 10 ' Program to compute the signal-to-
2390 B(I)=BN+BD noise ratio
2400 GOTO 2420 20 ' for a stellar image in a CCD
2410 B(I)=BN+BT camera.
2420 IF ZM<90.0 THEN B(I)=B(I)+BM 30 ' Written by Anthony Mallama,
2430 NEXT I September 1992.
2440 PRINT "Sky brightness (UBVRI):"; 40 '
2450 PRINT USING " ##.#^^^^"; B(1), B(2), 50 DIM SN(5): PI=3.14159
B(3), B(4), B(5) 60 S0=2000000: ' Star-signal constant
2460 RETURN (the number of
3000 ' Subroutine CT 70 ' electrons per second for a 0-
3010 FOR I=1 TO 5 : READ DL(I) : NEXT I magnitude
3020 DATA 0.068, 0.098, 0.089, 0.22, 0.24 80 ' star and a 1-inch scope)
3030 FOR I=1 TO 5 : READ RE(I) : NEXT I 90 SB=18: ' Sky brightness in mag per sq
3040 DATA 0.83, 0.86, 0.88, 0.87, 0.90 arc second
3050 FOR I=1 TO 5 : READ TR(I) : NEXT I 100 PS=1.5: ' Pixel size in arc seconds
3060 DATA 0.970, 0.983, 0.987, 0.983, of sky
0.980 110 DD=3: ' Detection diameter in arc
3070 FOR I=1 TO 5 : READ TF(I) : NEXT I seconds
3080 DATA 0.70, 0.70, 0.70, 0.70, 0.70 120 RN=100: ' Readout noise in electrons
3090 ' Seeing per pixel
3100 FOR I=1 TO 5 130 TH=70: ' Thermal electrons/pixel/sec
3110 X=1.0/(COS(Z/57.28)) 140 AP=8: ' Aperture of telescope in
3120 T1=(TS^2)*(X^1.2)*((WA(I)/.55)^-.4) inches
3130 150 ET=100: ' Time before a readout in
T2=5.54*((3600.0*57.28*(WA(I)/10000.0) seconds
/D)^2) 160 PRINT'
3140 TT(I)=SQR(T1+T2) : REM TOTAL SEEING 170 PRINT "Signal-to-noise ratios for
FWHM (") stellar CCD images,"
3150 NEXT I 180 PRINT "based on:"
3160 ' Efficiencies 190 PRINT USING " A) #####.# inch
3170 FOR I=1 TO 5 aperture scope";AP
3180 200 PRINT USING " B) #####.# mag per sq
EF(I)=(Q(I)/100.0)*TF(I)*(RE(I)^NM)*(T arcsec of sky";SB
R(I)^(2.0*NL)) 210 PRINT USING " C) ####### arcsec
3190 F(I)=1-EXP(-2.77*((TA/TT(I))^2)) : detection circle";DD
REM Fraction in photometry aperture 220 PRINT USING " D) ####### sec longest
3200 NEXT I single exp.";ET
3210 A=(3.14159/4.0)*(D^2-DS^2) : REM 230 PRINT USING " E) #####.# arcsec-per-
Light-collecting area pixel scale";PS
3220 ' Source and sky counts 240 PRINT USING " F) ####### elec/pixel
3230 FOR I=1 TO 5 readout noise";RN
3240 IN=10^(-.4*(MA(I)-MO(I)+DM(I))) 250 PRINT USING " G) ####### thermal
3250 PE=(WA(I)/10000.0)/(6.62E- elec/pixel/sec";TH
27*2.997E+10) 260 PRINT USING " H) ####### star-signal
3260 NS(I)=IN*F(I)*A*EF(I)*E*DL(I)*PE constant";S0
3270 NB(I)=B(I)*A*EF(I)*E*DL(I)*PE*(TP^2) 270 PRINT " Q) Quit"
3280 NEXT I 280 PRINT
3290 PRINT : PRINT "Star counts in 290 INPUT "Choose a letter or type '/' to
photometry aperture (UBVRI):"; continue";P$
3300 PRINT USING " #####."; NS(1), NS(2), 300 IF P$="A" OR P$="a" THEN INPUT AP
NS(3), NS(4), NS(5) 310 IF P$="B" OR P$="b" THEN INPUT SB
3310 PRINT "Sky counts per pixel (UBVRI): 320 IF P$="C" OR P$="c" THEN INPUT DD
"; 330 IF P$="D" OR P$="d" THEN INPUT ET
3320 PRINT USING " #####."; NB(1), NB(2), 340 IF P$="E" OR P$="e" THEN INPUT PS
NB(3), NB(4), NB(5) 350 IF P$="F" OR P$="f" THEN INPUT RN
3330 RETURN 360 IF P$="G" OR P$="g" THEN INPUT TH
9991 ' ============================ 370 IF P$="H" OR P$="h" THEN INPUT S0
9992 ' FROM "ASTRONOMICAL COMPUTING," 380 IF P$="Q" OR P$="q" THEN 720
9993 ' SKY & TELESCOPE, MAY 1998 390 IF P$="/" THEN GOTO 410
9994 ' ============================ 400 GOTO 160
410 PRINT
420 AR=PI*(DD/2)^2: 'Detection area in
square arcsec
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 13 / 73
100 OR2 = OR1 * PLU: IR4 = IR1 * PLU: IR5 610 LPRINT "PA"; A + SIN(J * K) * IR5;
= IR2 * PLU: IR6 = IR3 * PLU ","; C + COS(J * K) * IR5; ";"
110 PRINT : PRINT "Do you want the scale 620 LPRINT "DI"; COS(-J * K); ","; SIN(-J
in Degrees or Hours and Minutes?" * K); ";"
120 INPUT " Please indicate 'd' 630 IF J = 90 THEN LPRINT "DI0,-1;"
for Degrees or 'h' for Hours... "; A$: 640 IF J = 180 THEN LPRINT "DI-1,0;"
PRINT 650 IF J = 270 THEN LPRINT "DI0,1;"
130 IF A$ = "h" OR A$ = "H" THEN QQ = 1 660 IF QQ = 1 THEN LPRINT "LB"; INT(J /
140 REM - Clear, set into HP-GL/2 mode, 15); "*;": GOTO 680
and initialize the printer 670 LPRINT "LB"; INT(J); "*;"
150 LPRINT CHR$(27); "E": LPRINT 680 LPRINT "PU;"
CHR$(27); "%0B": LPRINT "IN;" 690 NEXT J
160 REM - Select a pen and set the width 700 REM - Reset the printer
170 LPRINT "SP1;": LPRINT "PW.1;" 710 LPRINT CHR$(27); "%0A": LPRINT
180 PRINT : PRINT : PRINT CHR$(27); "E"
"Printing......." 720 END
190 PRINT : PRINT "NOTE: This will take 900 REM ******************************
up to 70 seconds to print." 910 REM THIS PROGRAM BY RONALD KOCELA
200 REM - Plot outside and inside circles PRODUCES CIRCULAR
210 LPRINT "PA"; A; ","; C; ";": LPRINT 920 REM SETTING CIRCLES ON HP LASERJET
"CI"; OR2; : LPRINT "PU;" PRINTERS.
220 LPRINT "PA"; A; ","; C; ";": LPRINT 930 REM FROM SKY & TELESCOPE, MARCH
"CI"; IR4; : LPRINT "PU;" 1996, PAGE 84.
230 REM - Put in the Degrees or Hours 940 REM ******************************
240 IF QQ = 1 THEN FA = 1.25
250 FOR I = -HF TO HF STEP FA
260 LPRINT "PU;"
270 LPRINT "PA"; A + SIN(I * K) * IR4;
","; C + COS(I * K) * IR4; ";" FIREBALL.BAS ; 035;
280 LPRINT "PD;" Calculate descent of a fireball
290 LPRINT "PA"; A + SIN(I * K) * OR2;
","; C + COS(I * K) * OR2; ";"
300 LPRINT "PU;" 10 REM FIREBALL
310 NEXT I 12 PRINT
320 REM - Put in longer tick marks 14 INPUT "INITIAL MASS (KG) ";MM
330 IF QQ = 1 THEN FB = 15 16 INPUT "DENSITY (KG/M^3) ";D
340 FOR I = -HF TO HF STEP FB 18 INPUT "SPEED (KM/S) ";V
350 LPRINT "PU;" 20 INPUT "ZENITH ANGLE (DEG) ";Z
360 LPRINT "PA"; A + SIN(I * K) * IR5; 22 INPUT "TIME STEP (SEC) ";DT
","; C + COS(I * K) * IR5; ";" 24 GOSUB 98: PRINT: GOSUB 114
370 LPRINT "PD;" 26 A=1.2: L=.001: G=1: H0=.2
380 LPRINT "PA"; A + SIN(I * K) * OR2; 28 H1=500000: SG=H0/(2*G*H1)
","; C + COS(I * K) * OR2; ";" 30 H=155000: T=0: FM=10: FL=FM
390 LPRINT "PU;" 32 M=MM: V=V*1000
400 NEXT I 34 RE=6371000: ZR=Z*3.14159/180
410 REM - Put in shorter tick marks 36 VV=-V*COS(ZR): VH=V*SIN(ZR)
420 FOR I = -HF TO HF STEP 5 38 REM DENSITY OF ATMOSPHERE
430 LPRINT "PU;" 40 I=INT(H/10000)
440 LPRINT "PA"; A + SIN(I * K) * IR6; 42 IF I>15 THEN I=15
","; C + COS(I * K) * IR6; ";" 44 FR=(H/10000)-I
450 LPRINT "PD;" 46 R=10^(LR(I)*(1-FR)+FR*LR(I+1))
460 LPRINT "PA"; A + SIN(I * K) * OR2; 48 REM RATES OF CHANGE
","; C + COS(I * K) * OR2; ";" 50 A2=G*A*R*V*V/(M*D*D)^.33333
470 LPRINT "PU;" 52 GV=9.810001/(1+H/RE)^2
480 NEXT I 54 AV=-GV-A2*VV/V+VH*VH/(RE+H)
490 REM - Select Font and Label 56 AH=-A2*VH/V-VV*VH/(RE+H)
500 LPRINT "SD1,21,2,1,4,8,7,4148;" 58 M0=SG*M*V*A2
510 IF QQ = 1 THEN GOTO 530 60 IF FL=FM THEN GOSUB 76
520 IF OR1 < 45 THEN LPRINT "DV1;" 62 REM INCREMENT VARIABLES
530 LPRINT "DT*,1;" 64 T=T+DT: S=S+VH*DT*RE/(RE+H)
540 LPRINT "SS;" 66 H=H+VV*DT: M=M-M0*DT
550 LPRINT "LO16;" 68 VV=VV+AV*DT: VH=VH+AH*DT
560 IF QQ = 1 THEN FC = 345: FB = 15 70 V=SQR(VH*VH+VV*VV)
570 FOR J = 0 TO FC STEP FB 72 IF M<0 OR H<0 THEN END
580 LPRINT "PU;" 74 FL=FL+1: GOTO 38
590 IF QQ = 1 THEN GOTO 610 76 REM OUTPUT
600 IF OR1 < 45 THEN LPRINT "PA"; A + 78 PRINT INT(.5+T*10)/10;
SIN(J * K) * (IR5 + E); ","; C + COS(J 80 PRINT TAB(10);INT(.5+S/1000);
* K) * (IR5 + E); ";": GOTO 620 82 PRINT TAB(20);INT(.5+H/1000);
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 21 / 73
610 N0=N0+1: ' At sea level 1070 ZA=ZA-R(IC): ' Zenith distance of
620 ' Sun
630 ' Calc. refraction and air mass 1080 '
for each color 1090 ' Calculate the fraction of disk
640 GOSUB 1510: ' Refraction visible
subroutine 1100 CC=(ZA-Z0)*TB*DS/RS
650 IF RF>RX THEN RX=RF 1110 IF CC>1 THEN CC=1: ' If nothing
660 IF RF<RN THEN RN=RF visible
670 R(IC)=RF: XR=AM 1120 TH(IC)=ATN(SQR(1-CC*CC)/CC)
680 ' 1130 IF CC<0 THEN TH(IC)=TH(IC)+PI
690 ' Calc. air transmission at 1140 FR=(TH(IC)-CC*SIN(TH(IC)))/PI
occulting object 1150 '
700 KR=1.13E-11*((N-1)^2)*(W^-4) 1160 ' Calculate visible flux from
710 KA=KD*((W/.000055)^AA): CZ=COS(Z0) Sun
720 XA=1/ 1170 F(IC)=FA(IC)*TR(IC)*FR
(CZ+.8*SQR(AH/R0)*EXP(-.38*CZ*SQR(R0/A 1180 NEXT IC
H))) 1190 '
730 KO=KS(IC)*OZ/3 1200 ' (Could print out flux, F(IC)
740 XO=1/SQR(1-(SIN(Z0)/(1+((HS- [ergs/cm2/s/A],
H)/R0)))^2) 1210 ' as well as the Sun's stellar
750 KX=KR*XR+KA*XA+KO*XO: IF KX>90 THEN magnitude,
KX=90 1220 ' M(IC)=-2.5*LOG(F(IC))/B0-(M0(IC)
760 TR(IC)=10^(-.4*KX) +20),
770 ' 1230 ' as a function of the color IC,
780 ' Calculate Sun's flux above where
atmosphere 1240 ' 1=3000A, 2=3500A, 3=4000A, ... ,
790 BB=.0000374*(W^-5)/(EXP(1.43/ 11=8000A.)
(W*TS))-1) 1250 '
800 FA(IC)=((RS/DS)^2)*BB*1E-8: ' in 1260 XX=0: YY=0: ZZ=0
erg/cm2/s/A 1270 FOR IC=1 TO 11
810 NEXT IC 1280 XX=XX+X1(IC)*F(IC): ' X from CIE
820 ' standard
830 ' Pick relevant time range for 1290 YY=YY+Y1(IC)*F(IC): ' Y from CIE
calculations standard
840 CZ=COS(Z0+RN+TB*RS/DS) 1300 ZZ=ZZ+Z1(IC)*F(IC): ' Z from CIE
850 HC=(CZ-SIN(D)*SIN(L))/(COS(D)*COS(L)) standard
860 HA=ATN(SQR(1-HC*HC)/HC): IF HC<0 THEN 1310 NEXT IC
HA=HA+PI 1320 IF XX+YY+ZZ=0 THEN 1480
870 T1=HA*PE*.5/PI: ' Time when lowest 1330 X=XX/(XX+YY+ZZ): ' x
disk sets 1340 Y=YY/(XX+YY+ZZ): ' y
880 CZ=COS(Z0+RX+TB*RS/DS) 1350 IF Y<=.01 THEN 1480: ' If invisible
890 HC=(CZ-SIN(D)*SIN(L))/(COS(D)*COS(L)) to eye
900 HA=ATN(SQR(1-HC*HC)/HC): IF HC<0 THEN 1360 PH=ATN((.333-X)/(Y-.333)): ' Angle
HA=HA+PI from white
910 T2=HA*PE*.5/PI: ' Time when highest 1370 IF (Y-.333)<0 THEN PH=PH+PI:' in
disk sets color diagram
920 DT=(T2-T1)/50: ' Choose a time 1380 CO$="Violet"
increment 1390 IF PH<4.229 THEN CO$= " Blue"
930 T0=T1-DT: ' Define a fiducial 1400 IF PH<2.580 THEN CO$= " Green"
time 1410 IF PH<1.106 THEN CO$= "Yellow"
940 PRINT " Time x y V mag. 1420 IF PH<0.359 THEN CO$= "Orange"
Color" 1430 IF PH<0.000 THEN CO$= " Red"
950 ' 1440 V=-2.5*LOG(.034*YY/2.54E-10)/B0: '
960 ' ***** Main loop starts here Visual mag.
***** 1450 PRINT USING "##.## ";TT;
970 FOR IT=-1 TO 48 1460 PRINT USING "##.## ##.## ###.#
980 T=T1+IT*DT: ' Choose a time ";X;Y;V;
990 TT=T-T0: ' Seconds from start 1470 PRINT CO$
time 1480 NEXT IT
1000 ' 1490 END
1010 ' Cycle through wavelengths 1500 '
1020 FOR IC=1 TO 11 1510 ' Refraction subroutine (quick
1030 ' Calc. altitude of solar disk version)
for that color 1520 N=1+(N0-1)*EXP(-H/S): ' At
1040 HA=2*PI*T/PE: ' Hour angle of Sun observer
1050 CZ=SIN(D)*SIN(L) 1530 BS=R0*SIN(Z0)/(R0+.5*S):
+COS(D)*COS(L)*COS(HA) BE=ATN(BS/SQR(1-BS*BS))
1060 ZA=ATN(SQR(1-CZ*CZ)/CZ): IF CZ<0 1540 R5=N*BS: RF=ATN(R5/SQR(1-R5*R5))-BE:
THEN ZA=ZA+PI CZ=COS(Z0)
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 24 / 73
LHEIGHT.BAS ; 090;
Compute heights of lunar features
LIMMAG.BAS ; 046;
Limiting magnitude of a telescope
100 REM COMPUTING LUNAR HEIGHTS
110 REM
120 INPUT "HALF-HEIGHT CHORD (MM) ";L1 100 REM LIMITING MAGNITUDE OF A TELESCOPE
130 INPUT "SEGMENT ";L2 110 REM
140 PRINT 120 INPUT "SCOPE APERTURE ";D : REM IN
150 PRINT "USE VALUES IN DEGREES" INCHES
160 PRINT 130 INPUT "POWER ";MG : REM SCOPE'S
170 INPUT "EARTH SEL. LONG. ";LE MAGNIFICATION
180 INPUT "EARTH SEL. LAT. ";BE 140 INPUT "LIM MAG AT ZENITH ";MZ : REM
190 INPUT "SUN SEL. COLONG. ";CS FOR NAKED-EYE
200 INPUT "SUN SEL. LAT. ";BS 150 INPUT "OBSERVER'S AGE ";AG : REM IN
210 REM CONVERT DEGREES TO RADIANS YEARS
220 DR = 3.14159/180 160 INPUT "TELESCOPE TYPE (1-3) ";TT :
230 LS = 90-CS REM 1=REFR, 2=REFL, 3=SCT
240 IF LS<O THEN LS=450-CS 170 INPUT "CLEANLINESS (1-9) ";CL: REM
250 BE = BE*DR: LE = LE*DR 1=FILTHY, 9=CLEAN
260 BS = BS*DR: LS = LS*DR 180 INPUT "COLOR INDEX OF STAR ";CI : REM
270 CS = CS*DR B-V MAGNITUDE
280 RM = 1080 190 INPUT "ZENITH DISTANCE ";Z : REM IN
290 EM = 23900 DEGREES
300 SM = 93000000 200 INPUT "EXTINCTION COEFF ";KV : REM IN
310 PRINT V-BAND
320 PRINT "ENTER FEATURE DATA" 210 INPUT "SEEING DISK RADIUS ";SE : REM
330 INPUT " SEL. LONGITUDE ";LO IN ARC-SECONDS
340 INPUT " SEL. LATITUDE ";BO 220 INPUT "EXPERIENCE (1-9) ";EX : REM
350 INPUT " SHADOW (MM) ";MQ 1=NOVICE, 9=VERY EXPER.
360 BO = BO*DR 230 D=D*25.4 : REM CONVERT TO MM
370 I1 = SIN(BE)*SIN(BO) 240 IF TT=1 THEN DS=0 : REM NO
380 I2 = SIN(BE)*SIN(BS) OBSTRUCTION
390 I3 = SIN(BS)*SIN(BO) 250 IF TT=2 THEN DS=0.15*D : REM NEWT
400 I4 = COS(BE)*COS(BO) SECONDARY DIAM
410 I5 = COS(BE)*COS(BS) 260 IF TT=3 THEN DS=0.35*D : REM TYPICAL
420 I6 = COS(BS)*COS(BO) DIAM OF SCHMIDT-
430 EI = I1+I4*COS(LO-LE) 270 REM CASS SECONDARY
440 ER = I2+I5*COS(LE-LS) 280 Z=Z/57.296 : REM CONVERT TO RADIANS
450 SI = I3+I6*COS(LO-LS) 290 CC=1.58E-10 : REM NIGHT-VISION
460 RX = L1/SIN(2*ATN(L1/L2)) CONSTANT
470 MR = MQ/RX 300 KK=0.0126 : REM NIGHT-VISION CONSTANT
480 I7 = RM*RM: I8 = EM*EM 310 K=1.2*KV : REM CORRECT KV TO 5100 A
490 I9 = SM*SM 320 X=1.0/COS(Z) : REM AIR MASS
500 XE = SQR(I7+I8-2*RM*EM*EI) 330 IF TT=1 THEN FL=0.99^4 : REM 4 COATED
510 ES = SQR(I8+I9-2*EM*SM*ER) SURFACES
520 XS = SQR(I7+I9-2*RM*SM*SI) 340 IF TT=2 THEN FL=0.88^2 : REM 2
530 S = (XE+ES+XS)/2 ALUMINIZED MIRRORS
540 P = S*(S-ES)*(S-XE)*(S-XS) 350 IF TT=3 THEN FL=(0.99*0.88)^2 : REM
550 P = (2/(XE*XS))*SQR(P) CORRECTOR & 2 MIRRORS
560 SH = I3+I6*SIN(CS+LO)
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 33 / 73
700 PRINT USING "Scale of the universe 1110 REM Distance Modulus =
NOW versus THEN =#####.###"; SC 45.741
710 PRINT USING "Distance of object THEN 1120 REM Speed away from us THEN =
= #####.### billion light-years"; DT 1.078 x speed of light*
720 PRINT USING "Distance of object NOW 1130 REM Speed away from us NOW =
= ######.### billion light-years"; DN 1.060 x speed of light*
730 PRINT USING "Luminosity Distance NOW 1140 REM Hubble constant THEN =
=#######.### billion light-years"; DL 167.55 km/sec/megaparsec
740 PRINT USING "Distance Modulus = 1150 REM Hubble constant NOW =
######.###"; DMOD 61.00 km/sec/megaparsec
750 PRINT USING "Speed away from us THEN 1160 REM * Not the object's own speed,
=####.### x speed of light*"; ST but caused by the expansion of space.
760 PRINT USING "Speed away from us NOW
=####.### x speed of light*"; SN
770 PRINT USING "Hubble constant THEN
=########.## km/sec/megaparsec"; HT
780 PRINT USING "Hubble constant NOW LUNAR.BAS ; 058;
=########.## km/sec/megaparsec"; HN Compute dates of lunar eclipses
790 PRINT " * Not the object's own speed,
but caused by the expansion of space."
800 END 10 Rem NEW AND FULL MOONS
900 REM --------------------------- 12 Rem
910 REM APPEARED IN COMPUTERS IN 14 Rem
ASTRONOMY, 16 R1 = 3.14159265 / 180: U = 0
920 REM SKY & TELESCOPE, AUGUST 2001, 18 INPUT "YEAR ";Y
PAGE 62. 19 G = 1: If Y < 1583 Then G = 0
930 REM Corrections made Sept. 2003 to 20 Print
lines 232, 550, and 630, with 22 K0 = Int((Y - 1900) * 12.3685)
932 REM many thanks to Bruce Nelson, a 24 T = (Y - 1899.5) / 100
great mathematician whose hobby 26 T2 = T * T: T3 = T * T * T
934 REM is cosmology and who decided to 28 J0 = 2415020 + 29 * K0
re-derive all these equations! 30 F0 = 0.0001178 * T2 - 0.000000155 * T3
936 REM The updates give smoother 32 F0 = F0 + 0.75933 + 0.53058868 * K0
results when OMC is small and more 34 F0 = F0 - 0.000837 * T - 0.000335 * T2
938 REM accurate results for HT and ST 36 J0 = J0 + Int(F0): F0 = F0 - Int(F0)
for very large values of Z. 38 M0 = K0 * 0.08084821133
940 REM --------------------------- 40 M0 = 360 * (M0 - Int(M0)) + 359.2242
950 REM ** SAMPLE RUN, for OmegaM=.35, 42 M0 = M0 - 0.0000333 * T2
OmegaL=.65, H0=61, and Z=1.7 ** 44 M0 = M0 - 0.00000347 * T3
960 REM Enter Matter Density of the 46 M1 = K0 * 0.07171366128
Universe, OmegaM (0 - 2.0)? .35 48 M1 = 360 * (M1 - Int(M1)) + 306.0253
970 REM Enter Cosmological Constant, 50 M1 = M1 + 0.0107306 * T2
OmegaL (0. - 1.0)? .65 52 M1 = M1 + 0.00001236 * T3
980 REM Will you enter (A)ge of the 54 B1 = K0 * 0.08519585128
universe or (H)ubble constant? H 56 B1 = 360 * (B1 - Int(B1)) + 21.2964
990 REM Enter Hubble constant in 58 B1 = B1 - 0.0016528 * T2
km/sec/Mpc? 61 60 B1 = B1 - 0.00000239 * T3
1000 REM Will you enter (T)ime THEN or 62 For K9 = 1 To 27 Step 2
(R)edshift of the light we see NOW? R 64 J = J0 + 14 * K9: F = F0 + 0.765294 *
1010 REM Enter redshift value for the K9
light we see NOW? 1.7 66 K = K9 / 2
1020 REM Age Factor NOW (Age=Fac/H0) = 68 M5 = (M0 + K * 29.10535608) * R1
0.9226 69 M6 = (M1 + K * 385.81691806) * R1
1030 REM Age of the universe NOW = 70 B6 = (B1 + K * 390.67050646) * R1
14.7887 billion years 71 F = F - 0.4068 * Sin(M6)
1040 REM Age of the universe THEN = 72 F = F + (0.1734 - 0.000393 * T) *
4.0054 billion years Sin(M5)
1050 REM Light travel time = 73 F = F + 0.0161 * Sin(2 * M6)
10.7833 billion years 74 F = F - 0.0104 * Sin(2 * B6)
1060 REM Redshift of the light we see NOW 75 F = F - 0.0074 * Sin(M5 - M6)
= 1.700 76 F = F - 0.0051 * Sin(M5 + M6)
1070 REM Scale of the universe NOW versus 77 F = F + 0.0021 * Sin(2 * M5)
THEN = 2.700 81 F = F + 0.5 / 1440
1080 REM Distance of object THEN = 82 J = J + Int(F): F = F - Int(F)
6.292 billion light-years 86 GoSub 100
1090 REM Distance of object NOW = 92 Next
16.987 billion light-years 94 GoTo 999
1100 REM Luminosity Distance NOW = 100 Rem LUNAR ECLIPSE SUBROUTINE
45.865 billion light-years 102 D7 = 0
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 37 / 73
104 If Abs(Sin(B6)) > 0.36 Then GoTo 196 1001 Rem THIS IS THE *COMPLETE*
106 S = 5.19595 - 0.0048 * Cos(M5) 1002 Rem PROGRAM FOR PREDICTING
108 S = S + 0.002 * Cos(2 * M5) 1003 Rem LUNAR ECLIPSES (SEE
110 S = S - 0.3283 * Cos(M6) 1004 Rem SKY & TELESCOPE, JUNE,
112 S = S - 0.006 * Cos(M5 + M6) 1005 Rem 1988, PAGE 640)
114 S = S + 0.0041 * Cos(M5 - M6) 1006 Rem ***********************
116 C1 = 0.207 * Sin(M5)
118 C1 = C1 + 0.0024 * Sin(2 * M5)
120 C1 = C1 - 0.039 * Sin(M6)
122 C1 = C1 + 0.0115 * Sin(2 * M6) MALLAM.BAS ; 041;
124 C1 = C1 - 0.0073 * Sin(M5 + M6) Precession of a satellite's orbit
126 C1 = C1 - 0.0067 * Sin(M5 - M6)
128 C1 = C1 + 0.0117 * Sin(2 * B6)
130 D9 = Abs(S * Sin(B6) + C1 * Cos(B6)) 10 REM PRECESSION OF A SATELLITE'S ORBIT
132 U = 0.0059 + 0.0046 * Cos(M5) DUE TO J2
134 U = U - 0.0182 * Cos(M6) 20 REM
136 U = U + 0.0004 * Cos(2 * M6) 30 GOSUB 260: J=0
138 U = U - 0.0005 * Cos(M5 + M6) 40 INPUT "Planet's name"; P$
140 RP = 1.2847 + U: RU = 0.7404 - U 50 FOR K=1 TO 9
142 MP = (1.5572 + U - D9) / 0.545 60 IF P$=PL$(K) THEN J=K
144 If MP < 0 Then GoTo 196 70 NEXT
146 MU = (1.0129 - U - D9) / 0.545 80 IF J=0 THEN 40
148 D5 = 1.5572 + U: D6 = 1.0129 - U 90 REM
150 D7 = 0.4679 - U 100 INPUT "Altitude of the satellite
152 N = (0.5458 + 0.04 * Cos(M6)) / 60 orbit (km)"; A
154 D5 = Sqr(D5 * D5 - D9 * D9) / N 110 INPUT "Inclination to the equator
156 If MU <= 0 Then GoTo 164 (degrees)"; I
158 D6 = Sqr(D6 * D6 - D9 * D9) / N 120 I=I/RD: REM Convert to radians
160 If MU <= 1 Then GoTo 164 130 REM
162 D7 = Sqr(D7 * D7 - D9 * D9) / N 140 K1=R(J)*R(J) * (R(J)+A)^-3.5 *
164 GoSub 900: Print SQR(GM(J))
166 Print "ECLIPSE DATE: "; Y; M; D1 150 N=-1.5*K1*J2(J)*COS(I)
168 Print " MAXIMUM PHASE: "; 160 P=.75*K1*J2(J) * (5*COS(I)*COS(I)-1)
170 Print H1; "h "; M9; "m UT" 170 N=N*RD*S: P=P*RD*S: REM Radians/sec
172 MP = Int(1000 * MP + 0.5) / 1000 to deg/day
174 Print " PENUMBRAL MAG: "; MP 180 REM
176 If MU <= 0 Then GoTo 182 190 PRINT "Precession of the node: "
178 MU = Int(1000 * MU + 0.5) / 1000 200 PRINT " ";N;"deg/day,
180 Print " UMBRAL MAG: "; MU ";N*Y;"deg/yr"
182 Print " SEMIDURATIONS --" 210 PRINT
184 D5 = Int(D5 + 0.5): Rem ROUND OFF 220 PRINT "Precession of pericenter: "
186 Print " PENUMBRA: "; D5; "m" 230 PRINT " ";P;"deg/day,
188 If MU < 0 Then GoTo 196 ";P*Y;"deg/yr"
190 D6 = Int(D6 + 0.5): D7 = Int(D7 + 240 REM
0.5) 250 END
192 Print " UMBRA: "; D6; "m" 260 REM READ IN DATA
194 Print " TOTALITY: "; D7; "m" 270 DIM PL$(9), GM(9), J2(9), R(9)
196 Return 280 RD=180/3.14159265#: REM Radians to
900 Rem JD --> CALENDAR degrees
905 Rem 290 Y=365.2422: REM Days per year
920 F = F + 0.5 300 S=86400: REM Seconds per day
925 If F < 1 Then GoTo 935 310 REM
930 F = F - 1: J = J + 1 320 DATA
935 If G = 1 Then GoTo 945 "MERCURY","VENUS","EARTH","MOON","MARS
940 A = J: GoTo 955 "
945 A1 = Int((J / 36524.25) - 51.12264) 330 DATA
950 A = J + 1 + A1 - Int(A1 / 4) "JUPITER","SATURN","URANUS","NEPTUNE"
955 B = A + 1524 340 FOR J=1 TO 9: READ PL$(J): NEXT
960 C = Int((B / 365.25) - 0.3343) 350 REM
965 D = Int(365.25 * C) 360 REM PLANETARY GM'S (KM^3/S^2)
970 E = Int((B - D) / 30.61) 370 DATA 22032, 324860, 398600, 4902,
975 D = B - D - Int(30.61 * E) + F 42828
980 M = E - 1: Y = C - 4716 380 DATA 125680000, 37931000, 5793900,
985 If E > 13.5 Then M = M - 12 6835000
990 If M < 2.5 Then Y = Y + 1 390 FOR J=1 TO 9: READ GM(J): NEXT
993 D1 = Int(D): H = 24 * (D - D1) 400 REM
994 H1 = Int(H): M9 = Int(60 * (H - H1)) 410 REM PLANETARY J2'S
997 Return 420 DATA 0.00006, 0.0000186, 0.001083,
999 End 0.0002027
1000 Rem ***********************
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 38 / 73
73 REM JANUARY, 1987, PAGE 83 410 IF Q$<>"y" AND Q$<>"Y" THEN 440
74 REM ************************* 420 INPUT "New value for D";D
82 END 430 HI=0: LO=0: GOTO 270
440 END
450 REM Solve 4 linear equations for 4
unknowns
460 REM (BYTE, August, 1983, page
MIRROR.BAS ; 043; 396)
Foucault mirror test analysis 470 DE=1
480 Y=N+1: FOR X=1 TO N: Y=Y+1: M(X,Y)=1:
NEXT X
10 ' FOUCAULT MIRROR TEST AT FOUR ZONES 490 FOR G=1 TO N
20 ' 500 J=2*N+1: DV=M(G,G): DE=DE*DV
30 DIM A(4,9) 510 FOR H=1 TO J: M(G,H)=M(G,H)/DV: NEXT
40 INPUT "Mirror's diameter ";W H
50 INPUT "Radius of curvature";RR 520 FOR S=1 TO N
60 R=W/2 530 Q=M(S,G): IF S=G THEN 550
70 Z1=.3: Z2=.6: Z3=.8: Z4=.95: REM 540 FOR T=1 TO J: M(S,T)=M(S,T)-M(G,T)*Q:
ZONES NEXT T
80 X1=Z1*R: X2=Z2*R: X3=Z3*R: X4=Z4*R 550 NEXT S: NEXT G
90 L=.000022: REM WAVELENGTH IN INCHES 560 RETURN
100 INPUT "Four zonal 570 REM PREPARE CHART
measurements";V1,V2,V3,V4 580 CLS: SCREEN 9 : Y1=85: Y2=95: YC=90
110 F1=(X1/(2*RR*RR*L))*(X1*X1/RR-V1) 590 W1=400: H0=100: H1=110: H3=H0+W1
120 F2=(X2/(2*RR*RR*L))*(X2*X2/RR-V2) 600
130 F3=(X3/(2*RR*RR*L))*(X3*X3/RR-V3) P1=H0+W1*Z1:P2=H0+W1*Z2:P3=H0+W1*Z3:P4
140 F4=(X4/(2*RR*RR*L))*(X4*X4/RR-V4) =H0+W1*Z4
150 A1=(X1)^7: B1=(X1)^5: C1=(X1)^3: 610 LINE (H0,10)-(H0,170): LINE (H0,YC)-
D1=X1 (H3,YC)
160 A2=(X2)^7: B2=(X2)^5: C2=(X2)^3: 620 LINE (H0,10)-(H1,10): LINE (H0,50)-
D2=X2 (H1,50)
170 A3=(X3)^7: B3=(X3)^5: C3=(X3)^3: 630 LINE (H0,130)-(H1,130): LINE
D3=X3 (H0,170)-(H1,170)
180 A4=(X4)^7: B4=(X4)^5: C4=(X4)^3: 640 LINE (P1,Y1)-(P1,Y2): LINE (P2,Y1)-
D4=X4 (P2,Y2)
190 M(1,1)=A1: M(1,2)=B1: M(1,3)=C1: 650 LINE (P3,Y1)-(P3,Y2): LINE (P4,Y1)-
M(1,4)=D1 (P4,Y2)
200 M(2,1)=A2: M(2,2)=B2: M(2,3)=C2: 660 LINE (H3,Y1)-(H3,Y2)
M(2,4)=D2 670 LOCATE 1,1: PRINT "+0.2 wave"
210 M(3,1)=A3: M(3,2)=B3: M(3,3)=C3: 680 LOCATE 4,1: PRINT "+0.1 wave"
M(3,4)=D3 690 LOCATE 7,1: PRINT " 0 wave"
220 M(4,1)=A4: M(4,2)=B4: M(4,3)=C4: 700 LOCATE 10,1: PRINT "-0.1 wave"
M(4,4)=D4 710 LOCATE 13,1: PRINT "-0.2 wave"
230 M(1,5)=F1: M(2,5)=F2: M(3,5)=F3: 720 LOCATE 14,13: PRINT "Center"
M(4,5)=F4 730 LOCATE 14,61: PRINT "Edge"
240 N=4: GOSUB 480: H=0: L=0 740 RETURN
250 A=M(1,5): B=M(2,5): C=M(3,5): 800 REM
D=M(4,5) 810 REM For IBM PCs with VGA graphics,
260 D=-A*R^6/4-B*R^4/3-C*R^2/2 this
270 GOSUB 570: LINE (H0,YC)-(H0+1,YC) 820 REM program analyzes the results of
280 FOR I=0 TO 1.001 STEP .05 a
290 X=I*R: 830 REM Foucault knife-edge test of a
Y=A*X^8/8+B*X^6/6+C*X^4/4+D*X^2/2 parab-
300 LINE -(H0+I*W1,YC-Y*W1) 840 REM oloidal telescope mirror, giving
310 REM PRINT "Zone ";I;TAB(20);"Surface the
error ";Y 850 REM surface and wavefront error in
320 IF Y>HI THEN HI=Y wave-
330 IF Y<LO THEN LO=Y 860 REM lengths of light. Written by
340 NEXT I Roger
350 PRINT 870 REM Sinnott, it is discussed in Sky
360 PRINT USING "Coefficient D: &
###.####";D 880 REM Telescope magazine for February,
370 PRINT USING "Surface error: 1990,
###.###";HI-LO 890 REM page 195.
380 PRINT USING "Wavefront
error:###.###";2*(HI-LO)
390 PRINT
400 INPUT "Want to try a different D (y
or n)";Q$ MODEL.BAS ; 076;
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 42 / 73
210 INPUT Q$: IF Q$<>"1" AND Q$<>"2" THEN 650 B3=443000*IM/(TH^3*D*F1): '
210 Diffraction
220 IF Q$="2" THEN 270 660 B4=2.6E+08*IM*EXP(-1*(TH/.4)^2)/F1: '
230 D=.5: ' Find minimum telescope By mirror
aperture 670 BG=B1+B2+B3+B4: ' Glare brightness
240 D=D+.1: M=25*D: GOSUB 290: IF MS>ML 680 ' Calculate effective background
THEN 240 brightness
250 PRINT "Aperture should be at 690 XX=1-.96*(SIN(Z/57.295))^2
least" ;D;" inches" 700 BN=180*(.4+.6/SQR(XX))/F1: ' Night
260 GOTO 280 sky
270 GOSUB 290: PRINT "Limiting magnitude 710 XX=10^(PH/1.571-1.1): IF XX<1 THEN
is ";ML XX=1
280 END 720 BT=XX*10^(8.45+.4*HS)*(F1-1)/F1: '
290 ' Routine to find lim. mag. for given Twilight sky
conditions 730 PM=10^5.36*(1.06+(COS(PH))^2): ' Mie
300 XX=COS(Z/57.295): ' First, estimate scattering
corrections 740 PA=10^(1.65+1.43*PH): ' Aerosol
310 X=1/(XX+.025*EXP(-11*XX)): ' Airmass scattering
of Moon 750 XX=-.4*K/(SQR(1-.96*(SIN((90-
320 ZE=SQR(2.89*X*SE^2+(17.9/D)^2):'2nd HS)/57.295))^2))
moment of image 760 BD=11700*10^XX*(PM+PA)*(F1-1)/F1: '
330 F1=10^(.4*K*X): ' Extinction Daytime sky
340 F2=1.41: ' Binocular vision 770 BS=BN+BT+BC: ' Sky brightness
350 F3=100/TR: ' Transmission of 780 IF BD<BT THEN BS=BN+BD+BC
scope 790 XX=.5*(1+C/ABS(C)): ' +1 if dark limb
360 DE=4: ' Guess that pupil is 4mm 800 YY=.5*(1-C/ABS(C)): ' +1 if bright
370 F4=(25.4*D/(M*DE))^2: ' Light outside limb
pupil 810 BA=BS+XX*(BE+BG)+YY*BM: ' Apparent
380 IF F4<1 THEN F4=1 brightness
390 F5=(DE/(25.4*D))^2: ' Light gathering 820 ' Condition of the observer's eye
power 830 R1=380*10^(.3*(BA/FB)^-.29): 'Night
400 XX=1-EXP(-.026*DE^2) resolution
410 YY=1-EXP(-.026*(25.4*D/M)^2) 840 R2=42*10^(8.28*(BA/FB)^-.29): 'Day-
420 F6=(25.4*D/(DE*M))^2*XX/YY:'Stiles- vision resol.
Crawford effect 850 RE=900/RS: IF R1<900 THEN RE=R1/RS
430 IF F6>1 THEN F6=1 860 IF R2<900 AND R2<R1 THEN RE=R2/RS
440 F7=(1+.03*(M*ZE/100)^2)/RS^2: ' 870 XX=1.85*(IM*.000929*FV/F1)/
Resolving the star (1.122^(M*TH))
450 FI=F1*F2*F3*F4*F5*F6*F7:' Corr. for 880 YY=EXP(-.16*(.000001*BA/FB+XX)^.4)
intensities 890 ZZ=7*EXP(-.5*(25/100)^2):'Standard
460 FB=M^2*F2*F3*F4*F5*F6:'Corr. for obsvr is age 25
surface brightness 900 DS=ZZ*YY: IF DS<2 THEN DS=2: 'Stand.
470 ' Calculate brightness of Moon pupil size
480 CP=SF/50-1 910 ZZ=7*EXP(-.5*(AG/100)^2): ' Dark
490 IF CP=0 THEN PH=3.14159/2: GOTO 520 pupil for obsvr
500 PH=ATN(SQR(1-CP*CP)/CP): ' Lunar 920 DE=ZZ*YY: IF DE<2 THEN DE=2: 'Pupil
phase (0 is full) size of obsvr
510 IF CP<0 THEN PH=PH+3.14159 930 ' Recalculate correction factors
520 DM=1.49*PH+.043*(PH^4)-12.73 : ' 940 F4=(25.4*D/(M*DE))^2: ' Light outside
Moon's magnitude pupil
530 IM=10^(-.4*(DM+16.57)): ' Intensity 950 IF F4<1 THEN F4=1
of Moon 960 F5=(DS/(25.4*D))^2: ' Light-
540 BM=5.67E+12*IM/(F1*SF): ' Moon gathering power
brightness (nL) 970 XX=1-EXP(-.026*DS^2)
550 SP=3.14159-PH: ' Earth's phase from 980 YY=1-EXP(-.026*(25.4*D/M)^2)
Moon 990 F6=(25.4*D/(DS*M))^2*XX/YY:'Stiles-
560 XX=1.49*SP+.043*(SP^4)-12.73 Crawford effect
570 BE=1.1E+07*10^(-.4*(XX+16.57))/F1: ' 1000 IF F6>1 THEN F6=1
Earthshine 1010
580 ' Calculate glare brightness F7=(1+.03*(M*ZE/RE)^2)/RS^2:'Resolving
590 XX=(COS(C/57.295))^2+(1- the star
SF/100+SIN(C/57.295))^2 1020 F8=10^(-.4*(1-.5*BV)): 'Color corr
600 YY=(1-.4*EXP(-1*C/30)) (night)
610 IF YY<.6 THEN YY=.6 1030 IF BA>1480 THEN F8=1: 'Color corr
620 TH=.25*SQR(XX)*YY: ' Effective (day)
distance to Moon 1040 FI=F1*F2*F3*F4*F5*F6*F7*F8: 'Corr
630 B1=6.25E+07*IM*(F1-1)/ for intensities
(TH*F1)^2:'Scattering in air 1050 FB=M^2*F2*F3*F4*F5*F6*F8: 'For
640 B2=4.63E+07*IM*(FV/100)/ surface brightness
(TH^2*F1):'Scat. in eye 1060 ' Calculate limiting magnitude
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 47 / 73
1040 X0=CA*CD: Y0=SA*CD: Z0=SD 240 S=SN: Q=QN: D=DN: DP=DN: SP=SN:
1050 REM 3-D transformation HN=SS*Q*Q
1060 X1=X0*XX+Y0*YX+Z0*ZX 250 F=C0-Q+C2*Q*Q: K1=HN*F: L1=HN*D
1070 Y1=X0*XY+Y0*YY+Z0*ZY 260 S=SN+HN/2#: Q=QN+L1/2#: D=DN+K1/2#
1080 Z1=X0*XZ+Y0*YZ+Z0*ZZ 270 F=C0-Q+C2*Q*Q: K2=HN*F: L2=HN*D
1090 REM Rectangular--> spherical 280 S=SN+HN/2#: Q=QN+L2/2#: D=DN+K2/2#
1100 A1=ATN(Y1/X1) 290 F=C0-Q+C2*Q*Q: K3=HN*F: L3=HN*D
1110 IF X1<0 THEN A1=A1+P1 300 S=SN+HN: Q=QN+L3: D=DN+K3
1120 IF A1<0 THEN A1=A1+2*P1 310 F=C0-Q+C2*Q*Q: K4=HN*F: L4=HN*D
1130 A1=A1/(R1*15): REM Final R.A. 320 QN=QN+(L1+2#*L2+2#*L3+L4)/6#
1140 D1=ATN(Z1/SQR(X1*X1+Y1*Y1)) 330 DN=DN+(K1+2#*K2+2#*K3+K4)/6#
1150 D1=D1/R1: REM Final Dec. 340 SN=SN+HN
1160 RETURN 350 PX=XC+SX*COS(SN)/QN: PY=YC-
2000 REM SY*SIN(SN)/QN
2010 REM This program for pre- 360 COLOR 9: PSET (PX,PY)
2020 REM cessing a star's coor- 370 IF EC*DN>0 AND DP<0 THEN GOSUB 410
2030 REM dinates is described in 380 IF INKEY$<>"" THEN END
2040 REM Sky & Telescope for 390 GOTO 240
2050 REM October, 1991, page 408. 400 '
2060 REM It was written by 410 ' DRAW LINE TO APASTRON & COUNT
2070 REM Zbigniew S. Krzeminski. ORBITS
420 COLOR 4: LINE (XC,YC)-(PX,PY)
430 N=N+1: LOCATE 1,56: COLOR 15
440 PRINT "Number of orbits ";N;
450 IF N>1 THEN GOTO 500
PULSAR.BAS ; 019; 460 SA=(SP+(SN-SP)*DP/(DP-DN))*180/PI-360
Relativistic precession in binary orbits 470 LOCATE 1,1: PRINT "Precession per
orbit"
480 IF SA<360 THEN PRINT USING
10 ' RELATIVISTIC PRECESSION "######.#### deg"; SA
20 DEFDBL A-Z 490 IF SA>=360 THEN PRINT USING "######.#
30 PI=4#*(ATN(1#)): XC=320: YC=165: deg"; SA
SCREEN 9: KEY OFF 500 RETURN
40 LOCATE 15,1: PRINT "Eccentricity (0 to 610 ' This program by Jonathan Gallmeier,
0.9) "; Mark Loewe, and
50 INPUT EC: IF EC<0 OR EC>.9 THEN CLS : 620 ' Donald W. Olson appeared in the
GOTO 40 article "Precession
60 LOCATE 17,1: PRINT "Relativity 630 ' and the Pulsar," Sky & Telescope,
strength (0 to 0.999)"; Oct. 1995, p. 86.
70 PRINT SPC(40);: LOCATE 17,34
80 INPUT SG: IF SG<0 OR SG>.999 THEN GOTO
60
90 LOCATE 19,1: PRINT "Simulation speed
(1 to 10)"; RAINBOW.BAS ; 037;
100 PRINT SPC(40);: LOCATE 19,28: INPUT Graphic simulation of a rainbow
SS
110 IF SS<1 OR SS>10 THEN GOTO 90
120 10 REM RAINBOW SIMULATION
SS=.0009#*(SS-.9#)*(1#-.9#*EXP(10#*EC- 20 REM
9#)) 25 R0=180/3.14159
130 CLS: LOCATE 19,1: PRINT 30 REM RANDOM IMPACT PARAMETER
"Eccentricity" 35 X=-1+2*RND(1)
140 PRINT USING " .######";EC; 40 Y=-1+2*RND(1)
150 LOCATE 22,1: PRINT "Relativity": 45 B=SQR(X*X+Y*Y)
PRINT "strength" 50 IF B>=1 THEN 30
160 PRINT USING " .######";SG;: LOCATE 55 REM COLOR & INDEX OF REFR.
25,52 60 C=1+INT(3*RND(1))
170 COLOR 14: PRINT "(Press any key to 65 N=1.33+.01*(C-1)
interrupt)"; 70 REM COMPUTE ANGLES
180 SY=YC/(1+EC): SX=SY*1.33 75 I=ATN(B/SQR(1-B*B))
190 C0=(1#-SG*(3#+EC*EC)/(6#+2#*EC))/(1#- 80 R=ATN(B/SQR(N*N-B*B))
EC*EC) 85 T1=(4*R-2*I)*R0
200 RH=SG*(1#-EC*EC)/(3#+EC): C2=1.5#*RH 90 T2=(6*R-2*I)*R0-180
210 CIRCLE (XC,YC),SX*RH,8: PAINT 95 REM INTENSITY FACTORS
(XC,YC),8 100 RS=(SIN(I-R)/SIN(I+R))^2
220 LINE (0,YC)-(640,YC),7: LINE (XC,0)- 105 RP=(TAN(I-R)/TAN(I+R))^2
(XC,350),7 110 RB=(1-RP)*(1-RP)
230 SN=0: QN=1#/(1#+EC): DN=0 115 RC=(1-RS)*(1-RS)
120 I1=(RS*RC+RP*RB)/2
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 53 / 73
250 IF DS<>0 THEN 270 830 ' the field will rotate for a
260 C=SGN(DD)*PI/2: GOTO 280: ' In telescope
case DS=0 840 ' whose polar axis is misaligned on
270 C=ATN(DD/DS): IF DS<0 THEN C=C+PI the
280 Q=C*RD: ' Parallactic angle in 850 ' celestial pole. This subject is
degrees discussed
290 IF T<>0 THEN 310 860 ' in detail in Sky & Telescope,
300 Q0=Q: Q1=Q: ' Save initial value September
of Q 870 ' 1992, page 318.
310 XX=Q-Q1: XT=Q-Q0
320 IF ABS(XX)<=180 THEN 340
330 XX=XX-360*SGN(XX): Q=Q-360*SGN(Q)
340 Q1=Q
350 IF T<>0 THEN GOSUB 470 SAROS.BAS ; 081;
360 IF T=0 THEN GOSUB 700 Saros numbers for solar eclipses
370 IF XT>MX THEN MX=XT
380 IF XT<MN THEN MN=XT
390 NEXT 10 REM SAROS SERIES
400 PRINT: PRINT "Cumulative field 14 REM
rotation: "; 18 PRINT
410 PRINT USING "####.## deg";MX-MN 22 INPUT "JULIAN DAY NUMBER";J
420 PRINT 26 Q=J/29.530588-82064
430 PRINT USING "Start alt. ### Az. 30 B=INT(Q): N=Q-B
###";H0;A0 34 IF N>0.28 AND N<0.36 THEN 42
440 PRINT USING "Ending alt. ### Az. 38 PRINT "WARNING: NOT NEW MOON!"
###";H;A 42 PRINT " BROWN LUNATION ";B
450 END 46 D=B-848
460 ' 50 S=136+38*D
470 IF LT>=24 THEN LT=LT-24 54 X=-61*D
480 PRINT USING " ##h ##m ";INT(LT);(LT- 58 C=INT(X/358+0.5-D/(12*358*358))
INT(LT))*60; 62 S=S+223*C
490 PRINT USING " Rotation +###.## 66 X=X-358*C
deg/min ";XX 70 IF ABS(X-(S-136)/12)<55 THEN 78
500 RETURN 74 PRINT "WARNING: NO ECLIPSE!"
510 ' Compute hour angle, altitude, 78 PRINT " SAROS NUMBER ";S
and azimuth 82 PRINT " RELATIVE ECLIPSE ";
520 HD=15*(1.002737*LT+ST-AD): ' Hour 86 PRINT INT(X-(S-136)/12+0.5)
angle (deg) 90 PRINT
530 IF HD>=360 THEN HD=HD-360 94 END
540 AH=HD*DR: CH=COS(AH): 95 REM ------------------------
SA=SL*SD+CL*CD*CH 96 REM APPEARED IN ASTRONOMICAL
550 IF ABS(SA)<1 THEN 580 97 REM COMPUTING, SKY & TELE-
560 IF ABS(SA)>1 THEN SA=1*SGN(SA) 98 REM SCOPE, OCTOBER, 1985
570 H=SA*90: GOTO 590: ' If zenith or 99 REM ------------------------
nadir
580 H=ATN(SA/SQR(1-SA*SA))*RD: ' Altitude
(degrees)
590 A1=SIN(AH): A2=CH*SL-TD*CL: IF A2<>0 SATRINGS.BAS ; 021;
THEN 610
Saturn ring-plane crossings
600 AZ=SGN(A1)*PI/2: GOTO 620: ' Special
case A2=0
610 AZ=ATN(A1/A2): IF A2<0 THEN AZ=AZ+PI 10 ' RINGS OF SATURN
620 AZ=AZ*RD+180: ' Azimuth in degrees 20 DEFDBL A-Z
from north 30 CLS: PI=4#*ATN(1#): RD=PI/180#: DL=9#
630 IF AZ>=360 THEN AZ=AZ-360 40 INPUT "Year of interest"; Y
640 RETURN 50 A=INT((Y-1#)/100#): B=2#-A+INT(A/4#)
650 ' Find approx. sidereal time at 60 IF Y<1583 THEN B=0
midnight 70 JD=INT(365.25*(Y+4715))
660 N=INT(275*M/9)-2*INT((M+9)/12)+J-30 +INT(30.6001*(14))
670 ST=(6.61+.06571*N)/24 80 JD=JD+B-1523.5
680 ST=(ST-INT(ST))*24: ' Express in 90 JE=JD+365#
hours 100 T=(JD-2451545#)/365250#
690 RETURN 110 I=(28.04922#-.13#*T+.0004#*T*T)*RD
700 ' Initialize values 120 OM=(169.53#+13.826#*T+.04#*T*T)*RD
710 MX=XX: MN=XX: A0=A: H0=H 130 GOSUB 550: ' Get planet positions
720 RETURN 140 X=SR*COS(SB)*COS(SL)-ER*COS(EL)
800 ' 150 Y=SR*COS(SB)*SIN(SL)-ER*SIN(EL)
810 ' ROTATE.BAS -- This program by 160 Z=SR*SIN(SB)-ER*SIN(EB)
Alphonse 170 DL=SQR(X*X+Y*Y+Z*Z)
820 ' Pouplier computes the rate at which
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 57 / 73
35 PRINT "If you are running GW Basic 50 GOSUB 760: PRINT D$: PRINT
expect it to take 10-times longer." 60 GOSUB 630
36 PRINT "A color graphics card is 70 INPUT "Universal time (h,m)";HH,MM
essential." 80 IF HH=99 THEN 110
85 INPUT "enter value of lambda"; P, Q 90 UT=HH+MM/60: REM UT in hours
90 INPUT "enter corner of region to be 100 GOSUB 140: GOTO 70
displayed"; ACORNER, BCORNER 110 END
100 INPUT "enter size of region"; SIDEX, 120 REM **** SUBROUTINES ****
SIDEY 130 REM
105 CLS 140 REM Compute details at time UT
106 SCREEN 1 150 T=UT+DT/3600-T0: REM "Element time"
107 COLOR 0, 2 160 X=FNX(T): REM x
110 GAPX = SIDEX / DX 170 Y=FNY(T): REM y
115 GAPY = SIDEY / DY 180 CD=FNC(T): REM cos(d)
210 '----- start main loops ----- 190 SD=FNS(T): REM sin(d)
220 FOR X = 1 TO DX 200 M=DR*FNM(T): REM mu
230 FOR Y = 1 TO DY 210 REM
260 AZ = (X * GAPX) + ACORNER 220 REM Now find H.A. in radians
270 BZ = (Y * GAPY) + BCORNER 230 H=M+LO-DT/13713
300 COUNT = 0 240 REM
302 EPBZ = EXP(BZ) 250 REM Now find xi, eta, zeta
303 EMBZ = 1 / EPBZ 260 X8=P9*SIN(H)
304 COSH = (EPBZ + EMBZ) / 2! 270 Y8=P8*CD-P9*SD*COS(H)
305 SINH = (EPBZ - EMBZ) / 2! 280 Z8=P8*SD+P9*CD*COS(H)
310 REAL = SIN(AZ) * COSH 290 U0=X-X8: REM u
315 IMAG = COS(AZ) * SINH 300 V0=Y-Y8: REM v
320 REALZ = P * REAL - Q * IMAG 310 L1=FNL1(T): REM l1
325 IMAGZ = Q * REAL + P * IMAG 320 L2=FNL2(T): REM l2
326 IMAGZ2 = IMAGZ * IMAGZ 330 W1=L1-Z8*F1: REM L1
330 ABSZ = SQR(IMAGZ2) 340 W2=L2-Z8*F2: REM L2
340 COUNT = COUNT + 1 350 REM
350 ' 360 REM Magnitude
360 ' check for divergence or count = 30 370 G1=SQR(U0*U0+V0*V0)
370 IF ((ABSZ > 30) OR (COUNT = 30)) 380 G=(W1-G1)/(W1+W2)
THEN 430 390 REM
380 AZ = REALZ 400 REM Position angle
390 BZ = IMAGZ 410 PA=RD*ATN(U0/V0)
400 GOTO 302 420 IF V0<0 THEN PA=PA+180
410 ' 430 IF PA<0 THEN PA=PA+360
420 ' set pixel color according to count 440 IF PA>360 THEN PA=PA-360
430 COLOUR = 1 + COUNT MOD 3 450 REM
550 IF (COUNT = 30) THEN COLOUR = 0 460 REM Sun's altitude
560 ' 470 A8=SD*SIN(LA)
600 '----- turn pixel on ----- 480 A8=A8+CD*COS(LA)*COS(H)
610 PSET (X, Y), COLOUR 490 AL=RD*ATN(A8/SQR(1-A8*A8))
620 ' 500 REM
630 NEXT Y 505 REM
640 NEXT X 510 REM Print out a line of data
700 END 520 REM
800 REM **************************** 530 UT=T-DT/3600+T0: REM "Element time"
810 REM FOR MORE INFORMATION ON THIS back to UT
PROGRAM, SEE THE 540 UT=UT+.5/3600: REM Round to whole
820 REM ARTICLE "COMPUTER CHAOS AT HOME" second
IN THE AUGUST, 550 HH=INT(UT): M3=60*(UT-HH): MM=INT(M3)
830 REM 1989, ISSUE OF SKY & TELESCOPE, 560 SS=INT(60*(M3-MM))
PAGE 139. 570 PA=INT(PA+.5): AR=INT(AL+.5): REM
840 REM **************************** Whole degrees
580 IF AL<0 THEN PRINT "Sun below
horizon": GOTO 610
590 IF G<0 THEN PRINT "No eclipse at this
time": GOTO 610
SOLARECL.BAS ; 034; 600 PRINT USING A2$;HH;MM;SS;PA;AR;G
Predictions of July 11, 1991, solar eclipse 610 RETURN
620 REM
630 REM Geocentric Coordinates of
10 REM LOCAL CIRCUMSTANCES OF A Observer
20 REM SOLAR ECLIPSE 640 REM
30 REM 650 INPUT "North latitude (deg) ";LA
40 DEFDBL A-Z 660 INPUT "East longitude (deg) ";LO
670 INPUT "Elevation (feet) ";EL
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 62 / 73
380 PH=A1-B1*R+A1*LOG(R)
390 X=MX*R*COS(PH+W+F)+XC STEPPR.BAS ; 087;
400 Y=MY*R*SIN(PH+W+F)*COS(I)+YC Controlling a stepper motor
410 REM PRINT X;Y
420 LINE -(X,Y)
430 NEXT J 10 REM STEPPER-MOTOR DEMO
440 RETURN 15 REM
450 REM ************************** 20 X=49152: REM PORT ADDRESS
460 REM APPEARED IN ASTRONOMICAL 25 DATA 9,1,3,2,6,4,12,8
COMPUTING 30 DIM A(8)
470 REM SKY & TELESCOPE - DECEMBER 1990 35 FOR I=0 TO 7: READ A(I): NEXT I
ISSUE 40 INPUT "START, STOP ";C,D
480 REM ************************** 45 FOR J=C TO D STEP SGN(D-C)
50 K=8*((J/8)-INT(J/8))
55 POKE X,A(K)
60 NEXT J
65 END
STAY.BAS ; 097; 70 REM ------------------------
Comet's time spent inside Earth's orbit 80 REM APPEARED IN ASTRONOMICAL
90 REM COMPUTING, SKY & TELE-
95 REM SCOPE, APRIL, 1985
10 REM LENGTH OF STAY 99 REM ------------------------
12 REM INSIDE 1 A.U.
14 REM
16 K=0.01720209895
18 P=3.1415926536
20 INPUT "PERIHELION DIST. ";Q STEREO.BAS ; 063;
22 INPUT "ECCENTRICITY ";E Plot stars in stereographic projection
24 PRINT
26 T=0
28 IF E>1 OR E<0 THEN 22 1 REM STEREOGRAPHIC SKY PROJECTION
30 IF Q>=1 THEN 78 2 P=3.14159265: R1=P/180
32 IF Q<0.0046524 THEN 82 3 INPUT "RADIUS ";K
34 IF E<1 THEN 54 4 INPUT "LAT, LONG ";B,L
36 REM 5 REM W LONG NEG, E LONG POSITIVE
38 REM PARABOLIC CASE 6 B=B*R1: L=L*R1
40 REM 7 INPUT "LST (H,M,S) ";A$,A2,A3
42 T2=1/Q-1 8 GOSUB 72: T=A*15*R1-L
44 T1=SQR(T2) 10 INPUT "OBJECT NAME ";B$
46 Q3=Q*Q*Q 12 INPUT "RA (H,M,S) ";A$,A2,A3
48 T=SQR(2*Q3)*(3*T1+T1*T2)/(3*K) 14 GOSUB 72: R=A*15*R1
50 GOTO 78 16 INPUT "DEC (D,M,S) ";A$,A2,A3
52 REM 17 GOSUB 72: D=A*R1
54 REM ELLIPTICAL CASE 18 PRINT: PRINT B$
56 REM 19 GOSUB 32: GOSUB 100
58 IF E=0 THEN 86 20 PRINT: PRINT "STARS"
60 IF Q*(1+E)/(1-E)<=1 THEN 86 21 N=8: REM NUMBER OF STARS
62 A=Q/(1-E) 22 FOR I=1 TO N
64 C=(A-1)/(A*E) 23 READ R,D
66 IF C<>0 THEN 70 24 R=R*15*R1: D=D*R1
68 E1=P/2: GOTO 76 25 GOSUB 32: GOSUB 100
70 S=SQR(1-C*C) 26 NEXT I
72 E1=ATN(S/C) 29 END
74 IF C<0 THEN E1=E1+P 30 REM ALTITUDE AND AZIMUTH
76 T=A*SQR(A)*(E1-E*SIN(E1))/K 32 T5=T-R+L: REM LOCAL HR ANGLE
78 PRINT "DAYS: ";2*T 34 S1=SIN(B)*SIN(D)
80 GOTO 88 36 S1=S1+COS(B)*COS(D)*COS(T5)
82 PRINT "COLLISION WITH SUN" 38 C1=1-S1*S1
84 GOTO 88 40 IF C1>0 THEN C1=SQR(C1)
86 PRINT "ALWAYS INSIDE 1 A.U." 42 IF C1<=0 THEN 46
88 END 44 H=ATN(S1/C1): GOTO 48
90 REM ------------------------ 46 H=SGN(S1)*P/2
92 REM APPEARED IN ASTRONOMICAL 48 C2=COS(B)*SIN(D)
94 REM COMPUTING, SKY & TELE- 50 C2=C2-SIN(B)*COS(D)*COS(T5)
96 REM SCOPE, JULY, 1984 52 S2=-COS(D)*SIN(T5)
98 REM ------------------------ 54 IF C2=0 THEN A=SGN(S2)*P/2
56 IF C2=0 THEN 62
58 A=ATN(S2/C2)
60 IF C2<0 THEN A=A+P
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 65 / 73
780 IF AZ>360 THEN AZ=AZ-360 1390 ' discussed in Sky & Telescope for
790 PRINT USING ", azimuth ###.#";AZ August 1994, page 84.
800 RETURN
810 '
820 ' Special-message routine
830 IF M8=0 AND W8=0 THEN 870
840 IF M8=0 THEN PRINT M1$ SUPERNUM.BAS ; 006;
850 IF W8=0 THEN PRINT M2$ Emergence angles of supernumerary rainbows
860 GOTO 890
870 IF V2<0 THEN PRINT M3$
880 IF V2>0 THEN PRINT M4$ 10 REM SUPERNUM.BAS
890 RETURN 20 REM by Rodney Kubesh
900 ' 30 OPEN "BOW.DAT" FOR OUTPUT AS #1
910 ' Fundamental arguments 40 CLS
920 ' (Van Flandern & 50 PI=3.14159
930 ' Pulkkinen, 1979) 60 A0=1.5707288# : A1=-.2121144
940 L=.779072+.00273790931*T 70 A2=.074261 : A3=-.0187293
950 G=.993126+.0027377785*T 80 N=1.3318 : REM Refractive index
960 L=L-INT(L): G=G-INT(G) 90 RA=250 : REM Drop radius in microns
970 L=L*P2: G=G*P2 100 L=.6563 : REM Wavelength in microns
980 V=.39785*SIN(L) 110 FOR J=450 TO 550
990 V=V-.01000*SIN(L-G) 120 REM Choose angle of incidence for ray
1000 V=V+.00333*SIN(L+G) A
1010 V=V-.00021*TT*SIN(L) 130 I=J*.1*PI/180
1020 U=1-.03349*COS(G) 140 AN=SIN(I)/N
1030 U=U-.00014*COS(2*L) 150 REM Snell's Law gives angle of
1040 U=U+.00008*COS(L) refraction
1050 W=-.00010-.04129*SIN(2*L) 160 R=PI/2-(1-
1060 W=W+.03211*SIN(G) AN)^.5*(A0+A1*AN+A2*AN^2+A3*AN^3)
1070 W=W+.00104*SIN(2*L-G) 170 TH=4*R-2*I
1080 W=W-.00035*SIN(2*L+G) 180 LOCATE 12,15
1090 W=W-.00008*TT*SIN(G) 190 PRINT "Computing intensity for
1100 ' emergence angle = ";
1110 ' Compute Sun's RA and Dec 200 PRINT USING "###.##"; TH*180/PI
1120 S=W/SQR(U-V*V) 210 REM D and S are path lengths outside
1130 A5=L+ATN(S/SQR(1-S*S)) the drop for ray A
1140 S=V/SQR(U):D5=ATN(S/SQR(1-S*S)) 220 D=1-COS(I)
1150 R5=1.00021*SQR(U) 230 X0=-COS(4*R-I) : Y0=-SIN(4*R-I)
1160 RETURN 240 X1=X0 : X2=X0-1 : X3=X0-2
1165 ' 250 Y1=Y0-1/TAN(TH)
1170 ' Calendar --> JD 260 Y2=Y0
1180 INPUT "Year, Month, Day";Y,M,D 270 Y3=Y0-2*TAN(TH)
1190 G=1: IF Y<1583 THEN G=0 280 S1=(Y2-Y1)/(X2-X1)
1200 D1=INT(D): F=D-D1-.5 290 S2=(Y3-Y0)/(X3-X0)
1210 J=-INT(7*(INT((M+9)/12)+Y)/4) 300 I2=I
1220 IF G=0 THEN 1260 310 X=(Y0-Y1+S1*X1-S2*X0)/(S1-S2)
1230 S=SGN(M-9): A=ABS(M-9) 320 Y=(X-X1)*S1+Y1
1240 J3=INT(Y+S*INT(A/7)) 330 S=((Y-Y0)^2+(X-X0)^2)^.5
1250 J3=-INT((INT(J3/100)+1)*3/4) 340 REM Find total path length
1260 J=J+INT(275*M/9)+D1+G*J3 350 P1=RA*(D+S+4*N*COS(R))
1270 J=J+1721027+2*G+367*Y 360 IN=59.5
1280 IF F>=0 THEN 1300 370 REM Choose possible angles of
1290 F=F+1: J=J-1 incidence for ray B
1300 RETURN 380 IN=IN+.05
1310 ' 390 I=IN*PI/180
1320 ' This program by Roger W. Sinnott 400 AN=SIN(I)/N
calculates the times of sunrise 410 R=PI/2-(1-
1330 ' and sunset on any date, accurate AN)^.5*(A0+A1*AN+A2*AN^2+A3*AN^3)
to the minute within several 420 REM Find companion rays emerging in
1340 ' centuries of the present. It same direction
correctly describes what happens in 430 TL=ABS(TH-4*R+2*I)
the 440 IF TL>.001 GOTO 380
1350 ' arctic and antarctic regions, 450 TH=4*R-2*I
where the Sun may not rise or set on 460 REM Path lengths D and S for ray B
1360 ' a given date. Enter north 470 D=1-COS(I)
latitudes positive, west longitudes 480 X0=-COS(4*R-I) : Y0=-SIN(4*R-I)
1370 ' negative. For the time zone, 490 X3=X0-2
enter the number of hours west of 500 Y3=Y0-2*TAN(TH)
1380 ' Greenwich (e.g., 5 for EST, 4 for 510 S1=(Y2-Y1)/(X2-X1)
EDT). The calculation is
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 69 / 73
870 DATA "A VIR", 201.298, -11.161 30 FOR I=1 TO 5 : READ WA(I) : NEXT I
875 DATA "A BOO", 213.915, 19.183 40 DATA 0.365, 0.44, 0.55, 0.7, 0.9
880 DATA "A SCO", 247.352, -26.432 50 FOR I=1 TO 5 : READ MO(I) : NEXT I
885 DATA "A LYR", 279.234, 38.784 60 DATA -10.93, -10.45, -11.05, -11.90,
890 DATA "A AQL", 297.695, 8.868 -12.70
895 DATA "A CYG", 310.358, 45.280 70 RD=3.14159/180.0
900 DATA "A PSA", 344.413, -29.622 80 REM Input for Moon and Sun
1000 REM ************************** 90 AM=180.0 : REM Moon phase (deg.; 0=FM,
1010 REM FROM SKY & TELESCOPE, FEBRUARY, 90=FQ/LQ, 180=NM)
1989, 100 ZM=180.0 : REM Zenith distance of
1020 REM PAGES 194-196. LINES 760 AND 795 Moon (deg.)
1030 REM CONTAINED ERRORS AS PRINTED IN 110 RM=180.0 : REM Angular distance to
THE Moon (deg.)
1040 REM MAGAZINE; THEY ARE CORRECTED 120 ZS=180.0 : REM Zenith distance of Sun
HERE. (deg.)
1050 REM ************************** 130 RS=180.0 : REM Angular distance to
Sun (deg.)
140 REM Input for the Site, Date,
Observer
150 RH=40.0 : REM relative humidity (%)
TRACK.BAS ; 078; 160 TE=15.0 : REM Air temperature (deg.
Astrophoto tracking tolerances C)
170 LA=30.0 : REM Latitude (deg.)
180 AL=1000.0 : REM Altitude above sea
10 REM TRACKING TOLERANCES level (m)
12 REM 190 M=2.0 : REM Month (1=Jan, 12=Dec)
14 R=3.14159265/180: REM RAD/DEG 200 Y=1998.0 : REM Year
16 K=206265: REM ARC SEC/RAD 210 SN=1.0 : REM Snellen Ratio
18 INPUT "WITH DRIVE (Y OR N)";Q$ (20/20=1.0, good 20/10=2.0)
20 IF Q$="Y" THEN 26 220 INPUT "Zenith distance (deg.): ";Z
22 INPUT "DECLINATION (DEG)";D 230 GOSUB 1000 : REM Extinction
24 M=360*COS(D*R): GOTO 30 240 GOSUB 2000 : REM Sky
26 INPUT "MOTION (DEG/DAY)";M 250 REM Visual limiting magnitude
28 IF M=0 THEN 26 260 BL=B(3)/1.11E-15 : REM in
30 INPUT "E.F.L. (MM)";F nanolamberts
32 INPUT "FILM GRAIN (F OR C)";A$ 270 IF BL>1500.0 THEN GOTO 300
34 IF A$<>"F" AND A$<>"C" THEN 32 280 C1=10.0^-9.8: C2=10.0^-1.9
36 INPUT "ENLARGEMENT FACTOR";E 290 GOTO 310
38 INPUT "PLANNED EXP (MIN)";T 300 C1=10.0^-8.350001 : C2=10.0^-5.9
40 S=1/(R*F*E): REM DEG/MM 310 TH=C1*((1.0+SQR(C2*BL))^2.0) : REM in
42 R1=M/(S*24*60): REM MM/MIN foot-candles
44 IF A$="F" THEN G=K/(F*100) 320 MN=-16.57-2.5*(LOG(TH)/LOG(10))-
46 IF A$="C" THEN G=K/(F*20) DM(3)+5.0*(LOG(SN)/LOG(10))
48 PRINT 330 PRINT : REM Write results and stop
50 PRINT "MOTION IN ";T;" MIN EXP:" program
52 PRINT " ";INT(T*R1*S*3600+0.5); 340 PRINT USING "Visual Sky Brightness
54 PRINT " ARC SEC, OR" (nL): ######"; BL
56 PRINT " ";T*R1;" MM ON PRINT" 350 PRINT USING "Visual Limiting
58 PRINT "LIMITS BASED ON GRAIN:" Magnitude: ###.##"; MN
60 PRINT " MAX EXPOSURE "; 360 END
62 PRINT G/(S*3600*R1);" MIN" 1000 REM Extinction Subroutine
64 PRINT " RESOLUTION "; 1010 FOR I=1 TO 5: READ OZ(I): NEXT I
66 PRINT INT(G+0.5);" ARC SEC" 1020 DATA 0.000, 0.000, 0.031, 0.008,
68 END 0.000
70 REM ------------------------ 1030 FOR I=1 TO 5: READ WT(I): NEXT I
80 REM APPEARED IN ASTRONOMICAL 1040 DATA 0.074, 0.045, 0.031, 0.020,
90 REM COMPUTING, SKY & TELE- 0.015
95 REM SCOPE, FEBRUARY, 1986 1050 LT=LA*RD
99 REM ------------------------ 1060 RA=(M-3)*30.0*RD
1070 SL=LA/ABS(LA)
1080 REM Airmass for each component
1090 ZZ=Z*RD
1100 XG=1/(COS(ZZ)+.0286*EXP(-
VISLIMIT.BAS ; 007; 10.5*COS(ZZ)))
1110 XA=1/(COS(ZZ)+.0123*EXP(-
Visual limiting magnitude from any site
24.5*COS(ZZ)))
1120 XO=1/SQR(1.0-(SIN(ZZ)/
10 REM VISLIMIT.BAS Visual Limits (1.0+(20.0/6378.0)))^2)
20 REM by Bradley E. Schaefer 1130 REM UBVRI extinction for each
component
Recopilation by AMA BASIC Programs fromSky & Telescope pág. 72 / 73