Skip to content

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 (E) to True Anomaly (V) for an orbit.

Mathematical Explanation:

The eccentric anomaly (E) and the true anomaly (V) are related through:

tan⁡V2=1+e1−etan⁡E2

where:

  • E is the eccentric anomaly (in radians).
  • V is the true anomaly (in radians).
  • e is the orbital eccentricity (0≤e<1 for elliptical orbits).

This function handles:

  • Circular orbits (e=0): True anomaly is equal to eccentric anomaly.
  • Parabolic orbits (e=1): Uses the special case:V=2tan−1⁡(E2)
  • Elliptical orbits (0<e<1): Uses the standard conversion equation.

Additionally, numerical stability is ensured when E≈π.

Parameters ​

ParameterTypeDescription
ERadiansEccentric anomaly (E) in radians.
enumberOrbital eccentricity (0≤e<1).

Returns ​

Radians

True anomaly (V) in radians.

Throws ​

RangeError If eccentricity is out of the range 0≤e≤1.

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)

See ​

True Anomaly (Wikipedia)