# Mission journey vectors

## Stardust

The Stardust player loads `stardust/tracks.json` separately. It contains the two target-relative flybys in J2000 axes. The first three chapters jump between the launch, Earth encounter and comet encounter. They cover three different time windows. The Earth states come from the Stardust Navigation 2001 reconstruction and the Wild 2 states from the encounter-specific optical-navigation fit. The repository's `docs/mission-ephemeris-sources.md` lists the cadence, geometry and comparison with the mission report. [NASA PDS kernel descriptions](https://naif.jpl.nasa.gov/pub/naif/pds/data/sdu-c-spice-6-v1.0/sdsp_1000/data/spk/spkinfo.txt).

Stardust lifted off at 21:04:15 UTC on 7 February 1999 from Space Launch Complex 17A at Cape Canaveral aboard a Delta II 7426. The launch chapter follows the published sequence to parking orbit. Its clock runs from liftoff to the planned first cutoff of the second stage at 597.3 seconds. The 1999 press kit's boost diagram gives the nominal times and heights of solid-motor burnout and separation, main-engine cutoff, second-stage ignition, fairing separation and insertion. The text puts first-stage separation eight seconds after main-engine cutoff. The diagram gives an insertion altitude of 189 km for a 185 × 189 km orbit. The later mission history describes a parking orbit of approximately 185 km. Intermediate heights, the ground path and vehicle orientation are illustrative. [NASA mission record](https://science.nasa.gov/mission/stardust/) · [JPL launch press kit, pp. 16–18](https://www.jpl.nasa.gov/news/press_kits/stardust.pdf) · [JPL sample-return press kit](https://www.jpl.nasa.gov/news/press_kits/stardust-return.pdf).

## Hayabusa2 and OSIRIS-REx

Generated by `node scripts/fetch-mission-journey.mjs`. The static output is `journey.json` in this directory.

