Computing Moon Phase in 150 Lines of JavaScript — Julian Date, Synodic Month, and SVG Terminator
"Wait, what phase is the moon in tonight?" — that question deserves a 150-line answer, not a Google search. The math is small: convert the date to Julian Date, divide ...