Moontool for Windows

16-bit Edition for Windows 3.x

by John Walker
March 16 MIM

Moontool for Windows is a 16-bit Microsoft Windows application that calculates the phase of the Moon at either the current time or at any user-specified time and displays a picture of the Moon at the correct phase, either as an icon or in an open window.

Moontool Display

Moontool window When the Moontool window is open, it displays comprehensive information about the Moon, as shown at the right.

When closed to an icon, Moontool displays the image of the Moon at the current phase, subtitled with the age of the Moon in days and hours (or hours and minutes when the Moon is less than one day old). If Moontool is launched from the "load=" statement in WIN.INI, it starts as an icon, permitting you to include the Moon as a permanent embellishment of your Windows desktop.

Moontool allows the information displayed in the open window to be copied to the clipboard as a bitmap, permitting you to paste it into another document.

In addition to displaying the Moon at the current time, Moontool can calculate the appearance of the Moon at any user-specified date and time. Two dialogues permit entering date and time either as a conventional Universal time (year, month, day, hours, minutes, and seconds) or as a Julian date. These dialogues perform instantaneous conversion between Universal time and Julian date, serving thus as a Julian date calculator, handy by itself to astronomers. You can animate the display of the Moon by placing Moontool into "Fast mode", showing the progression of phases at the rate of one day every few seconds.

Moontool's ability to display the Moon at any date in history lets you quickly answer questions such as that posed in the April 1992 issue of Sky and Telescope (page 437): did Paul Revere's midnight ride really occur under the full Moon, or did Longfellow add the Moon to his poem purely for atmosphere? Firing up Moontool and entering the time and date of Revere's ride: 05:00:00 UTC April 19th, 1775, we find that the Moon was 87% full that night, waning from the last full Moon at 21:53 UTC on April 15th, 1775. Moontool tells us that the Moon was indeed close to full that night, confirming Revere's own recollection that "the Moon shone bright".


Moontool is a 16-bit application which runs under Microsoft Windows 3.0 (and above) in any mode (including real mode on Windows 3.0; it is one of the few remaining programs which will). It is written in Microsoft Quick C 1.00, and source code is available. If you're running a 32-bit version of Windows such as Windows 95/98 or Windows NT, you should download the 32-bit version of Moontool. While this 16-bit version of Moontool works fine on 32-bit Windows platforms, the native 32-bit edition of Moontool provides additional functionality absent on earlier versions of Windows.

The source and executable code for Moontool are in the public domain. You are free to use it in any manner you wish without permission, restriction, attribution, or compensation.

Time Zone Specification

In order to calculate information about the Moon, Moontool must know the relationship between the local time provided by the system clock on MS-DOS and Universal (or Greenwich Mean) Time. This is provided by the "TZ" environment variable, normally set at system startup time in AUTOEXEC.BAT. The time zone is specified as:
SET TZ=tzn[+|-]hh[:mm[:ss]][dzn]
Three character abbreviation for the time zone name.
The difference in hours between GMT and the local time. A leading '+' or '-' sign is optional.
Optional minutes difference.
Optional seconds difference.
Optional three character abbreviation for the time zone name during daylight savings time (if used in this locality).
TZ specifications for time zones in the 48 contiguous United States are:

Zone SET TZ=
Eastern EST5EDT
Central CST6CDT
Mountain MST7MDT
Pacific PST8PDT

If no TZ specification is present, Moontool issues a warning alert when launched and uses the system default of the US Pacific time zone. the relationship between the local time provided by the system clock on MS-DOS and Universal Time (or Greenwich Mean Time).

Downloading and Installation

Download Moontool: (Zipped archive, 32 Kb)

After you've downloaded the program archive, extract the files it contains with PKUNZIP or a compatible archive extract program into a new directory, then launch the Moontool.exe program from that directory.

Experienced C programmers who wish to modify this program or simply read the code to see how it works may download the source code. You're welcome to use this source code in any way you like, but absolutely no support is provided--you're entirely on your own.

Moontool History

Moontool was originally written for the Sun Workstation under the SunView graphical user interface by John Walker in December of 1987. The program was posted to the Usenet news group comp.sources.unix in June 1988 and was subsequently widely distributed within the Sun user community. As the original posting began, "What good's a Sun without a Moon?".

In 1988 and 1989 Ron Hitchens contributed additional features to the Sun version of the program, including the shaded Moon images which were drawn by Joe Hitchens on an Amiga computer.

In December of 1991 I implemented Moontool under the X Window system using the OpenLook toolkit. That version formed the starting point for this Microsoft Windows Moontool which was completed in March of 1992.

In March of 1999 I made a 32-bit version including a help file and this 16-bit version was updated to incorporate several minor bug fixes uncovered in testing its 32-bit descendent.

Astronomical Programming Resources

Algorithms used to calculate the positions of the Sun and Moon and the other items displayed by Moontool are given in the following books.

Meeus, Jean. Astronomical Algorithms. Richmond: Willmann-Bell, 1991. ISBN 0-943396-35-2.
A must-have; if you only buy one book, make sure it's this one. Algorithms are presented mathematically, not as computer programs, but source code implementing many of the algorithms in the book can be ordered separately from the publisher in either QuickBasic, Turbo Pascal, or C. Meeus provides many worked examples of calculations which are essential to debugging your code, and frequently presents several algorithms with different tradeoffs among accuracy, speed, complexity, and long-term (century and millennia) validity.

Duffett-Smith, Peter. Practical Astronomy With Your Calculator. 3rd ed. Cambridge: Cambridge University Press, 1981. ISBN 0-521-28411-2.
Despite the word Calculator in the title; this is a valuable reference if you're interested in developing software which calculates planetary positions, orbits, eclipses, and the like. More background information is given than in Meeus, which helps those not already versed in astronomy learn the often-confusing terminology. The algorithms given are simpler and less accurate than those provided by Meeus, but are suitable for most practical work.

These references can be obtained from Willmann-Bell, P.O. Box 35025, Richmond, VA 23235, USA. Phone: (804) 320-7016. In addition to their own publications, they stock most of the standard references for mathematical and positional astronomy.

Home Planet

Moontool has largely been superseded by the much more comprehensive program Home Planet, which includes a Moon and Sun panel derived from Moontool. If you enjoy Moontool, check out Home Planet; it's also free.

Other Astronomy Resources at Fourmilab

Earth and Moon Viewer

Inconstant Moon

Solar System Live

Your Sky

Fourmilab home page

by John Walker