@zodiacs/engine 1.0.0
    Preparing search index...

    Function findLongitudeCrossingsWith

    • Every instant in (from, to] when body sits exactly on targetLongitude, in time order, from the longitudes longitudeAt returns.

      The scan samples from, every stepDays after it, and to, and bisects each sign change of the offset from the target 24 times, to the step divided by 2^24. A root exactly at from is left to the window that ends there. A sample exactly on the target is reported once, at that sample, in the direction of the sample before it. Offsets of 90° or more are read as the far side of the circle, not a crossing.

      A plain scan loses both crossings when a station falls between two samples just past the target: at a 5-day step, a Saturn station within 0.0103° of it, or a Jupiter station within 0.0205°. Where the sampled motion turns without the offset changing sign, and the turning sample is within reach of the local curvature, a golden-section search finds the extremum. Both crossings are bisected when it passes the target, and one is reported, as direct, when it only touches. A turn in the first or last cell is found by a probe one minute inside the window; no sample falls outside [from, to]. Crossings less than a second after another are the same crossing. The search assumes smooth motion with at most one station in two steps; it is tested, not proven complete.

      There is no sample budget: the work grows with (to − from) / step, and searchLongitudeCrossingsWith bounds it. Throws RangeError for an invalid window, target or step, and for a non-finite longitude.

      Type Parameters

      Parameters

      • longitudeAt: BodyLongitudeAt<B>
      • body: B
      • targetLongitude: number
      • from: Date
      • to: Date
      • OptionalstepDays: number

      Returns LongitudeCrossing[]