int = PlanetOnMeridian(nDate, nSunSourceIndex, nPlanetID)
In this function's name, “meridian” means the zero-longitude reference meridian of the ecliptic coordinate system. This macro function finds when nPlanetID crosses 0° geocentric ecliptic longitude on nDate. It does not calculate passage across the observer's local north–south meridian or the body's daily culmination.
•The allowed values of nPlanetID range from n_SUN to n_PLUTO, including n_MOON.
•A positive result denotes an eastward crossing (increasing longitude through 360°/0°); a negative result denotes a westward crossing (decreasing longitude through 0°/360°). The result is 0 if no crossing occurs on nDate.
•The absolute value of a nonzero result is the local time expressed in millionths of a day. The fractional day is multiplied by 1000000 and truncated. If this would give 0, the function returns +1 or -1, preserving the event's sign and reserving 0 for no event.
Use a calculated Sun data source, selected by nSunSourceIndex. Dates and returned times use that source's local-time settings. The event is geocentric (as seen from the centre of the Earth): the observer's position on Earth does not change its instant, although the local date and time can differ between sources.
This example checks whether the Moon or any planet crosses the zero-longitude reference meridian on the date of the incoming macro token.
sResult = ''
for nPlanetID = n_MOON to n_PLUTO step 1
sBuffer = ''
nCurResIdx = PlanetOnMeridian(n_TokenDate, 1, nPlanetID)
if nCurResIdx > 0
sBuffer = PlanetName(nPlanetID) + ' crossing 0 degrees ecliptic longitude eastward'
endif
if nCurResIdx < 0
sBuffer = PlanetName(nPlanetID) + ' crossing 0 degrees ecliptic longitude westward'
endif
// add the time it occurs in parentheses
if nCurResIdx <> 0
sBuffer = sBuffer + FormatTime('" ("hh:nn")"', Abs(nCurResIdx), true)
endif
if sBuffer <> ''
if sResult <> ''
sResult = sResult + ', '
endif
sResult = sResult + sBuffer
endif
endfor
One millionth of a day represents 0.0864 seconds in the time encoding; this specifies the units, not a guarantee of subsecond calculation accuracy.
See also: planetary macro functions.
Topic 180115, last updated on 12-Oct-2026