Please enable JavaScript to view this site.

 

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

PlanetAtExtremalDeclination

Scroll Prev Up Next More

int = PlanetAtExtremalDeclination(nDate, nSunSourceIndex, nPlanetID)

 

This macro function calculates the time, on nDate, when the planet of planetary index nPlanetID is has attained a maximal (most northerly) or minimal (most southerly) declination in the sky.

 

The allowed values for nPlanetID range from n_MERCURY to n_PLUTO, and also include n_SUN and n_MOON.

The sign of the result is positive if the planet is at its maximal northern declination, and negative if the planet has a maximal southern declination, on nDate. If the date nDate does not correspond to either case, then the function returns 0.

The absolute value of 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, including Pluto, and the Moon and the Sun, have attained their maximal or minimal declination in the sky, on the date of the incoming macro token.

for nPlanetID = n_SUN to n_PLUTO step 1
    sBuffer = ''
    nCurResIdx = PlanetAtExtremalDeclination(n_TokenDate, 1, nPlanetID)
    if nCurResIdx > 1
       sBuffer = PlanetName(nPlanetID) + ' furthest north'
    endif
    if nCurResIdx < -1
       sBuffer = PlanetName(nPlanetID) + ' furthest south'
    endif
    // add the time it occurs in parentheses
    if Abs(nCurResIdx) > 1
       sBuffer = sBuffer + FormatTime('" ("hh:nn")"', Abs(nCurResIdx), true)
    endif
endfor

This is an event that depends on the position of an observer on the Earth and of the position of the Earth, in contrast to PlanetAtExtremalLatitude which is independent of the position of an observer on the Earth and indeed is independent of the position of the Earth with respect to planet nPlanetID.

 

See also: planetary macro functions.

 


Topic 183070, last updated on 18-Apr-2020