Please enable JavaScript to view this site.

 

int = MoonPhaseAngle(nDate, nTimeOfDay, nMoonDataSourceIndex)

 

This macro function gives the Moon's position in its phase cycle on nDate at nTimeOfDay. Here, “phase angle” means the Moon's geocentric ecliptic longitude minus the Sun's, normalized to the range 0° (inclusive) to 360° (exclusive). The reference points are 0° for new Moon, 90° for first quarter, 180° for full Moon and 270° for last quarter.

 

➢The function multiplies this phase-cycle angle in degrees by 10000 and truncates it to an integer from 0 to 3599999. For example, 2782548 represents 278.2548°.

•Use the local date and time of Moon data source nMoonDataSourceIndex. Supply nTimeOfDay in millionths of a day, using MillionFromHMS.

 

This is a geocentric longitude difference, not the full angular separation of the Moon and Sun on the sky, an illuminated percentage, or the Sun–Moon–Earth angle measured at the Moon. The observer's location does not alter the phase-cycle angle at a given instant. Use a calculated Moon data source; a data-table source returns -1.

 

See also: MoonLongitudeAngle, MoonPhaseOf, MoonPhaseAndTimeOf.

 


Topic 179855, last updated on 12-Oct-2026