Documentation / @interstellar-tools/equations / solveKeplerHyperbolic
Function: solveKeplerHyperbolic()
ts
function solveKeplerHyperbolic(
Mh: number,
e: number,
tolerance?: number,
maxIter?: number
): number;Defined in: kepler/solve-kepler-hyperbolic.ts:65
Solve Kepler's equation for a hyperbola: find the hyperbolic anomaly
solved with Newton's method:
Units
- Inputs:
Mhin radians,edimensionless. - Output:
in radians (dimensionless, unbounded).
Notes
- The equation is odd in
, so the solver works on and restores the sign. Negative values are before periapsis. is an upper bound on the root, since is at least and at least . The function is increasing and convex for , so Newton's method converges monotonically from there, even close to where the derivative is small near periapsis. - Unlike an ellipse, a hyperbola isn't periodic:
isn't reduced to one turn. - solveKeplerHighEccentricity also accepts
, but this solver throws when it doesn't converge instead of returning its last estimate.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
Mh | number | undefined | Hyperbolic mean anomaly |
e | number | undefined | Eccentricity |
tolerance? | number | 1e-14 | Stop when a step is smaller than tolerance * max(1, |F|). Defaults to 1e-14. |
maxIter? | number | 50 | Maximum number of Newton steps. Defaults to 50. |
Returns
number
The hyperbolic anomaly Mh.
Throws
- If any input is not a finite number.
- If
e <= 1,tolerance <= 0ormaxIter < 1. - If the iteration doesn't converge within
maxItersteps.
Example
ts
import type { Radians } from '@interstellar-tools/types';
const F = solveKeplerHyperbolic(12.66 as Radians, 1.44);
// F ≈ 3.087, and 1.44 * sinh(F) - F ≈ 12.66