Please enable JavaScript to view this site.

 

Navigation: Macros > Macro Language > Built-in Functions > All Functions

PlanetInSolarConjunctionOrOpposition

Scroll Prev Up Next More

int = PlanetInSolarConjunctionOrOpposition(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, or trine to the Earth, with respect to the Sun.

 

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), plus 1 million times the index of the conjunction or opposition occurring on nDate. If no event occurs on nDate, then the function returns 0.

 

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 = PlanetInSolarConjunctionOrOpposition(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 mod 1000000, true)
    endif
endfor

See also: PlanetAtExtremalDistanceFromSun and planetary macro functions.

 


Topic 177620, last updated on 11-Apr-2026