Chapter 3 – The Moon (The Moon’s Phases – In Orbit)

The Moon’s Phases, the phases of the moon over a monthly cycle
Phases of the Moon, plots the Earth and Moon in orbit around each other with a full description of each phase
UDG Moon’s Phases, using the UDG character set.

The Moon’s Phases – In Orbit

The lifegiving Sun gets a raw deal in the public eye and the reason is not too difficult to find — the weather. The Sun completely dominates the scene and man has absolutely no control over these events.

This program is based upon the previous Moon’s Phases program but extended to PLOT both Earth and Moon in orbit about each other and to provide a full description of each phase. The latter is done via the conditional PRINT statement in Line 290. Line 310 handles conditions of potential eclipses and Line 320 the terminator line of the waxing and waning Moon. REM statements are liberally included to show the general structure of the program.

The Earth/Moon system
The Moon is quite the most unique body in the solar system in possessing the largest mass in relationship to the body it orbits (the Earth).

The mass of a satellite is typically between 1/1,000,000th and 1/4000th that of the primary. The Moon is l/80th the mass of the Earth so that the Earth and Moon behave like a. twin planetary system, each orbiting about the other around the common centre of gravity. This latter point is not at the centre of the planet (as it is for all other planets) but about half way to the planet’s centre some 2000 miles beneath the surface on a line joining the centres of each body.

The program mimics this effect but for clarity the diameters of both the Earth and Moon have been enlarged 100-fold. Otherwise, to true scale on the Spectrum screen, they would be reduced to a few pixels across and would be virtually invisible. A single flickering pixel beneath the Earth’s surface marks the centre of gravity of the Earth/Moon system and is produced by Line 250 with the OVER 1 command.

Shadows and eclipses
The shadows from both the Earth and the Moon are cones stretching away from the direction of the Sun. In the case of the Moon, this shadow can (at times of new moon) just fall on the Earth’s surface. An observer located immediately under this cone would see the Sun completely blotted out in a total eclipse and day turn into night with the stars coming into view. This event is rare and short-lived — it is barely more than a few minutes before the Earth’s axial rotation and the Moon’s orbital progress carry the shadow away at about 1400 mph. Only Concorde can (and has done so) keep up with the eclipse shadow stretching the event into 40 minutes or so whilst a whole continent is traversed.

Eclipses of the Moon occur when the Earth’s shadow falls on the Moon. This can only occur at full moon and, because the Earth’s shadow is so huge even at a range of 384,000 km (Moon’s mean distance), the Moon can be completely engulfed. Potentially, given clear skies, half the world’s population (in the hemisphere which would be in darkness) could see this event, in contrast to the few privileged thousands for a total eclipse of the Sun.

Eclipses do not occur at each new and full moon because the Moon and its orbit are more closely bound to the Sun than to the Earth. Only when the Moon crosses the line between Earth and Sun (the ecliptic) at a point called the ‘node’ can an eclipse occur.

The program
Once the program has been entered and RUN, a complete monthly cycle is displayed. The user then has the option to INPUT any day or decimal day for display. The economical conditional GOTO in Line 470 automatically reRUNS the program (ie GOTO 0) if a day 28 is entered. COPYs of the screen display can be made at any time during the program RUN as follows:


Figure 3.3 is a screen COPY obtained this way.

Figure 3.3
Split display show’s the Moon’s phases, and Earth and Moon orbiting around a common centre of gravity.


The program RUNs in blissful silence but, if this proves unnerving, then the appropriate BEEPs (as well as colour) can be incorporated in the display.

10 REM Phases of the Moon
20 LET g=192: LET h=69: LET j=55: LET k=52: LET m=100: LET z=0
40 FOR d=0 TO 28
60 CLS : CIRCLE g,h,j
80 LET p=PI: LET a=(d-7)/14*p
90 LET c=g+j*COS a
100 LET e=h+j*SIN a
110 CIRCLE c,e,5.5
120 REM ******************
121 REM draw earth in orbit
122 REM ******************
130 LET c1=g-6*COS a
140 LET e1=h-6*SIN a
150 CIRCLE c1,e1,13
159 REM ********************
160 REM draw moons shadow
161 REM *********************
170 FOR n=.5 TO 5
180 PLOT c+n,e: DRAW 0,k-10*n
190 PLOT c-n,e: DRAW 0,k-10*n
200 NEXT n
220 FOR n=.5 TO 13
230 PLOT c1+n,e1: DRAW 0,m-8*n
240 PLOT c1-n,e1: DRAW 0,m-8*n
250 PLOT OVER 1;g,h
260 NEXT n
269 REM ********************
270 REM describe phases
271 REM *********************
280 PRINT PAPER 5;”Moon’s Phase – day “;d
290 PRINT FLASH 1;(“New” AND (d=0 OR d=28))+(“1st” AND d=7)+(“Last” AND d=21)+(” Quarter” AND (d=7 OR d=21))+(“Full” AND d=14)+(“Crescent” AND (d>0 AND d21 AND d<28))+(“Gibbous” AND d14 AND d>7 AND d<21)+” Moon”
299 REM ********************
300 REM eclipses and terminator
301 REM ********************
310 PRINT FLASH 1;(“Eclipse of Sun possible” AND (d=0 OR d=28))+(“Eclipse of Moon possible” AND d=14)
320 PRINT (“waxing-sunrise” AND d14)'”terminator”
330 PRINT INK 2;AT 11,22;”Earth”;AT 5,18; INK 1;”Moon’s orbit”
335 PRINT PAPER 6;AT 21,8;”sunlight ^ ^ ^ ^ ^ ^ ^ ^”
339 REM *******************
340 REM draw bright light
341 REM *******************
350 IF d>14 THEN LET p=-p
360 PLOT j,14: DRAW 0,j*2,p
369 REM *******************
370 REM draw terminator
371 REM *******************
380 LET b=d-7: LET x=2.5
390 IF b>7 THEN LET b=b-14
400 LET n=x*ATN (PI/180*-b*25)
410 PLOT j,14: DRAW 0,j*2,n
419 REM *******************
420 REM jump out of loop (z=1)
421 REM *********************
430 IF z=1 THEN GO TO 450
440 PAUSE 400: NEXT d: LET z=1
450 INPUT “Select day: “;d
459 REM ********************
460 REM conditional goto
461 REM ********************
470 GO TO (d>=0 AND d<=28)*60
9900 REM *******************
9990 SAVE “moon” LINE 1
9999 REM *******************

A video of the above program running can be seen here:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s