libkholidays
lunarphase.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KHOLIDAYS_LUNARPHASE_H
00023 #define KHOLIDAYS_LUNARPHASE_H
00024
00025 #include "kholidays_export.h"
00026 #include <QString>
00027
00028 class QDate;
00029
00030 namespace LibKHolidays {
00031
00054 class KHOLIDAYS_EXPORT LunarPhase
00055 {
00056 public:
00062 enum Phase {
00063 NewMoon,
00064 FirstQuarter,
00065 LastQuarter,
00066 FullMoon,
00067 None
00068 };
00069
00074 LunarPhase();
00075
00079 ~LunarPhase();
00080
00088 Phase phase( const QDate &date ) const;
00089
00097 QString phaseStr( const QDate &date ) const;
00098
00104 static QString phaseName( Phase phase );
00105
00106 private:
00114 double percentFull( uint t ) const;
00115
00123 double degreesToRadians( double degree ) const;
00124
00130 void adj360( double *degree ) const;
00131 };
00132
00133 }
00134
00135 #endif