Documentation / @interstellar-tools/equations / solveKeplerHighEccentricity
Function: solveKeplerHighEccentricity()
ts
function solveKeplerHighEccentricity(
M: Radians,
e: number,
maxIter?: number,
tolerance?: number
): Radians;Defined in: kepler/solve-kepler-high-eccentricity.ts:104
Solves Kepler's Equation for the Eccentric Anomaly (
Mathematical Explanation:
Kepler's equation for eccentric anomaly (
For orbits with high eccentricity (
Solving Strategy:
- Initial Guess:
- Elliptical (
): the equation is -periodic, so is first reduced to one turn with its sign kept ( ), then Danby's starting value is used:
- Elliptical (
- Hyperbolic (
):
- Iterative Refinement:
- The method updates
using:
- The method updates
for elliptical orbits.
for hyperbolic orbits.
- Iteration stops when:
(default tolerance is 1e-9).
- Angle Wrapping (Elliptical Only):
- The result is wrapped using
wrapAngle(), which keeps the sign:with the sign of . Use solveKepler()for a result normalized to.
- The result is wrapped using
Performance Considerations:
- Typically converges in fewer than 10 iterations for
. - Time complexity:
for standard convergence.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
M | Radians | undefined | Mean anomaly ( |
e | number | undefined | Orbital eccentricity ( |
maxIter? | number | ... | Maximum number of iterations before failure. |
tolerance? | number | 1e-9 | Convergence criterion for stopping the iteration. |
Returns
The eccentric anomaly (
Examples
ts
import { solveKeplerHighEccentricity } from '@interstellar-tools/equations';
const M = Math.PI / 4; // 45 degrees in radians
const e = 0.95; // High orbital eccentricity
const result = solveKeplerHighEccentricity(M, e);
console.log(result); // Output: Eccentric anomaly in radiansts
// Hyperbolic orbit example (e > 1)
const M_hyperbolic = 2.0; // Mean anomaly for hyperbolic orbit
const e_hyperbolic = 1.2; // Hyperbolic eccentricity
console.log(solveKeplerHighEccentricity(M_hyperbolic, e_hyperbolic));