int = PlanetAtMaximumBrightness(nDate, nSunSourceIndex, nPlanetID)
This macro function calculates the time on nDate when Mercury or Venus reaches a local maximum in apparent brightness. On the astronomical magnitude scale, a brighter object has a smaller magnitude, so “maximum brightness” corresponds to a minimum in apparent magnitude.
•The allowed values for nPlanetID are the 2 inner planets only; n_MERCURY and n_VENUS.
•If a maximum occurs on nDate, the result is its local time in millionths of a day, truncated to an integer. If that time would truncate to 0, the function returns 1 instead. A result of 0 means that no maximum was found on the specified date.
The maximum concerns the planet's geocentric apparent magnitude, rather than brightness after attenuation by the observer's local atmosphere. The function returns an event time, not the magnitude itself. It detects an individual brightness maximum, not an annual maximum, and does not require the planet to be above the local horizon or visibly detectable.
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.
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: planetary macro functions.
Topic 180130, last updated on 18-Apr-2020