This program was derived from a 16K RAM version and compacted to fit a standard computer without the use of a RAM pack. A few notes should be made: K1, K2, and K3 are constants. K1 changes each year — see the K1 Constants chart to figure out which one to use. LONG is your longitude in decimal hours. TZ is the difference in hours between your time zone and Greenwich. GMST is Greenwich Mean Sidereal Time and LMST is the Local Mean Sidereal Time.
To calculate the day of the year which is needed in the sidereal time program add the day of the month to the following monthly base numbers: January 0, February 31, March 59, April 90, May 120, June 151, July 181, August 212, September 243, October 273, November 304, December 334. Remember that in leap years you increase the day number by 1 for all dates after February.
This program listing is actually three separate programs that have been stringed together and all REM statements were deleted to make this program as compact as possible. As it turned out, there is still plenty of room left to make additional changes or modifications left up to the user’s delight. I left lines 0 through 9 blank in the beginning of this program to allow room for one to construct some sort of menu or subroutine to select or default to a particular subprogram within the main body. It should be noted that the variables in the three separate subprograms are not linked with each other, meaning you may have to remember the output of the sidereal time routine and plug the values in the next set of computer prompts. This is not much of a problem if you have good short term memory as most people do. The entry points for each of the three programs are line 10 for Local Mean Sidereal Time, line 32 for Right Assensition and Decimal Calculation, and line 59 for Altitude/Azimuth Conversion. The K1 constants are listed in the table below.
K1 Constants
1983 6.60649392 * 1984 6.59057904 1985 6.64037496 1986 6.62446008 1987 6.60854592 * 1988 6.59263200 1989 6.64242696 1990 6.62651304 1991 6.61099792 * 1992 6.59468400 1993 6.64447896 1994 6.62856504 1995 6.61265112 * 1996 6.59673600 1997 6.64653192 1998 6.63061704 1999 6.61470312 * 2000 6.59878800
The * denotes leap years and also note that the LAT, LONG, and TX variables for example may be set for a geographical location other than where you live to check on the correct variables where you will be setting up shop. A good place to check is the local college or university Astronomy Department. Also the local library has lots of Geo. tables for star buffs.
Editor’s Note: In case you haven’t noticed, my monthly column has been called off lately due to a few weeks vacation and also I was in the process of moving to a new residence. Now that things are somewhat back to normal I will have more time to devote to Hardware/Software projects. Upcoming projects include how to construct a simple light pen minimizing hardware and making strategic use of software to do the job. A light pen is a device that allows you to select menu choices right from the monitor screen without touching the keyboard.
I hope that all of you will find this challenging and helpful in your quest for bigger and better adventures in the computing power of your Timex/Sinclair. If any bugs or errors pop up, please feel free to address them to me or slip a correction notice in the monthly newsletter. This program is copyrighted, and is intended for free distribution via tapes or listings to all who wish to use it. Modifications or corrections during distribution are solicited.
Happy Gazing
Donald Mayes, Jr.
New Twisted Pair
[phone number omitted]
0--------------------
1
2
3
4
5 Your menu here
6
7
8
9---------------------
10 LET K1 = 6.60649392
11 LET K2 = .0657098232
12 LET K3 = 1.0027379093
13 LET LONG = 5.1234
14 LET TZ = 5
15 PRINT " DAY OF THE YEAR " ;
16 INPUT D
17 PRINT " LOCAL TIME (HOURS) ";
18 INPUT H
19 PRINT " LOCAL TIME (MINUTES) ";
20 INPUT M
21 PRINT " LOCAL TIME (SECONDS) ";
22 INPUT S
23 PRINT
24 LET SDT = H+(M/60)+(S/3600)
25 LET UT = SDT+TZ
26 LET GMST = K1+(K2*D)+(K3*UT)
27 IF GMST > 24 THEN GMST=GMST-24:GOTO 27
28 LET LMST = GMST-LONG
29 PRINT " LOCAL MEAN TIME = "; SDT
30 PRINT " GMST = "; GMST
31 PRINT " LMST = "; LMST
32 LET LAT = 40.1234
33 LET RAD = 57.295775135
34 PRINT
35 PRINT " ALTITUDE " ;
36 INPUT ALT
37 PRINT " AZIMUTH " ;
38 INPUT AZ
40 PRINT " LOCAL SIDEREAL TIME (DECIMAL HOURS) ";
41 INPUT LMST
42 LET A = ALT/RAD
43 LET AZR = AZ/RAD
44 LET L = LAT/RAD
45 LET D = (SIN(A)*SIN(L))+(COS(A)*COS(L)*COS(AZR))
46 LET DC = ATN (D/SQR(-D*D+1))
47 LET H = (SIN(A)-(SIN(L)*D))/(COS(L)*COS(DC))
48 LET HC = -ATN(H/SQR(-H*H+1))+1.5708
49 LET DEC = DC*RAD
50 LET HA = HC*RAD
51 IF FLAG = 1 GOTO 330
52 IF SIN(HC)>0 THEN HA=360-HA
53 LET HAH = HA/15
54 LET RA = LMST-HAH
55 IF RA<0 THEN RA = RA+24: GOTO 55
56 PRINT
57 PRINT " RA= ";RA
58 PRINT " DEC= ";DEC
59 LET LAT = 40.1234
60 LET RAD = 57.295775135
61 PRINT " RA (HOURS) " ;
62 INPUT RH
63 PRINT " RM (MINUTES) ";
64 INPUT RM
65 PRINT " RA (SECONDS) ";
66 INPUT RS
67 LET RA=RH + (RM/60)+(RS/3600)
68 PRINT
69 PRINT " DEC (DEGREES) ";
70 INPUT DD
71 PRINT " DEC (MINUTES) ";
72 INPUT DM
73 PRINT " DEC(SECONDS) ";
74 INPUT DS
75 LET DEC=DD+(DM/60)+(DS/3600)
76 PRINT
77 PRINT " LMST (DECIMAL HOURS) " :
78 INPUT LMST
79 PRINT
80 LET HA = LMST-RA
81 LET HAD = HA*15
82 LET L = LAT/RAD
83 LET H = HAD/RAD
84 LET D = DEC/RAD
85 LET A = (SIN(D)*SIN(L))+(COS(D)*COS(L)*COS(H))
86 LET AA = ATN(A/SQR(-A*A+1))
87 LET ALT = AA*RAD
88 LET AZ = (SIN(D)-(SIN(L)*SIN(A)))/(COS(L)*COS(A))
89 LET AZA = -ATN(AZ/SQR(-AZ*AZ+1))+1.5708
90 LET AZM = AZA*RAD
91 IF SIN(H)>0 THEN AZM = 360-AZM
92 PRINT " ALTITUDE = "; ALT
93 PRINT " AZIMUTH = "; AZM
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.