danhey / kepler.py

Fast and stable solver for Kepler's equation in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fast and stable solver for Kepler's equation extracted from exoplanet.

Installation

The best way to install is using pip:

python -m pip install kepler.py

Usage

This package exposes two functions:

  • kepler: Solves Kepler's equation and returns the cosine and sine of the true anomaly:
import kepler
eccentric_anomaly, cos_true_anomaly, sin_true_anomaly = kepler.kepler(mean_anomaly, eccentricity)
  • solve: A lower-level interface that is used by kepler to actually do the solving (Note that this will return garbage for eccentricities out of the range zero to one):
import kepler
eccentric_anomaly = kepler.solve(mean_anomaly, eccentricity)

About

Fast and stable solver for Kepler's equation in Python

License:MIT License


Languages

Language:Python 54.5%Language:C++ 37.0%Language:CMake 8.5%