Documentation
    Preparing search index...

    Function ballisticTimeToApex

    • Time in seconds at which a projectile launched with velocity reaches the vertex of its parabola — the instant its velocity along the gravity axis is zero:

      (velocity + gravity · t) · ĝ = 0   ⟹   t = −(velocity · gravity) / |gravity|²
      

      The result is negative when the apex is in the past (a projectile fired downwards is already past the vertex). That is the honest answer for the extrapolated parabola and it keeps the apex identities below exact; callers that only care about the future check the sign.

      With zero gravity there is no vertex and the result is Infinity, matching how ParabolicTrajectory.duration reports a flight that never returns.

      Identities, both asserted in the tests:

      apexHeight = ½ · |gravity| · timeToApex²
      flight time between two crossings of one plane = 2 · (timeToApex − t_first)
      

      Parameters

      Returns number