Files
astronomy/source/kotlin/doc/next-planet-apsis.md
Don Cross 5676049596 Kotlin: added iterator helper functions
Added the following iterator functions that wrap
search/next pairs of functions:

    globalSolarEclipsesAfter
    localSolarEclipsesAfter
    lunarApsidesAfter
    lunarEclipsesAfter
    moonNodesAfter
    moonQuartersAfter
    planetApsidesAfter
    transitsAfter

I updated the following Kotlin demos:

    MoonPhase.kt    ==> moonQuartersAfter
    LunarEclipse.kt ==> lunarEclipsesAfter

However, I have not yet figured out how to use these
functions in the corresponding Java demos.
2022-05-06 21:52:27 -04:00

1.1 KiB

//astronomy/io.github.cosinekitty.astronomy/nextPlanetApsis

nextPlanetApsis

fun nextPlanetApsis(body: Body, apsis: ApsisInfo): ApsisInfo

Finds the next planetary perihelion or aphelion event in a series.

This function requires an ApsisInfo value obtained from a call to searchPlanetApsis or nextPlanetApsis. Given an aphelion event, this function finds the next perihelion event, and vice versa.

See searchPlanetApsis for more details. See planetApsidesAfter for convenient iteration of consecutive apsides.

Parameters

body The planet for which to find the next perihelion/aphelion event. Not allowed to be Body.Sun or Body.Moon. Must match the body passed into the call that produced the apsis parameter.
apsis An apsis event obtained from a call to searchPlanetApsis or nextPlanetApsis.