Popular Computing Weekly 16/06/1983 Pages 20 & 21

Spectrum Programming

Over the Moon!

Maurice Gaving presents a program to show all the phases of the moon's orbit
around the earth.

The moon is our nearest neighbour in space and its influence has been ingrained
upon us from antiquity. Witness the words 'Monday, month' and even 'lunacy'.

For many, a silvery full moon riding high in winter, or a golden crescent in
the western sky at dusk is a splendid sight. Out moon, like all the other
planets and satellites in the sun's family, is a globe shining by reflected
sunlight. The following program, for 16K Spectrum, explains how the moon's
appearance changes throughout the month.

This program has a split display showing the phases and daily motion of the
moon about the earth. It demonstrates eclipses of the sun and moon and shows
why a total eclipse of the sun, for any given place on earth, is very rare.

Each phase of the waxing and waning moon is described via the conditional PRINT
statement in lines 25, 26 and 27. The bright limb or edge 'nearest' to the sun
is drawn first (L 40) where PI - a semicircle and then a the terminator of
sunrise sunset line (L 70, 80). The latter is actually a semi-ellipse and not a
simple arc drawn so rapidly by the Spectrum.

The program accurately shows the fore-shortening effect as the terminator
approaches the limb at new or full moon.

Once RUN, a complete monthly cycle is shown. The program invites the entry of
any selected day or decimal day for display. The economical conditional GOTO on
line 210 automatically reruns the program if a day <0 or>28 is entered!

Colour and sound can be added to taste and will not effect the technical
accuracy of the presentation.