Documentation / @interstellar-tools/equations / moonPosition
Function: moonPosition()
ts
function moonPosition(date: Date): MoonPositionInterface;Defined in: cartography/moon-position.ts:65
Compute the Moon's position seen from Earth's centre at a moment: right ascension, declination and distance, from the short series of Montenbruck and Gill, the largest terms of the lunar theory.
with 14 terms in longitude, 8 in latitude and 9 in distance, then turned from the ecliptic to the equator by the obliquity
Where:
is the Moon's mean longitude, its mean anomaly, its mean argument of latitude and its mean elongation from the Sun is the Sun's mean anomaly are the Moon's ecliptic longitude and latitude, and its distance
Units
- Input: a
Date. - Output:
rightAscensionanddeclinationin radians,distancein m, andrin m: see MoonPositionInterface.
Notes
- Good to several arcminutes, and a few hundred kilometres in distance, in the decades around 2000: for the Moon's pull on a satellite, where that's an error of a fraction of a percent, or to find the Moon in the sky. Not for eclipses or occultations.
- The position is geocentric. From Earth's surface the Moon appears up to a degree lower, its parallax, which matters for observing it.
- The axes are the mean equator and equinox of the date, like sunPosition: close enough to SGP4's TEME frame.
Parameters
| Parameter | Type | Description |
|---|---|---|
date | Date | The moment, as a Date. |
Returns
The right ascension, declination, distance and position: see MoonPositionInterface.
Throws
If date is not a valid Date.
Example
ts
const moon = moonPosition(new Date('2026-11-24T12:00:00Z'));
moon.distance / 1000; // ≈ 361 300 km; JPL Horizons gives 361 050 kmSee
- sunPosition
- thirdBodyAcceleration
- Montenbruck & Gill, Satellite Orbits (2000), section 3.3.2