libkholidays

LunarPhase Class Reference

#include <lunarphase.h>

List of all members.


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.


Public Types

enum  Phase {
  New, FirstQ, LastQ, Full,
  None
}
enum  Hemisphere { Northern, Southern }

Public Member Functions

 LunarPhase (Hemisphere hemisphere=Northern)
 ~LunarPhase ()
Phase phase (const QDate &date) const
QString phaseStr (const QDate &date) const
void setHemisphere (Hemisphere hemisphere=Northern)
Hemisphere hemisphere () const
QString hemisphereStr () const

Static Public Member Functions

static QString hemisphereName (Hemisphere hemisphere)
static QString phaseName (Phase phase)

Member Function Documentation

LunarPhase::Phase LunarPhase::phase ( const QDate &  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.

QString LunarPhase::phaseStr ( const QDate &  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.

void LunarPhase::setHemisphere ( Hemisphere  hemisphere = Northern  ) 

Set the hemisphere.

Parameters:
hemisphere Hemisphere

Definition at line 51 of file lunarphase.cpp.

LunarPhase::Hemisphere LunarPhase::hemisphere (  )  const

Return the hemisphere.

Definition at line 56 of file lunarphase.cpp.

QString LunarPhase::hemisphereStr (  )  const

Return hemisphere as a clear text string.

Definition at line 61 of file lunarphase.cpp.

QString LunarPhase::hemisphereName ( Hemisphere  hemisphere  )  [static]

Return the string representation of hemisphere.

Definition at line 66 of file lunarphase.cpp.

QString LunarPhase::phaseName ( Phase  phase  )  [static]

Return the string representation of phase.

Parameters:
phase the lunar phase.

Definition at line 84 of file lunarphase.cpp.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys