Celestine API Documentation - v0.2.0
    Preparing search index...

    Function solveKepler

    • Solves Kepler's equation for eccentric anomaly.

      Parameters

      • meanAnomaly: number

        Mean anomaly M in degrees

      • eccentricity: number

        Orbital eccentricity e (0 ≤ e < 1 for ellipse)

      Returns number

      Eccentric anomaly E in degrees

      If eccentricity is out of range [0, 1)

      If iteration does not converge

      Uses Newton-Raphson iteration: E_{n+1} = E_n - (E_n - e·sin(E_n) - M) / (1 - e·cos(E_n))

      Convergence is typically achieved in 3-5 iterations for planetary eccentricities (all < 0.25 except Pluto at ~0.25).

      // Earth's eccentricity ~0.0167, mean anomaly 90°
      const E = solveKepler(90, 0.0167);
      // E ≈ 90.955° (slightly ahead of mean due to eccentricity)

      Meeus, "Astronomical Algorithms", Eq. 30.7, p. 196