solve_kepler

Function solve_kepler 

Source
pub fn solve_kepler(
    mean_anomaly: Radians,
    e: Eccentricity,
) -> Result<KeplerSolution, String>
Expand description

Solve Kepler’s equation M = E - e*sin(E) for eccentric anomaly E.

Uses Newton-Raphson iteration with a smart initial guess.

§Arguments

  • mean_anomaly - Mean anomaly M (radians)
  • e - Eccentricity (must be < 1 for elliptical orbits)

§Returns

Ok(KeplerSolution) on convergence, Err message if max iterations exceeded.

§Assumptions

  • Elliptical orbit only (e < 1). For hyperbolic orbits, use a different solver.