Moon Phase: How it worksMoon Phase provides a computer-generated approximation of what the moon currently looks like. While less impressive than the real thing, it doesn't require waiting for a cloudless night.
It is based on a composite image of the moon made up of data from various satellites. Every hour, this image is mapped onto a sphere and shaded by xplanet according to the current positions of the earth and moon, then post-processed by ImageMagick to remove some visible artifacts.
When the page is viewed, perl's Astro::MoonPhase generates data about the moon's current status, such as percent illuminated and the times of nearby full and new moons. This is formatted in HTML and sent to your browser along with the most recently generated image.