Phases Of The Moon

January 22, 2010

We calculate the moon’s age in days since the last new moon using the formula given previously, using the julian function from the Standard Prelude to number the days. Normalize is a convenience function that extracts the fractional part of a real number:

I didn’t have any time for actually coding this up, but John Conway has a way of computing the phase of the moon that can be done in your head as part of his (formerly two vollume, now republished by AK Peterson as 4 volume) series Winning Ways. The “nice” feature of this is that it doesn’t actually require any conversion to julian dates. I think that most of these proposed solutions are slightly off: some don’t perform proper rounding, and most seem to ignore the fact that the first new moon of January 2000 was January 6,