Sun and Moon calculator

Items that go good with weather are Sun and Moon data. I found a great JavaScript library that calculates the Sun and Moon phase data for display in your application.

I’ve been using it for a couple of months and it’s as accurate as I can find.

Gary

/*
© 2011-2015, Vladimir Agafonkin
SunCalc is a JavaScript library for calculating sun/moon position and light phases.
https://github.com/mourner/suncalc
*/
// sun calculations are based on http://aa.quae.nl/en/reken/zonpositie.html formulas
// moon calculations, based on http://aa.quae.nl/en/reken/hemelpositie.html formulas
// calculations for moon rise/set times are based on http://www.stargazing.net/kepler/moonrise.html article
// calculations for illumination parameters of the moon,
// based on http://idlastro.gsfc.nasa.gov/ftp/pro/astro/mphase.pro formulas and
// Chapter 48 of “Astronomical Algorithms” 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.

2 Likes