Here are the applet source files:
Image credits:
- The world map is distributed in the Macintosh Scrapbook and is copyright © Apple Computer Inc. Used by permission of Apple Computer Inc.
- The moon image was adapted from a photograph of a completely full moon taken, just before an eclipse, by Michael Myers and is used by permission of the photographer.
Algorithm credits:
- The algorithms used to compute sun and moon data were adapted from "Astronomy on the Personal Computer."
- The low-precision computation of sunrise, sunset and twilight in SunrisePixels.java was adapted from The Explanatory Supplement to the Astronomical Almanac. The algorithm is also described on the USNO Time Services web page.
- The moon phase computation was adapted from a public-domain C implementation copyright © 1992 by John Walker and originally based on algorithms in "Practical Astronomy With Your Calculator."
- Astronomical utilities are from Astronomical Formulae for Calculators, Second Edition," "Practical Astronomy with Your Calculator" (3rd Edition), and "Astronomy on the Personal Computer".
- The algorithm used to locate an appropriate time zone is from from a Great Circle Computer web page developed by Steve Mitchell.
- The hierarchical list routines were adapted from an article in Java World, January 1997, and from my article in Apple's develop magazine issue 18, June 1994.
- Several of the utility routines were adapted from David M. Geary and Alan L. McClellan, "Graphic Java" ISBN 0-13-565847-0.
- You can get more information (and more accurate information) about timezones, sunrise, and moonrise times from the Directorate of Time at the United States Naval Observatory.
Known bugs, misfeatures, and future improvements:
- When viewed from the Southern Hemisphere, the moon is upside down. I.e., when the moon looks like a D in the Northern Hemisphere, it looks like a C in the Southern Hemisphere. To fix this requires additional trignometry and knowledge of the sun's location.
- The display looks terrible on monochrome and gray-scale displays. This could easily be fixed if Java could tell applets more about their execution environment.
These books will be useful if you are interested in astronomical computation:
If you find any bugs in this applet, please contact me.
Click here to return to the main page.