Day 1 — Chasing the Moon

Views of the Moon and Artemis II using JPL Horizons data and 3D plots made with Raku and D3.


Why the Moon is usually approximately known

The Moon’s orbit is nearly circular and nearly flat, which makes its motion predictable and easy to model. However, its orbit is slightly elliptical (stretched out) and inclined (leaning), and it interacts with the Earth’s tilt, Earth’s rotation, and Earth’s axial tilt. These subtle forces affect its path and are not fully captured in simple approximations. Because the Moon is a satellite of Earth, its motion depends on Earth’s position in space, and Earth’s orientation relative to the Sun also plays a role. Even though the Moon’s motion is consistent, these complex interactions mean that while the orbit is roughly understood, precise predictions require detailed data and advanced calculations.

Consequently, an ephemeris (table or diagram) can predict the Moon’s centre at a specified time and reference frame.

In this document we use Jet Propulsion Laboratory (JPL) Horizons System via the Raku package “WWW::HorizonsEphemerisSystem”.


Why landing is harder than finding the Moon

Landing on the Moon is hard because:

  • The Moon’s orbit is nearly circular but slightly elliptical and inclined, making its position unpredictable.
    • The Moon is small, distant, and variable, so locating it is tricky.
    • The Moon’s tilt and interaction with Earth’s rotation affect its movement.
  • Landing requires knowing the lander’s position, velocity, attitude, and fuel margin, not just the Moon’s center.
  • The spacecraft must cancel orbital speed at the right time, estimate height and horizontal velocity during descent, and land in a safe area.
  • Craters, slopes, rocks, dust, and low-angle sunlight or permanent shadows complicate camera-based navigation and hazard detection.
    • Local gravity variations affect landing stability.

In other words: a good ephemeris gets a spacecraft to the neighborhood; onboard navigation and guidance make a touchdown safe.

Artemis II was not a landing mission. It was a crewed Orion systems and operations test flight around the Moon and back. (Landing challenges are included here to show the “big picture” of flight trajectory calculations.)


Libration is a different kind of motion

The Moon rotates once per orbit, so it keeps nearly the same face toward Earth. Yet it appears to nod, roll, and turn slightly: this is libration.

To summarize:

  • Longitude libration: The elliptical orbit slows the Moon’s forward motion, causing tiny shifts in the direction it appears to move.
    • While Moon’s elliptical orbit changes orbital speed, its spin rate stays nearly steady.
  • Latitude libration: The Moon’s tilted orbit reveals different parts of its poles.
  • Daily effect: Our changing position on Earth adds small daily variations.
  • Key point: Libration does not cause large-scale wobble in the Moon’s path—it alters how we see it.

Horizons and Artemis II

NASA JPL’s Horizons system generates time-tagged positions, velocities, observing geometry, and related ephemerides for solar-system objects and selected spacecraft. The Raku package “WWW::HorizonsEphemerisSystem” wraps its web API; “JavaScript::D3” renders the results in a Jupyter notebook.

Artemis II launched on 1 April 2026 and returned on 10 April after a roughly ten-day crewed free-return flight.

The mission:

  • Tested Orion and its crew operations in high Earth orbit
  • Used trans-lunar injection
  • Made trajectory-correction burns as needed
  • Flew past the Moon
  • Returned for Pacific splashdown.

The free-return design used the Earth–Moon gravity field to provide a return path; it was a safety-minded trajectory (not a lunar landing).

Remark: NASA’s mission report and return announcement give the mission chronology.


Setup

The following code loads packages, setups visualization variables, and primes the Jupyter notebook for rendering JavaScript plots.

use WWW::HorizonsEphemerisSystem;
use JavaScript::D3;
use Data::TypeSystem;
use Data::Translators;
my $background = '#1F1F1F';
#% javascript
require.config({
paths: {
d3: 'https://d3js.org/d3.v7.min',
d3_3d: 'https://unpkg.com/d3-3d@2.0.2/build/d3-3d'
}
});
require(['d3', 'd3_3d'], function(d3, d3_3d) {
window.d3 = d3;
window.d33d = d3_3d || window.d33d || {};
});

Query and plot

The following queries use Horizons identifiers 301 for the Moon and @-1024 for Artemis II, with 399 (Earth) as the coordinate centre.

# Start, stop, and sample interval accepted by Horizons.
my @dates = (
'2026-04-02 01:58:33',
'2026-04-10 23:50:00',
'10 m',
);

Get Artemis II (@-1024) trajectory data:

