The closest point is called perigee and the farthest point is called apogee.
The word apsis refers to either event.
To iterate through consecutive alternating perigee and apogee events, call
search_lunar_apsis() once, then use the return value to call
next_lunar_apsis(). After that, keep feeding the previous return value from
next_lunar_apsis() into another call of next_lunar_apsis() as many times
as desired.