#ifndef _utl_MoonCycle_h_ #define _utl_MoonCycle_h_ #include namespace utl { /** \class MoonCycle MoonCycle.h utl/MoonCycle.h \author Segev BenZvi \author Darko Veberic \date 22 Jul 2009 \version $Id$ \ingroup time */ class MoonCycle { public: enum LunationEpoch { eJan2000, eJan2004 }; enum LunationType { eNewMoon, eFirstQuarter, eFullMoon, eLastQuarter }; MoonCycle(const TimeStamp& time) : fTime(time) { } /// Decimal number of moon cycles (New,1Q,Full,3Q) since Jan 2000 or 2004. /// Worst case inaccuracy with respect to the true lunation is +/-14 hours. double GetLunation(const LunationType type = eFullMoon, const LunationEpoch epoch = eJan2004) const; /// Integer number of full moons since a start date (default = Jan 2004). long GetFullMoonCycle(const LunationEpoch epoch = eJan2004) const { return long(GetLunation(eFullMoon, epoch)); } private: const TimeStamp fTime; }; } #endif