Does anyone know an algorithm to either calculate the moon phase or age on a given date or find the dates for new/full moons in a given year?
Googling tells me the answer is in some Astronomy book, but I don't really want to buy a whole book when I only need a single page.
Update:
I should have qualified my statement about googling a little better. I did find solutions that only worked over some subset of time (like the 1900's); and the trig based solutions that would be more computationally expensive than I'd like.
S Lott in his Python book has several algorithms for calculating Easter on a given year, most are less than ten lines of code and some work for all days in the Gregorian calendar. Finding the full moon in March is a key piece of finding Easter so I figured there should be an algorithm that doesn't require trig and works for all dates in the Gregorian calendar.