Earth and Moon orbit demo

Introduction

This DirectX demo shows how the Earth's seasons work, how the phases of the Moon work, the current (approximate) positions of the Earth and Moon, and more.  The Earth and Moon orbit the Sun, the Earth rotates on its axis, and the Moon orbits the Earth.  Hardly anything is to scale, and there are lots of simplifications in what are actually pretty complicated orbits, rotations, and precessions.  But I still think that it's close enough to give you the general idea.  I hope you enjoy playing with it as much as I enjoyed writing it.

There are a couple of ways to install the program:

  1. Click here to run the MSI installer (setup.msi - 630 KB).
  2. (If #1 doesn't work)  Click here to download the files (earthorbit.zip v1.0.0 - 539 KB).  Extract the files into a new folder and run earthorbitdemo.exe.  I have tested it on Windows XP/2000 with DirectX 7.0 or later.

Related stuff:

  • Click here to see a screenshot.
  • For what it's worth, here's the source code (earthorbitsource.zip - 22KB)

How to use the demo

Getting started

The demo starts with the Earth and Moon in their approximate current positions, based on your clock and your time zone setting in Windows (the picture is close enough for jazz, but don't use it for navigation...).  The Earth and Moon are moving at their "real world" speeds (Earth spins once each day and orbits once each year) so they appear to be motionless.  To see some action, press F10 to apply demonstration velocities.

Flying around

You view the scene from a (very fast) spacecraft.  Initially, the craft sits at the center of the solar system (the Sun is invisible in this demo).  To see the full story you need to move around.  Here are the keys to move and swivel the craft:

W = move forward
S = move backward
A = sidle left
D =  sidle right
R = move up
F = move down
Up Arrow = look up
Down Arrow = look down
Left Arrow = look left
Right Arrow = look right
Home = return to the centre of the solar system and face the Earth
Page Up = bird's eye view (looking down on North Pole)
Page Down = bird's eye view (looking down on South Pole)

You can also control the speed of the objects in the scene.  This can be done from the Demo menu, but it's recommended that you use the following shortcut keys because you can make big changes by holding them down:

Pause = freeze the scene (you can still fly around)
F5 = slow down earth orbit by 10%
F6 = speed up earth orbit by 10%
F7 = slow down earth/moon rotation by 10%
F8 = speed up earth/moon rotation by 10%
F9 = apply real-world (very slow!) velocities
F10 = apply demo (fast) velocities

Combinations

Hold down A and Right Arrow to circle anti-clockwise. 
Hold down R and Down Arrow to circle vertically
... and so on

What to look for

Earth seasons

The first thing to notice is that the Earth's axis is tilted by 23.5 degrees relative to the ecliptic.  This, not the distance from the Sun, is what causes the seasons.  The tilt gives significance to four lines of latitude which are shown, along with the equator, as purple lines on the globe:

  • The Tropic of Cancer is 23.5 degrees north of the equator
  • The Tropic of Capricorn is 23.5 degrees south of the equator
  • The Arctic Circle is 23.5 degrees south of the North Pole
  • The Antarctic Circle is 23.5 degrees north of the South Pole

In the course of a year, every single point on Earth spends half its time in daylight and half its time in darkness (ignoring the twilight effects of the atmosphere).  But, for different locations, the way in which this time is divided up varies between two extremes: (1) every day of the year having twelve hours of daylight and twelve hours of darkness (at the equator), and (2) six months of perpetual darkness followed by six months of perpetual daylight (at the poles).

Four "axes" are drawn on the ecliptic (the imaginary plane that passes through the Sun's equator), a bit like the points on a compass.  They point to the two solstices and the two equinoxes - four key points in the Earth's orbit.  (Like most things in this demo they are heavy approximations and should not be taken literally).  In the following descriptions, NH and SH stand for Northern Hemisphere and Southern Hemisphere respectively. 

December 21/22: NH winter solstice, SH summer solstice - Northern Hemisphere shortest day, South Hemisphere longest day.  Artic Circle has 24 hours of darkness, Antarctic Circle has 24 hours of daylight.  Sun is directly overhead at solar noon at the Tropic of Capricorn.

March 20/21: NH vernal equinox, SH autumnal equinox - Everyone has 12 hours of daylight and 12 hours of darkness.  North Pole begins six months of perpetual daylight, South Pole begins six months of perpetual darkness.  Sun is directly overhead at solar noon at the equator.

June 21/22: NH summer solstice, SH winter solstice - Northern Hemisphere longest day, South Hemisphere shortest day.  Artic Circle has 24 hours of daylight, Antarctic Circle has 24 hours of darkness.  Sun is directly overhead at solar noon at the Tropic of Cancer.

September 22/23: NH autumnal equinox, SH vernal equinox - Everyone has 12 hours of daylight and 12 hours of darkness.  North Pole begins six months of perpetual darkness, South Pole begins six months of perpetual daylight.  Sun is directly overhead at solar noon at the equator.

Notice that the Equator always has 12 hours of darkness and 12 hours of daylight.  Do you see why people in the same time zone often argue about daylight saving?  Those closer to the equator can't understand why those closer to the poles want to keep changing the clocks.

Moon phases

As explained above, most physical characteristics are simplified and approximated in this demo.  One thing that is correct is the Moon's sidereal period of about 27.3 Earth days.  This means that it takes 27.3 Earth rotations for the Moon to return to the same position in its orbit relative to the fixed stars.  The period of the Moon's phases (the time from one full moon to the next) is longer in reality because in 27.3 days the Earth/Moon have moved further around the Sun, so the Moon has further to go to get back to the Earth/Moon/Sun alignment that produces the next full moon.  In the real solar system this "synodic" period is 29.5 days, but in the demo it will depend on the relative orbit and rotation speeds that you set.  The standard speeds that you get by pressing F10 are in the correct proportions.  Press F10, then wait until the Earth, Moon and Sun are in a line.  Now count the number of times the Earth spins before the three bodies are once again in line.  It should be 29.5.

As the moon orbits the Earth it spins on its axis at the same speed, so that the same side is always facing the Earth.  This is no coincidence - it is the result of billions of years of tidal drag.

Notice that, just like the Earth, half the Moon is always lit by the Sun (except during an eclipse!).  But the half of the Moon that is illuminated is not always the half that is visible from Earth; hence the Moon's phases.  There's another point of interest here: fly around, keeping well inside the Earth's orbit.  Move to different points and look at the Earth.  Notice that you always see the full sunlit half.  On the other hand, if you fly beyond Earth's orbit on the same side of the Sun as the Earth, you will see only part of the disc.  The same goes for other planets in the real world.  That's why you can always see the full discs of Mars, Jupiter and Saturn (with a telescope), but often you see only parts of the discs of Venus and Mercury (the two planets closer to the Sun than Earth).

Inclination of the Moon's oribt

Try this:

  • Wait until the Earth is near one of the axes. 
  • Show the Earth's orbit way down (by holding down F5). 
  • Now crank the Earth's rotation way up (by holding down F8). 

The Moon's orbit should be so fast that you can see its alignment.  It is inclined at 5 degrees to the ecliptic (not to the Earth's equator).  Half the time it is above the ecliptic and half the time it is below.  The two points where it is level with the ecliptic are called the ascending and descending nodes.  These two points do not stay still.  They rotate clockwise once every 18.6 years.  The demo shows this (in the demo, a "year" passes every time the earth orbits the scene).  To see the effect, follow these steps:

  • Make a mental note of the alignment of the Moon's orbit (eg low on the left, high on the right) and the Earth's position
  • Press Page Up to get a bird's-eye view
  • Speed up the Earth's orbit (by holding down F6)
  • Let the Earth go around the Sun four times
  • As the Earth is about to return to its original position, slow the orbit way down (by holding down F5)
  • Press Home to return to the centre of the solar system
  • Make sure the Earth is rotating fast so you can see the Moon's orbital alignment

You should see that the Moon's orbital alignment has shifted by about a quarter turn.  In other words, you have to move your spacecraft a quarter turn clockwise to see the same alignment as before.

Eclipses

An eclipse can only occur when the new moon (solar eclipse) or full moon (lunar eclipse) happens to land on a node (in other words, when the Earth, Sun and nodes fall in a line and the Moon is on one of the two nodes).  Centered on each of these two events is a 37 day period in which solar and lunar eclipses can occur.  The 18.6 year precession helps give rise to the Saros cycle, in which the pattern of eclipses is repeated roughly every 18 years.  A full demonstration of eclipses is beyond the scope of this program - for full details you should check one of the many excellent web pages on the subject.

Simplifications

Apologies to purists (who probably stopped reading this long ago) - there are a huge number of simplifications and approximations in this demo.  Here are a few:

  • Obviously, things are not to scale (this is true of most solar system demos)
  • Earth's orbit around the Sun is circular - it should be elliptical
  • The points of the equinoxes and solstices are as straight and true as compass points - that's not realistic
  • The Moon's orbit around the Earth is circular - it should be elliptical
  • Earth and Moon orbit the centre of the Earth - they should orbit their common centre of gravity
  • The Earth should precess (wobble) on its axis about once every 26,000 years

©2012 Carl Johansen