Documentation / @interstellar-tools/equations / advanceMeanAnomaly
Function: advanceMeanAnomaly()
function advanceMeanAnomaly(
orbit: Pick<OrbitInterface, 'e' | 'angle' | 'period'>,
timeStep: TemporalInterface
): Radians;Defined in: anomalies/advance-mean-anomaly.ts:66
Advances an orbit by a time step and returns its new mean anomaly (
The orbit's angle (true anomaly) is the starting point. To get the eccentric anomaly from the result, pass it to solveKepler. To find a body at a given date, use meanAnomalyAt or trueAnomalyAt.
Mathematical Explanation:
The mean anomaly is a measure of the position of an orbiting body as if it moved with uniform angular motion along a circular orbit with the same period as the actual elliptical orbit. It grows linearly with time:
where:
is the initial mean anomaly, converted from the true anomaly angle.is the mean motion, from the period in days. is a positive duration; a negative one, from data in the old 0.x convention, is read as its absolute value. A positive step always moves the body forward. is the time step, converted to days from its unit.
The step can be any length, from a fraction of a second to many orbits, and negative to go back in time. The result is wrapped to
Parameters
| Parameter | Type | Description |
|---|---|---|
orbit | Pick<OrbitInterface, "e" | "angle" |
timeStep | TemporalInterface | How far to advance, in any temporal unit; negative goes back in time. |
Returns
The mean anomaly after the time step, in
Throws
RangeError If the orbit's eccentricity is outside the range
Example
import { advanceMeanAnomaly } from '@interstellar-tools/equations';
const marsOrbit = {
e: 0.0934, // Eccentricity of Mars' orbit
angle: 1.047 as Radians, // Initial true anomaly (in radians)
period: { value: 687, unit: 'd' } // Orbital period in days
};
advanceMeanAnomaly(marsOrbit, { value: 1, unit: 'd' }); // one day on
advanceMeanAnomaly(marsOrbit, { value: 10, unit: 'yr' }); // ten years on
advanceMeanAnomaly(marsOrbit, { value: -1, unit: 'd' }); // one day backSee
- solveKepler to convert the mean anomaly to the eccentric anomaly.
- Mean Anomaly (Wikipedia)
- Orbital Mechanics (NASA)