https://github.com/dfm/kepler.py
Fast and stable solver for Kepler's equation in Python
https://github.com/dfm/kepler.py
Last synced: about 1 year ago
JSON representation
Fast and stable solver for Kepler's equation in Python
- Host: GitHub
- URL: https://github.com/dfm/kepler.py
- Owner: dfm
- License: mit
- Created: 2020-06-23T14:51:05.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2022-09-23T00:06:48.000Z (over 3 years ago)
- Last Synced: 2025-04-09T02:41:38.602Z (about 1 year ago)
- Language: Python
- Size: 43 KB
- Stars: 17
- Watchers: 3
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Fast and stable solver for Kepler's equation extracted from [exoplanet](https://docs.exoplanet.codes).
## Installation
The best way to install is using pip:
```bash
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:
```python
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*):
```python
import kepler
eccentric_anomaly = kepler.solve(mean_anomaly, eccentricity)
```