Documentation / @interstellar-tools/equations / eccentricToTrueAnomaly
Function: eccentricToTrueAnomaly()
ts
function eccentricToTrueAnomaly(E: Radians, e: number): Radians;Defined in: anomalies/eccentric-to-true-anomaly.ts:43
Converts Eccentric Anomaly (
Mathematical Explanation:
The eccentric anomaly (
where:
is the eccentric anomaly (in radians). is the true anomaly (in radians). is the orbital eccentricity ( for elliptical orbits).
This function handles:
- Circular orbits (
): True anomaly is equal to eccentric anomaly. - Parabolic orbits (
): Uses the special case: - Elliptical orbits (
): Uses the standard conversion equation.
Additionally, numerical stability is ensured when
Parameters
| Parameter | Type | Description |
|---|---|---|
E | Radians | Eccentric anomaly ( |
e | number | Orbital eccentricity ( |
Returns
True anomaly (
Throws
RangeError If eccentricity is out of the range
Example
ts
console.log(eccentricToTrueAnomaly(1.0, 0.5)); // Output: True anomaly in radians
console.log(eccentricToTrueAnomaly(Math.PI, 0)); // Output: Math.PI (circular orbit)
console.log(eccentricToTrueAnomaly(0, 1)); // Output: 0 (parabolic orbit)