MoonPhase
flmoon() calculates the julian date of nth lunar cycle and nph phase of the moon since Jan 1900 n is the number of lunar cycle since Jan 1900 - ??? This is the original function from the book. It's been modified to work in JavaScript. I also rewrote it to be litte clearer. And added comments where I unterstood what was going on and increased the accuracy of a few constants.
number
:
The full Julian date of the nth lunar cycle plus nph phase
Note that the integer and fractional parts are
returned by references.
sun_anomaly
Sun's mean anomaly
moon_anomaly
Moon's mean anomaly
xtra
Not sure of what's up here, but two of the numbers very interesting Notice that 2415020.75933 is used a referce epochs for mean time of lunar cycle which is 1900 Jan 1 at 6:13 AM And 29.53058868 is the "Synodic month" or the mean time in days between new moons.
xtra
Looks like this is all being done to adjust the variations in the maen lunar cycle of 29.53058868 Which from what I understand is due the moons orbit in relationship to the earths orbit around the sun.
jd
Ok 2415020 is Julian date 1899 at noon + .75933 is the Julian date of a new moon 28 + 1.53058868 is mean time of a lunar cycle , and 7 close to 7.38264717 a lunar phase but unlike the first two the tractional part dose not seem to be accounted for.
int_part
This parts easy just put the integer and fractional parts right
n
12.37 is the number of lunar cycles per year n then is the number of lunar cycles since 1900 and the year month entered