public static double MoonPhase(
double JD
)Public Shared Function MoonPhase (
JD As Double
) As DoubleThe 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.