my @artemis-position = horizons-ephemeris-data(
'state',
['@-1024', { center => '500@399', :@dates }],
'position',
:modifier<data>,
);
say "Artemis samples: {@artemis-position.elems}";
# Artemis samples: 1284
my @field-names = 'Calendar Date (TDB)', 'Date', 'X', 'Y', 'Z', 'Vx', 'Vy', 'Vz';
@artemis-position.head(5)
==> to-html(:@field-names)
Calendar Date (TDB)DateXYZVxVyVz
A.D. 2026-Apr-02 01:58:33.00002461132.582326389-24443.80199178298-14325.58855143395-1284.412074714483-1.84378694177628-3.873575971779941-0.3363757692828204
A.D. 2026-Apr-02 02:08:33.00002461132.589270833-25477.97645857157-16605.64195875344-1482.365439091096-1.609707947664253-3.728201914522506-0.3235391881935878
A.D. 2026-Apr-02 02:18:33.00002461132.596215278-26382.28882905463-18801.2477647928-1672.795463009787-1.409915601240013-3.592010346881853-0.3113824293486602
A.D. 2026-Apr-02 02:28:33.00002461132.603159722-27175.36803563279-20917.77703972007-1856.184939615227-1.237742849751446-3.464458414718095-0.3000428511459925
A.D. 2026-Apr-02 02:38:33.00002461132.610104166-27871.9413684281-22960.16420384998-2032.991346524761-1.087424309060239-3.344738598039487-0.2894257308463439
sample ephemeris data

Each record has X, Y, and Z in kilometres. This first plot is Artemis II alone, relative to Earth.

#%js
js-d3-list-line-plot3d(
@artemis-position.map(*<X Y Z>),
:$background,
box-ratios => Whatever,
:900height,
:900width,
:axes,
:!boxed,
)

Get Moon’s center @301 trajectory:

my @moon-position = horizons-ephemeris-data(
'state',
['@301', { center => '500@399', :@dates }],
'position',
:modifier<data>,
);
say "Moon samples: {@moon-position.elems}";
# Moon samples: 1284

Combined Earth–Moon–Artemis II plot

Every vector below has center => '500@399'. Therefore the Earth marker is stationary by construction; the plot shows the Moon and spacecraft relative to Earth.

#%js
my @combined = (
[0e0, 0e0, 0e0, 'Earth', 'point'],
|@moon-position.map({ [|$_<X Y Z>, 'Moon', 'line'] }),
|@artemis-position.map({ [|$_<X Y Z>, 'Artemis II', 'line'] }),
[|@artemis-position.head<X Y Z>, 'First Artemis sample', 'point'],
).map({ <x y z group type>.Array Z=> $_.Array }).map(*.Hash);
js-d3-list-point-plot3d(
@combined,
background => $background,
width => 800,
height => 800,
title => 'Earth-centered trajectories: Moon and Artemis II',
:20title-font-size,
box-ratios => Whatever,
:boxed,
:!axes,
:!ticks,
color-scheme => <SteelBlue Silver Pink Red>,
)

Point of view of the chased

With similar code we can produce a Moon-centered plot:

Remark: It can be seen from the plot that Earth rotates counter-clockwise from Moon’s perspective.


Leftover comments

  • For interactive graphics download and run the corresponding notebook, [AAn1].
  • This document closely follows the Wolfram notebooks [JBn1, JBn2] authored by Jeffrey Bryant on the same subject.
  • The JPL Horizons data retrieval and 3D graphics of this document were used to develop and test elements of the packages “WWW::HorizonsEphemerisSystem”, [AAp1], and “JavaScript::D3”, [AAp2].

References

Notebooks

[AAn1] Anton Antonov, “Chasing the Moon”, (2026), RakuForPrediction-blog at GitHub/antononcube.

[JBn1] Jeffrey Bryant, “Artemis II trajectory: crewed lunar flyby to launch on April 1, 2026”, (2026), Wolfram Community.

[JBn2] Jeffrey Bryant, “View of the Moon from Artemis II”, (2026), Wolfram Community.

Packages

[AAp1] Anton Antonov, WWW::HorizonsEphemerisSystem, Raku package, (2026), GitHub/antononcube.

[AAp2] Anton Antonov, JavaScript::D3, Raku package, (2022-2026), GitHub/antononcube.

Sources

Published by Anton Antonov Antonov

I am an applied mathematician and often I play the role of a senior data scientist. I worked seven years as a kernel developer at Wolfram Research, Inc. I did my Ph.D. in the field of large scale air-pollution simulations.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.