#include <lunarphase.h>
Public Types | |
enum | Phase { New , FirstQ , LastQ , Full , None } |
enum | Hemisphere { Northern , Southern } |
Public Member Functions | |
LunarPhase (Hemisphere hemisphere=Northern) | |
Phase | phase (const TQDate &date) const |
TQString | phaseStr (const TQDate &date) const |
void | setHemisphere (Hemisphere hemisphere=Northern) |
Hemisphere | hemisphere () const |
TQString | hemisphereStr () const |
Static Public Member Functions | |
static TQString | hemisphereName (Hemisphere hemisphere) |
static TQString | phaseName (Phase phase) |
Detailed Description
Represents and manages a Lunar Phase.
A Lunar Phase can be one of the following:
- "new": the moon is not visible; or traditionally: first visible crescent of the Moon. For religious purposes, the new month begins when the first crescent moon can be seen. Thus, it is impossible to be certain in advance of when months will begin; in particular, the exact date on which Ramadan will begin is not known in advance. In Saudi Arabia, observers are sent up in airplanes if the weather is cloudy when the new moon is expected.
- "first quarter": the right 50% of the moon is visible.
- "full": the moon is fully visible.
- "last quarter": the left 50% of the moon is visible.
A very good description of the lunar phases can be read at the Wikipedia, http://en.wikipedia.org/wiki/Lunar_phase
In the southern hemisphere the order of the phases is reversed. So, to be accurate we need to know the hemisphere.
Note that crescent and gibbous phases are not currently supported.
Definition at line 65 of file lunarphase.h.
Member Function Documentation
◆ hemisphere()
LunarPhase::Hemisphere LunarPhase::hemisphere | ( | ) | const |
Return the hemisphere.
Definition at line 56 of file lunarphase.cpp.
◆ hemisphereName()
|
static |
Return the string representation of hemisphere.
Definition at line 66 of file lunarphase.cpp.
◆ hemisphereStr()
TQString LunarPhase::hemisphereStr | ( | ) | const |
Return hemisphere as a clear text string.
Definition at line 61 of file lunarphase.cpp.
◆ phase()
LunarPhase::Phase LunarPhase::phase | ( | const TQDate & | date | ) | const |
Return the lunar phase for the specified Gregorian date.
The enum 'None' is returned if one of the supported phases does not occur on the date.
- Parameters
-
date compute the lunar phase for the specified Gregorian date.
Definition at line 106 of file lunarphase.cpp.
◆ phaseName()
|
static |
Return the string representation of phase.
- Parameters
-
phase the lunar phase.
Definition at line 84 of file lunarphase.cpp.
◆ phaseStr()
TQString LunarPhase::phaseStr | ( | const TQDate & | date | ) | const |
Return the lunar phase as a text string for the specified date.
A null string is returned if one of the supported phases does not occur on the date.
- Parameters
-
date compute the lunar phase for the specified Gregorian date.
Definition at line 79 of file lunarphase.cpp.
◆ setHemisphere()
void LunarPhase::setHemisphere | ( | Hemisphere | hemisphere = Northern | ) |
The documentation for this class was generated from the following files: