Based on SAMPA (Solar And Moon Position Algorithm) and SPA (Solar Position Algorithm), downloaded from the US Department of Energy, stripped to the barest essentials for the moon, and ported to C++.
SPA and SAMPA were written in 2003 and 2012, respectively, by Afshin Michael Andreas (Afshin.Andreas@NREL.gov), Measurement & Instrumentation Team, Solar Radiation Research Laboratory, National Renewable Energy Laboratory (NREL). They were based on the NREL technical report "Solar Position Algorithm for Solar Radiation Application" by Ibrahim Reda & Afshin Andreas, and the NREL technical report "Solar Eclipse Monitoring for Solar Energy Applications using the Solar and Moon Position Algorithms" by Ibrahim Reda.
Ported by Joey Parrish joey.parrish@gmail.com.