Returns the Moon phase as an angle

Namespace: ASCOM.Astrometry.AstroUtils
Assembly: ASCOM.Astrometry (in ASCOM.Astrometry.dll) Version: (


public double MoonPhase(
	double JD
Visual Basic
Public Function MoonPhase ( _
	JD As Double _
) As Double
Visual C++
virtual double MoonPhase(
	double JD
) sealed


Type: System..::..Double
Julian day (UTC) for which the Moon phase is required

Return Value

Moon phase as an angle between -180.0 amd +180.0 (see Remarks for further description)


To allow maximum freedom in displaying the Moon phase, this function returns the excess of the apparent geocentric longitude of the Moon over the apparent geocentric longitude of the Sun, expressed as an angle in the range -180.0 to +180.0 degrees. This definition is taken from Astronomical Algorithms (Second Edition, Corrected to August 2009) Chapter 49 p349 by Jean Meeus (Willmann-Bell 1991).

The frequently used eight phase description for phases of the Moon can be easily constructed from the results of this function using logic similar to the following:

Select Case MoonPhase
     Case -180.0 To -135.0
         Phase = "Full Moon"
     Case -135.0 To -90.0
         Phase = "Waning Gibbous"
     Case -90.0 To -45.0
         Phase = "Last Quarter"
     Case -45.0 To 0.0
         Phase = "Waning Crescent"
     Case 0.0 To 45.0
         Phase = "New Moon"
     Case 45.0 To 90.0
         Phase = "Waxing Crescent"
     Case 90.0 To 135.0
         Phase = "First Quarter"
     Case 135.0 To 180.0
         Phase = "Waxing Gibbous"
End Select

Other representations can be easily constructed by changing the angle ranges and text descriptors as desired. The result range -180 to +180 was chosen so that negative values represent the Moon waning and positive values represent the Moon waxing.

See Also