int = PlanetsInConjunctionOrOpposition(nDate, nSunSourceIndex, nPlanet1, nPlanet2)
This macro function returns the type and time of a conjunction, opposition, quadrature or trine between the bodies specified by nPlanet1 and nPlanet2 on nDate. These names describe alignments in geocentric ecliptic longitude, measured as seen from the centre of the Earth.
A conjunction means equal ecliptic longitude; an opposition means a difference of 180°; quadrature means a difference of +90° or -90°; and a trine means a difference of +120° or -120°. These are longitude relationships, not measurements of full angular separation. In particular, a conjunction does not imply that the bodies overlap on the sky or are at their closest approach.
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. The function does not require the bodies to be above the local horizon or visible.
•The allowed values for nPlanet1 and nPlanet2 range from n_MOON to n_PLUTO.
•If no event occurs on nDate, the result is 0. Otherwise it contains the event code multiplied by 1000000, plus the local time in millionths of a day (0 to 999999). Extract the code with div 1000000 and the time with mod 1000000.
The result values of this function are not the planetary-event IDs accepted by PlanetaryEvent and PlanetaryEventSymbol. Use the correspondence table below (where the event code below is obtained using result div 1000000) when calling those functions.
result code |
Event and constant in Event and Symbol functions |
|
0 |
No event |
None |
1 |
Lower conjunction |
n_LOWER_CONJ (1) |
2 |
Upper conjunction |
n_UPPER_CONJ (2) |
3 |
Conjunction |
n_CONJUNCTION (0) |
4 |
Opposition |
n_OPPOSITION (3) |
5 |
Eastern quadrature |
Not defined |
6 |
Western quadrature |
Not defined |
7 |
Trine |
Not defined |
The macro code below checks whether Mercury and Jupiter are in conjunction, opposition, quadrature or trine on the date of the incoming macro token.
sResult = ''
nPl1 = n_MERCURY
nPl2 = n_JUPITER
sBuffer = ''
nCurResIdx = PlanetsInConjunctionOrOpposition(n_TokenDate, 1, nPl1, nPl2)
switch (nCurResIdx div 1000000)
case 3
sBuffer = PlanetName(nPl1) + ' and ' + PlanetName(nPl2) + ' in ' + PlanetaryEvent(n_CONJUNCTION)
case 4
sBuffer = PlanetName(nPl1) + ' and ' + PlanetName(nPl2) + ' in ' + PlanetaryEvent(n_OPPOSITION)
case 5
sBuffer = PlanetName(nPl1) + ' and ' + PlanetName(nPl2) + ' in eastern quadrature'
case 6
sBuffer = PlanetName(nPl1) + ' and ' + PlanetName(nPl2) + ' in western quadrature'
case 7
sBuffer = PlanetName(nPl1) + ' and ' + PlanetName(nPl2) + ' trine'
endswitch
if sBuffer <> ''
sResult = sBuffer + FormatTime('" ("hh:nn")"', nCurResIdx mod 1000000, true)
endif
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: PlanetAtExtremalDistanceFromSun and planetary macro functions.
Topic 188970, last updated on 12-Oct-2026