search_planet_apsis: Search for the next planetary apsis
Description
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.
Usage
search_planet_apsis(body, start_time)
Value
A list containing:
kind
An integer flag: 0 for perihelion, 1 for aphelion.
time
A POSIXct value representing the date and time of the
next planetary apsis.
dist_au
The distance from the planet to the Sun in astronomical units.
dist_km
The distance from the planet to the Sun in kilometers.
Arguments
body
Integer constant identifying the planet. Use astro_body["PLANET_NAME"]
where PLANET_NAME is one of: "MERCURY", "VENUS", "EARTH", "MARS",
"JUPITER", "SATURN", "URANUS", "NEPTUNE", or "PLUTO".
Not allowed to be "SUN" or "MOON".
start_time
A POSIXct value indicating the date and time at which to
start searching for the next perihelion or aphelion.
Details
The closest point is called perihelion and the farthest point is called aphelion.
To iterate through consecutive alternating perihelion and aphelion events,
call search_planet_apsis() once, then use the return value to call
next_planet_apsis(). After that, keep feeding the previous return value
into another call of next_planet_apsis() as many times as desired.
# Find the next perihelion/aphelion of Mars after 2025-01-01start <- as.POSIXct("2025-01-01", tz = "UTC")
apsis <- search_planet_apsis(astro_body["MARS"], start)
apsis