Please enable JavaScript to view this site.

 

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

PlanetInLunarConjunctionOrOpposition

Scroll Prev Up Next More

int = PlanetInLunarConjunctionOrOpposition(nDate, nSunSourceIndex, nPlanetID)

 

This macro function calculates the time, on nDate, when the planet of planetary index nPlanetID is in conjunction, in opposition, in quadrature with the Earth, or trine to the Earth, with respect to the Moon.

 

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, in quadrature with the Earth, or trine with the Earth, on the date of the incoming macro token.

for nPl1 = n_MERCURY to n_PLUTO step 1
    sBuffer = ''
    nCurResIdx = PlanetInLunarConjunctionOrOpposition(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'
        case 7
            sBuffer = PlanetName(nPl1) + ' trine'
    endswitch
    // add the time it occurs in parentheses
    if nCurResIdx <> 0
       sBuffer = sBuffer + FormatTime('" ("hh:nn")"', nCurResIdx, true)
    endif
endfor

See also: PlanetInConjunctionOrOpposition, planetary events, PlanetAtExtremalDistanceFromSun and planetary macro functions.

 


Topic 188965, last updated on 04-Apr-2026