int = PlanetInConjunctionOrOpposition(nDate, nSunSourceIndex, nPlanetID)
This macro function calculates the time, on nDate, when the planet of planetary index nPlanetID is in conjunction, in opposition or in quadrature with the Earth.
•The allowed values for nPlanetID range from n_MERCURY to n_PLUTO.
•The result is the time of the day expressed in one millionth of a day (less than 1/10th of a second).
The macro code below checks if any of the planets is in conjunction, in opposition or in quadrature with the Earth, on the date of the incoming macro token.
for nPl1 = n_MERCURY to n_PLUTO step 1
sBuffer = ''
nCurResIdx = PlanetInConjunctionOrOpposition(n_TokenDate, 1, nPl1)
switch (nCurResIdx div 1000000)
case 1
sBuffer = PlanetName(nPl1) + ' in ' + PlanetaryEvent(n_LOWER_CONJ)
case 2
sBuffer = PlanetName(nPl1) + ' in ' + PlanetaryEvent(n_UPPER_CONJ)
case 3
sBuffer = PlanetName(nPl1) + ' in ' + PlanetaryEvent(n_CONJUNCTION)
case 4
sBuffer = PlanetName(nPl1) + ' in ' + PlanetaryEvent(n_OPPOSITION)
case 5
sBuffer = PlanetName(nPl1) + ' in eastern quadrature'
case 6
sBuffer = PlanetName(nPl1) + ' in western quadrature'
endswitch
// add the time it occurs in parentheses
if nCurResIdx <> 0
sBuffer = sBuffer + FormatTime('" ("hh:nn")"', nCurResIdx, true)
endif
endfor
See also: PlanetAtExtremalDistanceFromSun and planetary macro functions.
Topic 177620, last updated on 18-Apr-2020