Please enable JavaScript to view this site.


int = PlanetsNearOn(nDate, nSunDataSourceIndex, nPlanet1, nPlanet2)


This macro function returns a value of -1 if the planets nPlanet1 and nPlanet2 are not near each other on nDate (nearness is defined as the 2 planets having the same Right Ascension). If the 2 planets are near each other on that date, then this function returns the time of the day, as a fraction from 0 (the beginning of the day to 1000000 (at midnight at the end of the day). As there are about 85000 seconds in a day, the division of the day into 1 million results in a precision of about 1/10th of a second.


The planets are specified using a numerical index, as found in the table here, and where the indices 0 to 9 (Sun to Pluto) can be replaced by a variable made up of n_ followed by the name of the body in uppercase (for example n_MOON).


You will get an error message in the following cases:


nPlanet1 = nPlanet2


Either of the planets is the Sun, as nearness with respect to the Sun is not defined (use the function HeliacalEventOnDate instead).


Either of the planets indices is less than 0 or more than 9.

// Nearness of planet-planet pairs
nMinPlanet = n_MOON
nMaxPlanet = n_URANUS
for nPl1 = n_URANUS to (n_MOON+1step -1 // planet 1 can be a star
    for nPl2 = (n_URANUS-1to n_MOON step -1 // planet 2 can only be a planet
        if nPl2 >= nPl1
        sBuffer = ''
        nComboResult = PlanetsNearOn(n_TokenDate, 1, nPl1, nPl2)
        nCurTime = nComboResult mod 1000000
        if nCurTime > 0
            nTenthOfDegreesSep = (nComboResult div 1000000)
            switch nTenthOfDegreesSep
                case 0..50
                    if nPl2 == n_MOON
                        // only add nearness entry if there was no occultation
                        if pos('occultation of ' + PlanetName(nPl1), sOccultationsBuffer) == 0
                            sBuffer = PlanetName(nPl2) + ', ' + PlanetName(nPl1) + ' very close'
                        sBuffer = PlanetName(nPl2) + ', ' + PlanetName(nPl1) + ' very close'
                case 51..100
                    sBuffer = PlanetName(nPl2) + ', ' + PlanetName(nPl1) + ' close'
                case 101..200
                    sBuffer = PlanetName(nPl2) + ', ' + PlanetName(nPl1) + ' conjunct'

Note that the result of this function are affected by the Sun data source you have selected for the current script.


See also: planetary macro functions.


Topic 177565, last updated on 18-Apr-2020