Siddhanta Parity API Documentation - v1.3.0
    Preparing search index...
    • Finds the time when a function ascends through zero.

      Search for next time t (such that t is between t1 and t2) that func(t) crosses from a negative value to a non-negative value. The given function must have "smooth" behavior over the entire inclusive range [t1, t2], meaning that it behaves like a continuous differentiable function. It is not required that t1 < t2; t1 > t2 allows searching backward in time. Note: t1 and t2 must be chosen such that there is no possibility of more than one zero-crossing (ascending or descending), or it is possible that the "wrong" event will be found (i.e. not the first event after t1) or even that the function will return null, indicating that no event was found.

      Parameters

      • f: (t: AstroTime) => number

        The function to find an ascending zero crossing for. The function must accept a single parameter of type AstroTime and return a numeric value: function(AstroTime) => number

      • t1: AstroTime

        The lower time bound of a search window.

      • t2: AstroTime

        The upper time bound of a search window.

      • Optionaloptions: SearchOptions

        Options that can tune the behavior of the search. Most callers can omit this argument.

      Returns AstroTime | null

      If the search is successful, returns the date and time of the solution. If the search fails, returns null.