Each mission has one shared, sorted `times` array of Unix milliseconds in UTC, plus `earth`, `craft` and `target` arrays. Each state is `[x, y, z, vx, vy, vz]`, in kilometres and kilometres per second, relative to the Sun (NAIF 10), ICRF equatorial axes. No light-time or aberration corrections are applied. The generator queries the official [JPL Horizons file API](https://ssd-api.jpl.nasa.gov/doc/horizons_file.html), using explicit UTC epochs and retaining request hashes and source-kernel labels. Complete requests and raw responses are cached in the operating-system temporary directory `mission-journey-horizons`.

The daily cruise cadence becomes hourly for the first and final three days and near the Earth encounter. During the existing 12-hour flyby, the shared epochs exactly equal the existing five-minute flyby epochs. This keeps interpolation and chapter boundaries consistent. Intermediate Hermite curves are display interpolation, not a new navigation solution or resolved maneuver model.

| Mission | Cruise starts after injection | Cruise end / flyby start UTC | Flyby end / outbound start UTC | Outbound end / next chapter starts UTC |
| --- | --- | --- | --- | --- |
| Hayabusa2 | 2014-12-03 06:14:00 | 2015-12-03 04:08:00 | 2015-12-03 16:08:00 | 2018-06-26 00:00:00 |
| OSIRIS-REx | 2016-09-09 00:02:00 | 2017-09-22 10:52:00 | 2017-09-22 22:52:00 | 2018-12-02 00:00:00 |

Hayabusa2's Horizons record has no spacecraft states before 2014-12-03 06:13:46 UTC. These data therefore cannot establish launchpad-to-cruise trajectory continuity; the launch chapter is a separately sourced explanatory animation. The outbound endpoints are the beginning of the existing close-approach data, before the announced arrival day.

Objects are Earth `399`, Hayabusa2 `-37`, Ryugu `162173;`, OSIRIS-REx `-64`, and mission-solution Bennu `2101955`. Earth and asteroid motion use their own states at the same UTC as the spacecraft. The scene projection is one fixed rotation from ICRF to J2000 ecliptic axes, with ecliptic north pointing up, then a scale of 3 scene units per astronomical unit (149,597,870.7 km). It does not rotate each mission or chapter to fit a desired route. Any enlarged rendered body or spacecraft is a locator and does not alter the trajectory coordinates.

## Flyby frames and exact joins

For every flyby epoch, spacecraft state relative to the Sun is obtained by translating the existing Earth-relative mission solution:

`r spacecraft/Sun = r spacecraft/Earth + r Earth/Sun`

`v spacecraft/Sun = v spacecraft/Earth + v Earth/Sun`

These states replace the independently queried heliocentric spacecraft states only during the flyby. This is a change of coordinate origin, without fitting angles, ranges or velocity gains. The maximum difference from the independent direct Horizons heliocentric queries is 0.168 km for Hayabusa2 and 0.154 km for OSIRIS-REx; the source-kernel discrepancy is recorded in `flybyTranslation.maximumDifferenceFromDirectHorizonsKm`. Source states are consequently exact at both chapter boundaries in the displayed source convention.

Earth-frame flight is displayed relative to Earth at the origin. Sun-frame flyby coordinates may be translated by one fixed origin equal to Earth's midpoint heliocentric position. In this second frame Earth moves; subtracting Earth's position anew at every time would incorrectly make it an Earth-centered frame again. Velocities remain physical km/s in both frames.

| Mission | Start speed relative to Earth / Sun | End speed relative to Earth / Sun |
| --- | --- | --- |
| Hayabusa2 | 5.2474 / 30.3123 km/s | 5.2478 / 32.0714 km/s |
| OSIRIS-REx | 6.6399 / 29.7723 km/s | 6.6394 / 31.0734 km/s |

These compare the finite 12-hour window boundaries listed above. They are neither hyperbolic-excess speeds at infinity nor propulsion delta-v. Earth-relative speed increases near the planet and decreases on departure; its nearly equal start/end values do not imply constant speed through closest approach. The Sun-frame change depends on the vector sum with Earth's orbital velocity. No universal or fitted speed-gain value is assumed.

## Arrival solution boundaries

OSIRIS-REx approaches Bennu to approximately 26.05 km at the outbound endpoint, consistent with the beginning of the existing asteroid-relative track. Hayabusa2 approaches Ryugu to approximately 32.58 km in the Horizons spacecraft plus general asteroid solution, whereas the next chapter's final JAXA approach solution begins at approximately 23.55 km. This is a change of source solutions at the same UTC, not measured spacecraft motion between those two points. The general heliocentric route is not shifted to force those independent solutions into agreement. Neither source gives spacecraft attitude.

Validation: `node --test src/scripts/sample-missions/transfer.test.mjs` checks coordinate projection, source provenance, physical-second derivatives, nonuniform trail timing, both mission paths, arrival vicinity, exact flyby UTC/state joins and frame-dependent vector speeds.

## Packed copies for the site

`journey.packed.json` and `ephemeris.packed.json` are compact copies of `journey.json` and `ephemeris.json`, written by the two generators (or offline from the JSON files with `node scripts/mission-data-pack.mjs`) and decoded in the browser by `src/scripts/sample-missions/packed-data.js`. The decoded object has the same keys, order, strings, UTC times and scalar metadata as the JSON. State vectors are fixed-point integers: journey positions to 1e-5 km and velocities to 1e-9 km/s; ephemeris positions to 1e-9 km and velocities to 1e-12 km/s (maximum differences 5.01e-6 km, 5.0e-10 km/s, 5.3e-10 km and 5.0e-13 km/s). Each sample is predicted from earlier samples and only the integer residual is stored (adaptive Rice code, one base64 payload inside plain JSON so static hosts can gzip it). Journey flyby states are rebuilt as decoded Earth state plus the decoded Earth-relative ephemeris state, the same origin translation as above, so both chapter joins remain exact. `node --test scripts/mission-data-pack.test.mjs` checks reproducibility, every field against its tolerance, the flyby joins, and that every distance, speed, radial rate and UTC time printed by the mission panel is identical on a 0.1% progress grid and at every sample.
