IntroductionAs an amateur astronomer it is often useful to know the approximate positions of the Sun, Moon and planets to decide whether it will be worth going outside to observe them. Knowing their altitudes and azimuths can be particularly helpful in determining whether they will be accessible from your observing site. There are several programs available for the PC and other platforms which will calculate data for solar system objects and produce detailed sky displays, complete with stars, constellation boundaries, etc. Though these programs can be very useful, it takes time to wait for the PC to boot up, find the CD-ROM, start the program, sit through the introduction animation, choose a planet, view its coordinates... and after all that Red Shift 3 which I use does not seem to have any way of reporting a planet's altitude in degrees so I cannot tell if it will clear the rooftops across the road. On the other hand a fairly small program running on a programmable calculator can find all the relevant data to a sufficient accuracy and is quicker to use. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AstroCalc on the hp 39g+ Graphing CalculatorAstroCalc is a set of routines that run on a Hewlett-Packard 39g+ calculator and will calculate the following properties for the main solar system objects (i.e. Sun, Moon, planets Mercury to Neptune, plus dwarf planets Ceres, Pluto and Eris.):
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Loading AstroCalcCopy the files HP39DIR.000, HP39DIR.CUR, and all those with names starting with AST... and ending in /000 to an empty directory on a PC, start the HP39G Connectivity program and point it to the directory holding the files. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Running AstroCalcBefore running AstroCalc for the first time it is recommended that you edit the settings in the program listing to customise it for your own location. Choose AstroCalc in the program catalog then press softkey 1 to EDIT.
![]() Section of program to edit to suit your own observing location. Note on time zones: Roughly speaking, for every 15 degrees of longitude East of the Greenwich meridian the time zone increases by one hour, and for every 15 degrees West of Greenwich it decreases by one hour. For example the east coast of the US is about 75 degrees west of Greenwich and the time zone is -5 so this is the number to store in L0(4). However not all countries keep to the rule of 15 degrees = ± 1 hour so you need to consult an atlas to be certain. India is especially unusual in that its time is GMT +5 hours 30 minutes. Also, when using the 'current time' as set in the calculator's clock, it is assumed that this is the local time, with the same offset from GMT as stored in L0(4). Thus, if you have changed the calculator's built-in clock to Daylight Saving Time, (by storing to the variable TIME) you also need to add 1 to the value stored to L0(4), otherwise calculated positions for the current time will be wrong. The longitude and latitude need to be reasonably accurate (say to within a tenth of a degree) or the sunrise and sunset times especially will be in error. An atlas should provide sufficient precision. You may need to use the calculator's Hours.MinutesSeconds to Decimal Degrees conversion before entering the values into the program. Once the program has been configured, run AstroCalc from the PROGRAM catalog. Once it has compiled a choose box appears on the screen with seven options (scroll down to get the last three) as shown in figure 1. ![]() ![]() Figure 1 - Main AstroCalc menu, both pages. Calculate and display option is selected as default. The menu options have the following meanings:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hardware RequirementsAstroCalc runs on a Hewlett-Packard 39g+ calculator. It should also work on the 39g and 40g but will take about three times as long to calculate positions, due to the slower processor. It is written in HP-BASIC and may work on the 48g, 49g and 50g but has not been tried. The program takes up around 34 kilobytes of RAM when run. It also uses 1.4 kilobytes to store matrix M9 and list L0 This means the calculator must have about 36 kilobytes of free RAM to run AstroCalc. This, plus use of the DISPXY command, rules it out for the 38g model. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AccuracyIn general calculated positions, i.e. right ascensions, declinations, altitudes and azimuths, should be correct to within a few minutes of arc for dates close to the epoch of the orbital data (year 2000 – see later). Accuracy decreases the further into the past or future we try to calculate positions, since many of the sources of error have a cumulative effect over time. E.g. if the figure for the orbital period of the Earth is in error by 1 part in 100 000, then after 1000 years the error will be 1 part in 100 or over 3 degrees of longitude. Also no allowance is made for precession of the equinoxes, nor for long-term changes in planetary orbits. The Moon is likely to show the greatest discrepancy since its orbit is subject to complicated perturbations. Generally the program is not sufficiently accurate more than a few centuries either side of year 2000. However targets should be within the low magnification field of view of a telescope pointed at the reported coordinates. There are several minor corrections which are not made by AstroCalc, in order to keep the size of the program down and the speed up. These include:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variables UsedThe simple programming model of HP BASIC limits variable names to a single character and does not allow local variables, so care is needed when using variables in subroutines. AstroCalc uses all the HOME variables A-Z plus some others, and will therefore overwrite any existing information stored in them. Some variable names are used as a general-purpose temporary scratchpad but others have a fairly consistent purpose. The variables changed by the program are:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Known BugsThere are some unwanted pixels set on the first line of the table display, near the first letter of the day of the week. Seems to be a mis-feature of the 39g+ due to wrap-around of letters off the screen. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Orbital ElementsThe orbits of the planets are calculated from their 'orbital elements' for the date 2000 January 1 12:00 UT ('January 1.5'), julian day number 2451545, known as the 'epoch' of the elements. The orbital elements, with their symbols, are as follows:
The table below lists the orbital elements of the eight planets in the solar system, plus three dwarf planets (Ceres, Pluto, Eris) for the epoch 2000 January 1.5. Surprisingly, different sources quote slightly different values for these elements, such as an orbital period for Pluto ranging from 246.7 to 248.0 years, and some of the data for Eris will still have a fairly large uncertainty since this dwarf planet was only discovered a few years ago and has only completed a very small part of its orbit.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Component ProgramsThe individual subprograms which make up AstroCalc are listed below in a readable format, with comments on parameters passed to and from them and their purpose. |
Program Listings | Explanation |
---|---|
Program AstroCalcERASE:DISP 1;" AstroCalc":¿ {0,0,0,0,0,0}ÞL0:¿ MAKEMAT(0,12,15)ÞM9:¿ -2.298ÞL0(1):¿ 53.596ÞL0(2):¿ 100ÞL0(3):¿ 1ÞL0(4):¿ 2000ÞL0(5):¿ QUOTE((X+L0(4)) MOD 24)ÞF0(X): QUOTE(X MOD 360)ÞF9(X): QUOTE(X MOD 24)ÞF8(X): ¿ 1ÞAngle:2ÞDigits:¿ L0(5)ÞY:1ÞM:0ÞD:0ÞT:¿ RUN ".AstJDN":¿ (J-2451545)/36525ÞT:¿ 23.439292-(46.815*T+0.0006*T²-0.00181*T*T²)/3600ÞL0(6):¿ 1ÞO:¿ DO¿ IF O==1 THEN DISP 3;"Using current date":WAIT 1: ¿ HMS®(TIME)-L0(4)ÞT:¿ ROUND(FRAC(DATE*100)*10000,0)ÞY:¿ INT(DATE)ÞM:¿ INT(FRAC(DATE)*100)ÞD:¿ END:¿ ERASE:3ÞO:¿ CHOOSE O;"AstroCalc";"Use Sys Date";" New Date/Time";"Calculate/Disp";"Exit program"; "Location...";"Easter Sunday";"Julian Day":¿ IF O==2 THEN¿ INPUT Y;"New Date";"Year";"Format '2006'";Y:¿ INPUT M;"New Date";"Month";"Format '5'";M:¿ INPUT D;"New Date";"Date";"Format '21'";D:¿ 2ÞFormat:INPUT T;"New Time";"Local Time"; "Format 'HH.MM'"; ROUND(®HMS(F0(T)),2): 1ÞFormat:HMS®(T)-L0(4)ÞT:¿ DISP 3;"Using new time":WAIT 1: ¿ END: ¿ IF O==5 THEN 2ÞFormat: ¿ INPUT L;"Location";"Longitude"; "Format 'Degs.Mins' W -ve, E +ve"; ROUND(®HMS(L0(1)),2): HMS®(L)ÞL0(1):¿ INPUT L;"Location";"Latitude"; "Format 'Degs.Mins' N +ve, S -ve";ROUND(®HMS(L0(2)),2): HMS®(L)ÞL0(2):¿ 1ÞFormat:¿ INPUT L;"Location";"Time Zone"; "Hours ahead + or behind - GMT";L0(4): HMS®(L)ÞL0(4): ¿ DISP 3;"New location stored":WAIT 1:¿ END: ¿ IF O==6 THEN RUN ".AstEast":¿ END:¿ IF O==7 THEN RUN ".AstJul":¿ END:¿ IF O==3 THEN¿ ERASE:DISP 1;"Calculating":¿ DISP 3;" Planets":RUN ".AstPlan":¿ DISP 4;" Moon":RUN ".AstMoon":RÞM9(2,1): EÞM9(2,2):SÞM9(2,9):NÞM9(2,10):PÞM9(2,11): ZÞM9(2,12):R*15ÞM9(2,15): ¿ RUN ".AstMoRS":¿ DISP 5;" Sun":RUN ".AstSun":RÞM9(1,1): EÞM9(1,2):-26.74+LOG(K²)/LOG(2.512)ÞM9(1,9): NÞM9(1,10):1ÞM9(1,11):KÞM9(1,12):¿ RUN ".AstSRS":¿ DISP 6;" Alt/Az":RUN ".AstU2LS":¿ FOR P=1 TO 12;¿ M9(P,1)ÞR:M9(P,2)ÞE:¿ RUN ".AstEq2A":AÞM9(P,3):ZÞM9(P,4):¿ END:¿ RUN ".AstCulm":¿ RUN ".AstDOW":¿ 1ÞC:1ÞR:¿ BEEP 1500;0.3:BEEP 1300;0.5:¿ DO RUN ".AstDisp":¿ GETKEY O:¿ R-5*(O==25.1)+5*(O==35.1)ÞR:¿ IF R<1 THEN 11ÞR:END:IF R>11 THEN 1ÞR:END: ¿ IF O==34.1 OR O==36.1 THEN (C+2*(O-35.1)) MOD 14ÞC:END: ¿ UNTIL O==105.1 OR O==31.1 END:¿ 3ÞO:END:¿ UNTIL O==4 END: |
This is the main routine and the one which is run directly to start AstroCalc. It calls the other routines as needed. Matrix M9 is used to store the calculated results ready for display. List L0 holds various constants used by the program. These are:
Note that all times input by and displayed to the user are local civil times but internally the program uses Universal Time (essentially the same as Greenwich Mean Time), converting to and from civil time as needed. A menu is then displayed which allows a new date and time or new location to be entered, the current date to be re-read or the positions of the Sun, Moon and Planets to be calculated and displayed in tabular form. Once the results are being displayed they can be scrolled around using the cursor keys, or pressing ENTER or HOME returns to the menu. Selecting 'Exit Program' from the menu returns to the calculator's program screen or home screen, depending on where AstroCalc was called from. Three functions are also defined, to be used in the subroutines. These are:
Note that if further menu options, with numbers above 7, are added to the main menu, the code to deal with them needs to be placed before that for option 3 (...O==3...), and the value of variable O (the selected option number) should not be changed by them. |
Program .AstDOWRUN ".AstJDN":¿ INT(J-(F0(T))/24+2.5) MOD 7ÞW:¿ |
Calculates the day of the week of the current date. On entry Y=year, M=month, D=date in month, T=local time. Returns W=day of week where 0=Sunday, 1=Monday etc. |
Program .AstJDNY+(Y<0)ÞQ:MÞJ:¿ IF M<2.1 THEN Q-1ÞQ: J+12ÞJ:END:¿ (2-INT(Q/100)+INT(Q/400))*((Y*10000+M*100+D) ³15821015)+INT(365.25*Q-0.75*(Q<0))+ INT(30.6001*(J+1))+D+ 1720994.5+T/24ÞJ:¿ |
Calculates the Julian Day Number (JDN)of the current date and time. JDN is defined as the number of days since Greenwich noon on January 1st 4713 B.C. This year was chosen because it predates all known astronomical observations so JDN is always positive. The usefulness of Julian Day Numbers is that they make it easy to calculate the number of days between two dates, just by the difference between their JDNs. This routine takes account of the change to the Gregorian calendar on 15th October 1582 and thus works for any date from 1 AD onwards. On entry Y=year, M=month, D=date in month, T=Universal time. Returns J=Julian Day Number. |
Program .AstU2LSTÞX:0ÞT:¿ RUN ".AstJDN":¿ (J-2451545)/36525ÞT:¿ F8(6.697374558+2400.051336*T+ 0.000025862*T²)ÞT:¿ F8(X*1.002737909+T)ÞT:¿ F8(T+L0(1)/15)ÞL:¿ XÞT:¿ |
Converts Universal Time to Local Sidereal Time. A sidereal day is the time between successive transits of the line of the vernal equinox, approximately equal to the time the Earth takes to rotate once on its axis, 23 hours and 56 minutes and 4 seconds. (Because of precession a sidereal day is actually 0.0084 seconds shorter than the rotation period.) Sidereal time is defined relative to the stars rather than the Sun such that there are 24 hours of sidereal time in one sidereal day. Local sidereal time is the same as the right ascension of stars currently on the observer's meridian, and thus depends on longitude as well as the time. On entry Y=year, M=month, D=date in month, T=Universal time. Returns L=local sidereal time. |
Program .AstLS2UF8(L-L0(1)/15)ÞU:¿ TÞX:0ÞT:¿ RUN ".AstJDN":¿ (J-2451545)/36525ÞT:¿ F8(6.697374558+2400.051336*T+ 0.000025862*T²)ÞT:¿ F8(U-T)*0.9972695663ÞU:¿ XÞT:¿ ¿ |
Converts Universal Time to Local Sidereal Time, i.e. the reverse of the above routine. On entry Y=year, M=month, D=date in month, L=local sidereal time. Returns U=universal time. |
Program .AstEq2AF8(L-R)*15ÞX:¿ ASIN(SIN(E)*SIN(L0(2))+COS(E)*COS(L0(2))* COS(X))ÞA:¿ ACOS((SIN(E)-SIN(L0(2))*SIN(A))/ COS(L0(2))/COS(A))ÞZ:¿ IF SIN(X)>0 THEN 360-ZÞZ:END:¿ IF A>-0.75 THEN A+(159+19.6*A+0.02*A²)/ (1+0.505*A+0.0845*A²)/282ÞA:END:¿ |
Converts Equatorial coordinates (i.e. right ascension and declination) to Horizon coordinates (i.e. altitude and azimuth). The altitude and azimuth of a planet are very useful to the observer in deciding whether or not it is currently visible, and depend on its right ascension and declination plus the current time and the observer's longitude and latitude. The altitude is corrected for atmospheric refraction, which causes objects low down in the sky to appear higher than they really are, by a maximum of just over half a degree. (Strictly the correction depends on air pressure and temperature but since these are unlikely to be known typical values are used.) On entry L=local sidereal time, R=right ascension (hours), E=declination (degrees). Returns A=altitude above horizon (degrees), Z=azimuth (North=0, East=90, South=180, West=270) Local sidereal time rather than the current date is used as the input to avoid the need to repeatedly calculate the same LST when calculating the positions of several objects. |
Program .AstA2EqASIN(SIN(A)*SIN(L0(2))+COS(A)*COS(L0(2))* COS(Z))ÞE:¿ ACOS((SIN(A)-SIN(L0(2))*SIN(E))/COS(L0(2))/ COS(E))ÞR:¿ IF SIN(Z)>0 THEN 360-RÞR: END:¿ F8(L-R/15)ÞR:¿ |
Converts Horizon coordinates to Equatorial coordinates (i.e. the reverse of the previous routine). This routine is not currently used by AstroCalc but could be added as an extra function on the main menu. On entry L=local sidereal time, A=altitude, Z=azimuth. Returns R=right ascension (hours), E=declination (degrees). |
Program .AstEc2EASIN(SIN(B)*COS(L0(6))+COS(B)*SIN(L0(6))* SIN(C))ÞE:¿ COS(C)ÞX:¿ SIN(C)*COS(L0(6))-TAN(B)*SIN(L0(6))ÞQ:¿ ARG((X,Q))ÞR:¿ F8(R/15)ÞR:¿ |
Converts Ecliptic coordinates to Equatorial coordinates. Ecliptic coordinates use the 'First Point of Aries' (the direction of the Vernal Equinox) as the zero of longitude and the plane of the Earth's orbit around the Sun as the zero of latitude. Equatorial coordinates also use the First Point of Aries as the zero of right ascension, and the zero of declination is the plane of the Earth's equator. Conversion between the two depends on the current 'obliquity of the ecliptic', the angle of the Earth's axial tilt, which slowly changes over time due to perturbations by the Moon and planets and was calculated when AstroCalc started. On entry B=ecliptic latitude (decimal degrees), C=ecliptic longitude, L0(6)=obliquity Returns R=right ascension (hours), E=declination (degrees). |
Program .AstASepACOS(SIN(E)*SIN(C)+COS(D)*COS(C)* COS((R-B)*15)ÞS:¿ |
Calculates the angular separation between two objects from their right ascensions and declinations. Not currently used by AstroCalc but could be added as another menu option. On entry R=right ascension of first object (decimal hours), E=declination of first object (decimal degrees), B=right ascension of second object, C=declination of second object. Returns S=separation (decimal degrees). |
Program .AstRSetSIN(E)/COS(L0(2))ÞH:¿ IF ABS(H)>1 THEN IFTE(ABS(L0(2))> ABS(90*SIGN(L0(2))-E),99,-99)ÞH:¿ ELSE ACOS(SIN(L0(2))/ COS(E))ÞS:¿ ASIN(TAN(0.567)/TAN(S))ÞZ:¿ ACOS(H)-ZÞA: 360-AÞZ:¿ ACOS(-TAN(L0(2))*TAN(E))/15ÞH:¿ ASIN(SIN(0.567)/SIN(S))/15/ COS(E)Þq: ¿ F8(R+H+q)ÞL:¿ RUN ".AstLS2U":UÞS:¿ F8(24+R-H-q)ÞL:¿ RUN ".AstLS2U":UÞH:¿ END:¿ |
Calculates the times of rising and setting of an object on the current date from its right ascension and declination, and the observer's geographic location in L0(1) and L0(2). The times are corrected for atmospheric refraction which causes a planet to appear on the horizon while it is still really about 34 minutes of arc below the horizon. The azimuth positions of rising and setting are also calculated, though these are not corrected for refraction and may be slightly out. On entry Y=year, M=month, D=date in month, R=right ascension (decimal hours), E=declination (decimal degrees) Returns A=azimuth at rising (decimal degrees), Z=azimuth at setting, H=time of rising (local civil time, decimal hours), S=time of setting. If the object is circumpolar then H=99. If it never rises then H=-99. In these cases A, Z and S are undefined. |
Program .AstPreMYÞG:MÞV: DÞX:TÞq:¿ OÞY:1ÞM: 0ÞD:0ÞT:¿ RUN ".AstJDN":¿ (J-2451545)/36525ÞT:¿ 0.6406161*T+0.0000839*T²+ 0.000005*T*T²ÞY:¿ 0.6406161*T+0.0003041*T²+ 0.0000051*T*T²ÞM:¿ 0.556753*T-0.0001185*T²- 0.0000116*T*T²ÞD:¿ [[COS(Y)*COS(D)*COS(M)-SIN(Y)*SIN(M), COS(Y)*COS(D)*SIN(M)+SIN(Y)*COS(M), COS(Y)*SIN(D)], [-SIN(Y)*COS(D)*COS(M)-COS(Y)*SIN(M), -SIN(Y)*COS(D)*SIN(M)+COS(Y)*COS(M), -SIN(Y)*SIN(D)], [-SIN(D)*COS(M), -SIN(D)*SIN(M), COS(D)]]ÞM0:¿ L0(5)ÞY:1ÞM: 0ÞD:0ÞT:¿ RUN ".AstJDN":¿ (J-2451545)/36525ÞT:¿ 0.6406161*T+0.0000839*T²+ 0.000005*T*T²ÞY:¿ 0.6406161*T+0.0003041*T²+ 0.0000051*T*T²ÞM:¿ 0.556753*T-0.0001185*T²- 0.0000116*T*T²ÞD:¿ [[COS(Y)*COS(D)*COS(M)-SIN(Y)*SIN(M), -SIN(Y)*COS(D)*COS(M)-COS(Y)*SIN(M), -SIN(D)*COS(M)], [COS(Y)*COS(D)*SIN(M)+SIN(Y)*COS(M), -SIN(Y)*COS(D)*SIN(M)+COS(Y)*COS(M), -SIN(D)*SIN(M)], [COS(Y)*SIN(D), -SIN(Y)*SIN(D), COS(D)]]*M0ÞM0:¿ GÞY:VÞM: XÞD:qÞT:¿ |
Due to the phenomenon of precession of the equinoxes (the Earth's rotation axis is not fixed in direction but 'wobbles' in a circle with a period of 25800 years) the direction of the vernal equinox, which defines the zero of right ascension, is not fixed but moves by 50.3 seconds of arc per year relative to the stars. Thus a star's right ascension (and declination) slowly changes over time. For this reason the positions shown in star atlases are only exactly correct at one particular date, known as the 'epoch'. Most current atlases are for epoch 2000. The positions of the Sun, Moon and planets calculated by AstroCalc are also correct for epoch 2000 and therefore should agree with atlases. It is possible however to convert epoch 2000 coordinates to the corresponding coordinates in another epoch by means of matrix multiplication, which could be useful when determining the apparent position of a solar system object several decades or centuries before or after year 2000. This routine generates a suitable matrix. Note that the current version of AstroCalc does not make use of these corrections since it would make the program significantly larger and slower for only a minor improvement in accuracy. On entry O (the letter O)=the year of epoch 1, L0(5)=the year of epoch 2. Returns M0= a 3x3 matrix to convert from epoch 1 to epoch 2. |
Program .AstPreCM0*[COS(R*15)*COS(E), SIN(R*15)*COS(E),SIN(E)]ÞM9:¿ ASIN(M9(3))ÞE:¿ ARG((M9(1),M9(2)))ÞR:¿ (R/15) MOD 24ÞR:¿ |
Once a matrix has been set up by routine .AstPreM, routine .AstPreC is used to actually perform the conversion of right ascension and declination from epoch 1 to epoch 2. On entry R=right ascension (decimal hours) in epoch 1, E=declination (decimal degrees) in epoch 1. Returns R=right ascension in epoch 2, E=declination in epoch 2. |
Program .AstSunRUN ".AstJDN":¿ F9(360*(J-2451545)/365.242191)ÞN:¿ N+280.464-282.947ÞN:¿ 0.016713ÞK:¿ RUN ".AstTrAn":¿ F9(N+282.947)ÞC:¿ 0ÞB:¿ RUN ".AstEc2E":¿ (1-0.016713²)/(1+0.016713*COS(N))ÞK:¿ 1919/KÞN:¿ |
Calculates the right ascension and declination of the Sun on the current date and time. Also finds its distance from the Earth and its angular diameter. On entry Y=year, M=month, D=date in month, T=universal time Returns B=ecliptic latitude (decimal degrees), C=ecliptic longitude (decimal degrees), R=right ascension (decimal hours), E=declination (decimal degrees), K=distance from Earth (in Astronomical Units), N=angular diameter of sun (seconds of arc). One astronomical unit is (for practical purposes) the average radius of the Earth's orbit, 1AU=149597870 km. |
Program .AstSRSTÞO:¿ 12-L0(1)/15ÞT:¿ RUN ".AstSun":¿ RUN ".AstRSet":¿ IF ABS(H)<90 THEN SÞW: HÞT:¿ RUN ".AstSun":EÞK:¿ RUN ".AstRSet":¿ HÞG:AÞV:¿ WÞT:¿ RUN ".AstSun":¿ RUN ".AstRSet":¿ VÞA:F0(G-N/108E3)ÞH: F0(S+N/108E3)ÞS:¿ END:¿ HÞM9(1,5):SÞM9(1,6): AÞM9(1,7):ZÞM9(1,8):¿ (COS(108)-SIN(L0(2))*SIN(E))/COS(L0(2))/COS(E)ÞK:¿ OÞT:¿ IF ABS(K)>1 THEN 99*-SIGN(K)ÞK: ELSE ACOS(K)/15ÞK:¿ RÞL:RUN ".AstLS2U":F0(U+K)ÞN: F0(U-K)ÞK:END:¿ |
Finds the times of sunrise and sunset on the current date, the azimuths of rising and setting, and the beginning and end of astronomical twilight. Calculating the rising and setting times for the Sun is more complicated than for a star, for two reasons:
To find the rise time of the Sun we need to know its right ascension at the time it rises, which is what we are trying to find! The solution adopted here is to calculate the Sun's position at local noon on the day in question, and calculate when it would rise and set if its position did not alter. (These times will be wrong by several minutes.) Next we recalculate its positions at these two times to obtain more accurate estimates of its positions at rising and setting, and finally recalculate the rising and setting times using the improved estimated positions. The times are corrected by the routine .AstRSet for atmospheric refraction and further corrected for the Sun's radius of approx 0.267 degrees. There are three stages of twilight:
Thus astronomical twilight starts in the morning several hours before sunrise when the Sun reaches an altitude of -18 degrees moving upwards, and ends in the evening when the Sun drops below -18 degrees altitude. On entry Y=year, M=month, D=date in month, L0(1)=observer's longitude, L0(2)=observer's latitude. Returns H=time of sunrise (decimal hours, local civil time), S=time of sunset, A=azimuth at rising (decimal degrees), Z=azimuth at setting, K=time of start of morning twilight (decimal hours, local time), N=time of end of evening twilight. The values of H, S, A and Z are also stored in matrix M9, row 1, columns 5 to 8. Notes:For locations within the arctic circles there will be dates around midsummer and midwinter when the Sun does not set or does not rise. If the Sun is circumpolar then H>90 while if it never rises then H<-90. For temperate latitudes there are periods in summer when the Sun is never less than 18 degrees below the horizon, which means the sky never becomes completely dark. This is indicated by K>90. For areas very close to the poles it is even possible in winter for the Sun to be always more than 18 degrees below the horizon, so there is never any twilight. In this situation K<-90. |
Program .AstPlanRUN ".AstJDN":¿ J-2451545ÞI:¿ F9(360/365.242191*I/1.00004+100.466-102.937)ÞN:¿ 0.01671ÞK:¿ RUN ".AstTrAn":¿ F9(N+102.937)ÞF:FÞM9(1,15):¿ (1-K²)/(1+K*COS(N))ÞV:¿ RUN ".AstU2LS": ¿ FOR P=1 TO 10;¿ CASE¿ IF P==1 THEN {0.240852,252.251,77.456,0.20563,0.3871,7.005,48.331,6.74,-0.42}ÞL9:END¿ IF P==2 THEN {0.615211,181.98,131.533,0.00677,0.72333,3.395,76.681,16.92,-3.8}ÞL9:END¿ IF P==3 THEN {1.880889,355.453,336.041,0.09341,1.52366,1.851,49.579,9.36,-1.52}ÞL9:END¿ IF P==4 THEN {4.59984,161.741,153.8,0.078,2.7658,10.607,80.7,1.3,4.3}ÞL9:END¿ IF P==5 THEN {11.862236,34.404,14.754,0.04839,5.2026,1.305,100.464,196.74,-9.4}ÞL9:END¿ IF P==6 THEN {29.457769,49.944,92.432,0.05415,9.53707,2.484,113.715,165.6,-8.88}ÞL9:END¿ IF P==7 THEN {84.013843,313232,170.964,0.04712,19.19126,0.77,74.23,65.8,-7.19}ÞL9:END¿ IF P==8 THEN {164.79246,304.88,44.971,0.00859,30.06896,1.769,131.722,62.2,-6.87}ÞL9:END¿ IF P==9 THEN {247.687,238.929,224.067,0.24881,39.48169,17.142,110.303,3.2,-1}ÞL9:END¿ IF P==10 THEN {557.2,21.649,187.301,0.44177,67.67,44.187,35.87,3.3,-1.1}ÞL9:END ¿ END:¿ F9(360/365.242191*I/L9(1)+L9(2)-L9(3))ÞN:¿ L9(4)ÞK:¿ RUN ".AstTrAn":¿ F9(N+L9(3))ÞC:CÞM9(P+2,15):¿ L9(5)*(1-K²)/(1+K*COS(N))ÞK:¿ SIN(C-L9(7))*COS(L9(6))ÞQ:¿ COS(C-L9(7))ÞX:¿ F9(ARG((X,Q)))ÞX: ¿ X+L9(7)ÞX:¿ ASIN(SIN(C-L9(7))*SIN(L9(6))ÞQ:¿ Ö(V²+K²-2*V*K*COS(C-F)*COS(Q)ÞM9(P+2,12): ¿ K*COS(Q)ÞB:¿ IF P<3 THEN ¿ F9(180+F+ATAN(B*SIN(F-X)/(V-B*COS(F-X))))ÞC:¿ ATAN(B*TAN(Q)*SIN(C-X)/(V*SIN(X-F)))ÞB:¿ ELSE¿ F9(ATAN(V*SIN(X-F)/(B-V*COS(X-F)))+X)ÞC:¿ ATAN(B*TAN(Q*SIN(C-X)/(V*SIN(X-F)))ÞB:¿ END:¿ (1+COS(C-X))/2ÞM9(P+2,11):¿ M9(P+2,12)ÞX:¿ L9(8)/XÞM9(P+2,10):¿ 5*LOG(K*X/ÖM9(P+2,11))+L9(9)ÞM9(P+2,9): ¿ RUN ".AstEc2E":¿ RÞM9(P+2,1):EÞM9(P+2,2):¿ RUN ".AstRSet":¿ IFTE(ABS(H)<90,F0(H),H)ÞM9(P+2,5):AÞM9(P+2,7):¿ F0(S)ÞM9(P+2,6):ZÞM9(P+2,8): ¿ END:¿ |
Calculates the positions at the current date and time of all the planets, from Mercury to Neptune, plus dwarf planets Ceres, Pluto and Eris. (The International Astronomical Union met in Prague in 2006 and controversially decided that Pluto is no longer a fully-fledged planet but instead is grouped with Ceres and the Kuiper Belt object Eris as a 'Dwarf Planet'.) The parameters calculated for each planet are its right ascension, declination, magnitude, size, phase, distance from the Earth and current altitude and azimuth. The rising and setting times and azimuths are also calculated, though without any allowance for the movement of the planets over the day so these values will be slightly inaccurate for the inner planets. Since there are too many results to return individually they are put into the matrix M9. Perturbations in planetary orbits by the other planets are not taken into account by this routine, which can cause errors of a few minutes of arc in the calculated positions, especially for Jupiter and Saturn. However the accuracy is considered sufficient for the intended purpose of the program. On entry Y=year, M=month, D=date in month, T=universal time (decimal hours), L0(1)=observer's longitude, L0(2)=observer's latitude. Returns M9 as a matrix of 10 rows and 14 columns. Row 1 is for the Sun, row 2 is for the Moon. Rows 3 to 10 are for the planets Mercury to Pluto, in order outwards. The meaning of each column is: Column 1 right ascension (decimal hours) Column 2 declination (decimal degrees) Column 3 current altitude (decimal degrees) Column 4 current azimuth (decimal degrees, North=0) Column 5 rise time (decimal hours, local time) Column 6 set time Column 7 azimuth at rise Column 8 azimuth at setting Column 9 magnitude (i.e. visual brightness) Column 10 angular size (seconds of arc) Column 11 phase (the fraction of the side facing the earth illuminated, range 0-1) Column 12 distance from Earth (in AU) Column 13 time the planet culminates, i.e is highest in the sky (decimal hours, local time) Column 14 maximum altitude, at culmination Column 15 Heliocentric longitude |
Program .AstTrAnFNROOT(DEG®RAD(X)-K*SIN(X)- DEG®RAD(N),X,N)ÞX:¿ 2*ATAN(Ö((1+K)/(1-K))* TAN(X/2))ÞN:¿ |
Calculates the 'true anomaly' from the 'mean anomaly' and eccentricity. To a first approximation planets could be considered to move in circular orbits around the Sun. The angle which the line from the Sun to such a planet would make at a given date with the direction of the vernal equinox is called its mean anomaly. In reality planets move in elliptical orbits with a known eccentricity, which is a measure of how much it deviates from a circle. The true anomaly is the angle between the real planet and the vernal equinox, as seen from the Sun. Unfortunately the true anomaly cannot be calculated exactly but is found from the mean anomaly by a numeric approximation. The simplest approximation is n=M+(360/p)*e*sin(M) where M is the mean anomaly, e is the eccentricity and n is the true anomaly. This is accurate to a few minutes of arc if the eccentricity is small, but is not really accurate enough for planets with a high eccentricity such as Mercury. A much more accurate value for the true anomaly can be found by first solving Kepler's equation for the eccentric anomaly E, given by: E-e*sin(E)=M where angles are measured in radians. This equation has to be solved numerically. The true anomaly is then calculated as: n=2*arctan(Ö((1+e)/(1-e))*tan(E/2)) Routine .AstTrAn uses the calculator's built-in root finder to solve the equation for eccentric anomaly and converts it to the true anomaly. On entry N=mean anomaly, K=eccentricity. Returns N=true anomaly |
Program .AstMoonRUN ".AstJDN": J-2447891.5ÞI:¿ 360/365.242191*IÞF:¿ F9(F+279.403303-282.768422)ÞV:¿ F9(F+360/p*0.016713*SIN(V)+279.403303)ÞF:¿ F9(13.1763966*I+318.351648)ÞC:¿ F9(C-0.1114041*I-36.34041)ÞB:¿ F9(318.510107-0.052953*I)ÞN:¿ 1.2739*SIN(2*C-2*F-B)ÞQ:¿ 0.1858*SIN(V)ÞK:¿ B+Q-K-0.37*SIN(V)ÞB: ¿ 6.2886*SIN(B)ÞZ:¿ C+Q+Z-K+0.214*SIN(2*B)ÞC:¿ (1-0.0549²)/(1+0.0549*COS(B+Z))ÞZ: ¿ FÞP:¿ C+0.6583*SIN(2*C-2*F)ÞF:¿ (1-COS(F-P))/2*-SIGN(F-P-180*(SIGN(F-P)-1)-180)ÞP:¿ N-0.16*SIN(V)ÞN:¿ SIN(F-N)*COS(5.145396)ÞQ:¿ COS(F-N)ÞX:¿ F9(ARG((X,Q))+N)ÞC:¿ ASIN(SIN(F-N)*SIN(5.145396)ÞB:¿ RUN ".AstEc2E":¿ 0.9507/ZÞN:¿ RUN ".AstPara":¿ 1865/ZÞN: ¿ LOG(Z²/P²)/LOG(2.51)-12.73ÞS: ¿ |
Calculates the position (right ascension and declination) of the Moon on the current date, plus other lunar data as detailed below. One difference for calculations relating to the Moon rather than the Sun or planets is that the Moon is relatively close to the Earth and therefore the observer's precise location makes a difference to the apparent position of the Moon against the background stars. This parallax effect is very small for the planets and the directly calculated coordinates, which strictly are only correct for an observer at the centre of the Earth, are accurate enough. For the Moon though parallax can make a difference of about one degree of arc in the Moon's apparent position and this is taken into account by calling the routine .AstPara. On entry Y=year, M=month, D=date in month, T=universal time (decimal hours). Returns R=right ascension, E=declination, Z=distance from Earth (in multiples of the Moon's average distance, not AU as for the planets), N=angular diameter (seconds of arc), S=approximate magnitude, P=phase (fraction illuminated, -1 to +1) Note: The figure for the visual magnitude may be somewhat inaccurate because the Moon appears much brighter when close to full than a day or two either side. There are two reasons for this:
If the Moon is waxing the phase is given as positive while if it is waning the phase is shown as negative. |
Program .AstParaRUN ".AstU2LS":¿ (L-R)*15ÞL:¿ ATAN(0.996647*TAN(L0(2)))ÞX:¿ 0.996647*SIN(X)+L0(3)/6378140* SIN(L0(2))ÞQ:¿ COS(X)+L0(3)/6378140* COS(L0(2))ÞX:¿ 1/SIN(N)ÞN:¿ ATAN(X*SIN(L)/(N*COS(E)-X* COS(L)))ÞI:¿ F8(R-I/15)ÞR:¿ ATAN(COS(L+I)*(N*SIN(E)-Q)/ (N*COS(E)*COS(L)-X))ÞE:¿ |
Corrects right ascension and declination, which are correct as seen from the centre of the Earth, for geocentric parallax, i.e. that the observer is actually on the surface of the Earth. The apparent direction of a nearby astronomical object depends on the observer's latitude and longitude, very slightly on the observer's altitude above sea level, and also on the fact that the Earth is not a perfect sphere but is flattened along a line between the two poles. This routine corrects for parallax. On entry N=horizontal parallax (decimal degrees), R=geocentric right ascension (decimal hours), E=geocentric declination (decimal degrees), L0(1)=observer's longitude, L0(2)=observer's latitude, L0(3)=observer's altitude (metres). Returns R=corrected right ascension, E=corrected declination Horizontal parallax is the parallax angle when the object is on the observer's horizon, when the angle is greatest. It is approximately the angle subtended by the radius of the Earth as seen from the object. |
Program .AstMoRSTÞO: ¿ RUN ".AstMoon":¿ RUN ".AstRSet":¿ IF ABS(H)<90 THEN HÞT:¿ RUN ".AstMoon":¿ RUN ".AstRSet":¿ HÞG:AÞW:¿ SÞT:¿ RUN ".AstMoon":¿ RUN ".AstRSet":¿ F0(S+N/108E3)ÞS: WÞA:¿ F0(G-N/108E3)ÞH: OÞT:¿ END:¿ HÞM9(2,5):SÞM9(2,6): AÞM9(2,7):ZÞM9(2,8):¿ |
Calculates the times and azimuths of moonrise and moonset on the current day. As explained in the section for .AstSRS this is complicated by the fact that we need to know the precise position of the Moon at the time of moonrise before we can work out the time of moonrise. As before this is solved by first calculating the approximate times of rising and setting and then recalculating the Moon's positions at these times to obtain more accurate times. A correction is also made for the Moon's finite diameter. On entry Y=year, M=month, D=date in month. Returns H=time of moonrise (decimal hours, local time), S=time of moonset, A=azimuth at rising (decimal degrees), Z=azimuth at setting. These four values are also entered into matrix M9 row 2, columns 5 to 8. Remember that moonset may be before moonrise on a particular day. If the Moon is circumpolar from the observer's location then H>+90 while if it never rises then H<-90. |
Program .AstDisp0ÞXmin:3.9ÞXmax:0ÞYmax:7ÞYmin:ERASE:¿ 1-CÞQ:¿ CASE¿ IF W==0 THEN DISPXY Q;0;1;"Sunday":END¿ IF W==1 THEN DISPXY Q;0;1;"Monday":END¿ IF W==2 THEN DISPXY Q;0;1;"Tuesday":END¿ IF W==3 THEN DISPXY Q;0;1;"Wednesday":END¿ IF W==4 THEN DISPXY Q;0;1;"Thursday":END¿ IF W==5 THEN DISPXY Q;0;1;"Friday":END¿ IF W==6 THEN DISPXY Q;0;1;"Saturday":END ¿ END:¿ DISPXY 2.2-C;0;1;Y:¿ IF M£9 THEN DISPXY 2.8-C;0;1;"0"M: ELSE DISPXY 2.8-C;0;1;M:END:¿ IF D£9 THEN DISPXY 3.2-C;0;1;"0"D: ELSE DISPXY 3.2-C;0;1;D:END:¿ 2ÞFormat:DISPXY 3.6-C;0;1;®HMS(F0(T))" Local time": ¿ IF ABS(K)<90 THEN DISPXY 6-C;0;1;"Twilight start "®HMS(K): DISPXY 8.5-C;0;1;"Twilight end "®HMS(N):END:1ÞFormat: ¿ IF K>90 THEN DISPXY 6-C;0;1;"Twilight all night":END:¿ IF K<-90 THEN DISPXY 6-C;0;1;"No twilight":END:¿ DISPXY 11-C;0;1;"Long "INT(L0(1))"°"ABS(INT(FRAC(L0(1))*60)"'": DISPXY 13-C;0;1;"Lat "INT(L0(2))"°"ABS(INT(FRAC(L0(2))*60)"'":¿ DISPXY 15-C;0;1;"GMT+ "L0(4)" hours":¿ IF R==1 THEN DISPXY 0;2;1;"Sun": DISPXY 0;3;1;"Moon":DISPXY 0;4;1;"Mercury": DISPXY 0;5;1;"Venus":DISPXY 0;6;1;"Mars":END:¿ IF R==6 THEN DISPXY 0;2;1;"Ceres": DISPXY 0;3;1;"Jupiter":DISPXY 0;4;1;"Saturn": DISPXY 0;5;1;"Uranus":DISPXY 0;6;1;"Neptune":END:¿ IF R==11 THEN DISPXY 0;2;1;"Pluto":DISPXY 0;3;1;"Eris":END: ¿ DISPXY 2-C;0.9;1;"Ri Asc":DISPXY 3-C;0.9;1;"Declin":¿ DISPXY 4-C;0.9;1;"Alti":DISPXY 5-C;0.9;1;"Azim": DISPXY 6-C;0.9;1;"Rises":DISPXY 7-C;0.9;1;"Sets": DISPXY 8-C;0.9;1;"Rise Az":DISPXY 9-C;0.9;1;"Set Az": DISPXY 10-C;0.9;1;"Mag":DISPXY 11-C;0.9;1;"Ang Dia": DISPXY 12-C;0.9;1;"Phase":DISPXY 13-C;0.9;1;"Dist AU": DISPXY 14-C;0.9;1;"Culmin": DISPXY 15-C;0.9;1;"Max Alt Helio L": ¿ LINE 0;1.7;4;1.7:LINE 0.9;1.7;0.9;7: ¿ FOR P=0 TO 1+3*(R<11);¿ IF C<3 THEN M9(P+R,1)ÞQ: DISPXY 2-C;P+2;1;INT(Q)"h"INT(FRAC(Q)*60)"m": M9(P+R,2)ÞQ: IF Q<0 THEN DISPXY 3-C;P+2;1;"-":ABS(Q)ÞQ: ELSE DISPXY 3-C;P+2;1;"+":END: DISPXY 3.15-C;P+2;1;INT(Q)"°"INT(FRAC(Q)*60)"'":END:¿ IF C£3 THEN M9(P+R,3)ÞQ: IF Q<0 THEN DISPXY 4-C;P+2;1;"-":ABS(Q)ÞQ: ELSE DISPXY 4-C;P+2;1;"+":END: DISPXY 4.14-C;P+2;1;INT(Q)"°"INT(FRAC(Q)*60)"'": M9(P+R,4)ÞQ: DISPXY 5-C;P+2;1;INT(Q)"°"INT(FRAC(Q)*60)"'":END:¿ IF ABS(M9(P+R,5))<90 THEN IF C³3 AND C£5 THEN 2ÞFormat:DISPXY 6-C;P+2;1;®HMS(M9(P+R,5)): DISPXY 7-C;P+2;1;®HMS(M9(P+R,6)):1ÞFormat:END:¿ IF C³5 AND C£7 THEN M9(P+R,7)ÞQ: DISPXY 8-C;P+2;1;INT(Q)"°"INT(FRAC(Q)*60)"'": M9(P+R,8)ÞQ: DISPXY 9-C;P+2;1;INT(Q)"°"INT(FRAC(Q)*60)"'":END:¿ ELSE IF C³3 AND C£5 THEN IF M9(P+R,5)>90 THEN DISPXY 6-C;P+2;1;"Circumpolar": ELSE DISPXY 6-C;P+2;1;"Never rises":END:END: ¿ END:¿ IF C³7 AND C£9 THEN DISPXY 10-C;P+2;1;ROUND(M9(P+R,9),1): DISPXY 11-C;P+2;1;ROUND(M9(P+R,10),1)"¨":END:¿ IF C³9 AND C£11 THEN DISPXY 12-C;P+2;1;ROUND(M9(P+R,11)*100,1)"%": DISPXY 13-C;P+2;1;ROUND(M9(P+R,12),2):END:¿ IF C³11 THEN 2ÞFormat: DISPXY 14-C;P+2;1;®HMS(M9(P+R,13)): 1ÞFormat:M9(P+R,14)ÞQ:DISPXY 15-C;P+2;1;INT(Q)"°"INT(FRAC(ABS(Q))*60)"'": M9(P+R,15)ÞQ: DISPXY 16-C;P+2;1;INT(Q)"°"INT(FRAC(ABS(Q))*60)"'": END: ¿ END: |
This long routine displays all the calculated data for the Sun, Moon and planets on the calculator's screen in tabular format. It also shows the date and time for which the calculations apply, the times of start and end of astronomical twilight, and the observer's longitude and latitude on the top line of the display. The data which appears in the table has been stored in matrix M9. The limited size of the LCD display means that only five rows (for five planets) and three columns of data can be shown at once so parameters are passed to the routine to define which row and column appears in the top left corner. When the display has been printed the routine returns to the calling program, which is responsible for ensuring there is a pause to read the display and for scrolling around the table. The display format used for values in the table is to convert the decimal values to degrees and minutes or hours and minutes, as follows:
Does not return anything useful. Note that for a proper display C must be an odd number between 1 and 13, R must be 1, 6 or 11. |
Program .AstCulmFOR P=1 TO 10;¿ M9(P,1)ÞL:¿ RUN ".AstLS2U":¿ F0(U)ÞM9(P,13):¿ ASIN(SIN(M9(P,2))*SIN(L0(2))+ COS(M9(P,2))*COS(L0(2))) ÞM9(P,14):¿ END: |
Calculates the time of culmination and maximum altitude reached by the Sun, Moon and planets on the current day. An astronomical object culminates, or transits, when it crosses the observer's central meridian, i.e. when it is due south in the northern hemisphere, or due north in the southern hemisphere. This is also the time when it reaches its greatest altitude above the horizon so is often the best time to view the object. Transit occurs when the object's right ascension is equal to the local sidereal time, so by setting LST to RA and converting to universal time the transit time is easily found. The altitude at culmination is also calculated, though without any correction for refraction. If the particular object never rises then the altitude shown will be negative. Times for the Sun and Moon may be a few minutes out because no allowance is made for their movement in right ascension between the current time and transit time. On entry M9(P,1)=right ascension, M9(P,2)=declination, Y=year, M=month, D=date in month. Returns M9(P,13)=time of culmination (local time, decimal hours), M9(P,14)=altitude at culmination (degrees). |
Program .AstEastINT(Y/100)ÞK:¿ (19*(Y MOD 19)+K-INT(K/4)- INT((K-INT((K+8)/25)+1)/3)+15) MOD 30ÞQ:¿ Y MOD 100ÞK:¿ (32+2*(INT(Y/100) MOD 4)+2*INT(K/4)-Q- (K MOD 4)) MOD 7ÞN:¿ Q+N-7*INT(((Y MOD 19)+11*Q+22*N)/451)+114ÞK:¿ INT(K/31)ÞN:¿ (K MOD 31)+1ÞK:¿ IF N==3 THEN MSGBOX "Easter Sunday: "K" March "Y:¿ ELSE MSGBOX "Easter Sunday: "K" April "Y:¿ END:¿ |
Calculates the date of Easter Sunday in the currently set year, i.e. the year which is used for planetary calculations. Easter, commemorating the resurrection, is the most important date in the year for the Christian religion. Unfortunately none of the Gospels record exactly what the date was, other than that it was after the Jewish feast of the Passover. The Council of Nicaea, called by emperor Constantine in 325 AD, decreed that Easter Sunday should be the first Sunday after the first full moon after the vernal equinox, so long as this did not coincide with the start of Passover, in which case Easter was to be the following Sunday. The vernal equinox is the date when the Sun appears to pass from south to north of the celestial equator, and is always within a day of March 21st. This definition of Easter was problematic because it depends on the interaction between the solar ('tropical') year of 365.24219 days and the synodic month (the time for one cycle of lunar phases) of 29.53059 days. Of course neither of these were known to high accuracy in 325 AD which made predicting the date of Easter in advance, without actually observing the full moon, tricky. The cycle of dates of Easter does eventually repeat, but only after 532 years. This program uses a method devised in 1876 to calculate the date of Easter for any year in the Gregorian calendar, i.e. from 1583 onwards. It will be wrong for years before 1583. On entry Y=year. Returns N=month of Easter (3=March, 4=April), K=date within month of Easter Sunday. Shows result as a message box. |
Program .AstJulRUN ".AstJDN":¿ MSGBOX "Date "Y"-"M"-"D" Local T. "ROUND(®HMS(F0(T)),2)" Julian Day N° "J:¿ |
Displays the Julian Day Number of the currently set date and time. Note that the correct offset from Greenwich Mean Time needs to stored in L0(4) to convert local civil time to Universal Time, since Julian Day numbers are based on UT. The routine simply calls the Julian Day Number calculating program listed earlier. On entry Y=year, M=month, D=date in month, T=Universal Time as a decimal number of hours, i.e. in (hours+minutes/60) form. Returns nothing. Shows result as a message box. |