The planet for which to find the next perihelion/aphelion event.
Not allowed to be Body.Sun or Body.Moon.
The date and time at which to start searching for the next perihelion or aphelion.
The next perihelion or aphelion that occurs after startTime.
Finds the next perihelion or aphelion of a planet.
Finds the date and time of a planet's perihelion (closest approach to the Sun) or aphelion (farthest distance from the Sun) after a given time.
Given a date and time to start the search in
startTime, this function finds the next date and time that the center of the specified planet reaches the closest or farthest point in its orbit with respect to the center of the Sun, whichever comes first afterstartTime.The closest point is called perihelion and the farthest point is called aphelion. The word apsis refers to either event.
To iterate through consecutive alternating perihelion and aphelion events, call
SearchPlanetApsisonce, then use the return value to call NextPlanetApsis. After that, keep feeding the previous return value fromNextPlanetApsisinto another call ofNextPlanetApsisas many times as desired.