Please enable JavaScript to view this site.

 

int = MoonLongitudeAngle(nDate, nTimeOfDay, nMoonDataSourceIndex, bTopocentric)

 

This macro function returns the Moon's longitude angle on the date nDate at nTimeOfDay for the moon data source of position nMoonDataSourceIndex.

 

➢The function returns 10000 times the longitude angle (a result of 2782548 would mean 278.2548 degrees).

•The parameter nTimeOfDay should be supplied in one millionth of a day (less than 1/10th of a second), using the function MillionFromHMS to avoid any error.

•The parameter bTopocentric determines if the calculation is based on the position of the observer for nMoonDataSourceIndex, otherwise that parameter is only used for the timezone information.

 

The macro code below checks if the Moon enters a new Zodiac sign on nRunDate and which one it is.

nAt2359 = MillionFromHMS(23,59,59)
nLongitude = MoonLongitudeAngle(nRunDate-1, nAt2359, 1, true)
nPreviousZodiacIndex = 1 + (nLongitude div 300000) 
nLongitude = MoonLongitudeAngle(nRunDate, nAt2359, 1, true)
nCurrentZodiacIndex = 1 + (nLongitude div 300000) 
if nCurrentZodiacIndex <> nPreviousZodiacIndex
   sResult = 'Moon enters ' + ZodiacName(nCurrentZodiacIndex)
else
   sResult = ''
endif 

The function MoonLongitudeAngle calculated on a loop of the days of the year, could be used to calculate the result of MoonZodiacSignOf (in a much less convenient manner, though).

 

See also: MoonZodiacSignOf, MoonPhaseAngle, TithiNumberOf, TithiTimeOf.

 


Topic 179850, last updated on 18-Nov-2026