Skip to content

Documentation / @interstellar-tools/equations / trueAnomalyAt

Function: trueAnomalyAt() ​

ts
function trueAnomalyAt(
  orbit: Pick<OrbitInterface, 'e' | 'angle' | 'period'>,
  date: Date
): Radians;

Defined in: anomalies/anomaly-at.ts:86

The true anomaly (ν) of an orbit at a given date: where the body is.

Takes the mean anomaly at date from meanAnomalyAt, solves Kepler's equation with solveKepler, and converts the result with eccentricToTrueAnomaly.

Parameters ​

ParameterTypeDescription
orbitPick<OrbitInterface, "e""angle"
dateDateThe date to find the body at.

Returns ​

Radians

The true anomaly at date, in [0,2π).

Throws ​

If date is not a valid Date.

Throws ​

If the orbit's eccentricity is outside 0≤e<1.

Example ​

ts
import { PLANETS } from '@interstellar-tools/constants';
import { trueAnomalyAt } from '@interstellar-tools/equations';

const earth = PLANETS.find((planet) => planet.id === 'earth')!;

trueAnomalyAt(earth.orbit!, new Date('2026-10-17T12:00:00Z')); // ≈ 4.901 rad (280.8°)