astraeus 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +3 -3
  3. package/data/moons/jupiter.json +351 -115
  4. package/data/moons/neptune.json +54 -16
  5. package/data/moons/pluto.json +21 -5
  6. package/data/moons/saturn.json +882 -292
  7. package/data/moons/uranus.json +90 -28
  8. package/package.json +1 -1
  9. package/src/api/bodies.d.ts +6 -1
  10. package/src/api/bodies.js +15 -2
  11. package/src/api/data.d.ts +2 -1
  12. package/src/api/data.js +4 -13
  13. package/src/api/index.d.ts +1 -1
  14. package/src/api/index.js +1 -1
  15. package/src/api/index.node.js +1 -1
  16. package/src/api/scene.js +43 -19
  17. package/src/api/story.d.ts +4 -0
  18. package/src/api/story.js +10 -1
  19. package/src/app/AstraeusScene.js +3 -1
  20. package/src/app/LayeredRender.js +1 -0
  21. package/src/app/OrbitSetView.js +5 -0
  22. package/src/app/PathView.d.ts +3 -2
  23. package/src/app/PathView.js +5 -5
  24. package/src/app/SceneLabels.d.ts +8 -0
  25. package/src/app/SceneLabels.js +15 -1
  26. package/src/app/SkyView.js +2 -0
  27. package/src/app/sceneHooks.js +1 -1
  28. package/src/assets/bodies/jupiter.js +2 -0
  29. package/src/assets/bodies/listedMoons.d.ts +4 -0
  30. package/src/assets/bodies/listedMoons.js +7 -0
  31. package/src/assets/bodies/outerPlanetCatalogues.d.ts +1 -5
  32. package/src/assets/bodies/outerPlanetCatalogues.js +2 -6
  33. package/src/assets/bodies/outerPlanetRings.d.ts +5 -0
  34. package/src/assets/bodies/outerPlanetRings.js +6 -0
  35. package/src/assets/bodies/planetSystemMaps.js +6 -3
  36. package/src/assets/catalogue.d.ts +3 -0
  37. package/src/assets/catalogue.js +8 -0
  38. package/src/assets/compositions.js +2 -1
  39. package/src/assets/moonCatalogue.d.ts +3 -1
  40. package/src/assets/moonCatalogue.js +1 -0
  41. package/src/assets/visual.d.ts +1 -1
  42. package/src/core/bodies/io.js +1 -0
  43. package/src/core/bodies/jupiterMoons.d.ts +1 -1
  44. package/src/core/bodies/jupiterMoons.js +5 -4
  45. package/src/core/bodies/listedMoonBodies.d.ts +18 -0
  46. package/src/core/bodies/listedMoonBodies.js +36 -0
  47. package/src/core/bodies/listedMoons.d.ts +18 -0
  48. package/src/core/bodies/listedMoons.js +483 -0
  49. package/src/core/bodies/moon.d.ts +2 -0
  50. package/src/core/bodies/moon.js +4 -0
  51. package/src/core/bodies/moonSystem.d.ts +5 -2
  52. package/src/core/bodies/moonSystem.js +2 -1
  53. package/src/core/bodies/outerPlanetData.d.ts +0 -3
  54. package/src/core/bodies/outerPlanetData.js +1 -7
  55. package/src/core/bodies/outerPlanetRingData.d.ts +3 -0
  56. package/src/core/bodies/outerPlanetRingData.js +10 -0
  57. package/src/core/bodies/planetMoons.js +11 -10
  58. package/src/core/body.d.ts +4 -0
  59. package/src/core/events.d.ts +2 -0
  60. package/src/core/satelliteMeanElements.d.ts +2 -8
  61. package/src/core/satelliteMeanElements.js +2 -15
  62. package/src/core/siderealPeriod.d.ts +27 -0
  63. package/src/core/siderealPeriod.js +18 -0
  64. package/src/shell/AstraeusShell.js +6 -2
  65. package/src/shell/AstraeusShell.node.js +6 -2
  66. package/src/synthetic/syntheticJourneyScene.d.ts +2 -1
  67. package/src/synthetic/syntheticJourneyScene.js +21 -15
@@ -1,19 +1,13 @@
1
1
  /**
2
2
  * Saturn's, Uranus's, Neptune's and Pluto's core data files as they are read (O-033 T-118; moon data is core): the moon lists by family
3
- * (data/moons/<planet>.json, T-115) and the ring bands (data/rings/<planet>.json). Raw JSON: src/assets parses and checks them (layer rule:
3
+ * (data/moons/<planet>.json, T-115). Raw JSON: src/assets parses and checks them (layer rule:
4
4
  * assets reach data through core), as `jupiterData.ts` does for Jupiter.
5
5
  */
6
6
  import neptuneMoons from "../../../data/moons/neptune.json" with { type: "json" };
7
7
  import plutoMoons from "../../../data/moons/pluto.json" with { type: "json" };
8
8
  import saturnMoons from "../../../data/moons/saturn.json" with { type: "json" };
9
9
  import uranusMoons from "../../../data/moons/uranus.json" with { type: "json" };
10
- import neptuneRings from "../../../data/rings/neptune.json" with { type: "json" };
11
- import saturnRings from "../../../data/rings/saturn.json" with { type: "json" };
12
- import uranusRings from "../../../data/rings/uranus.json" with { type: "json" };
13
10
  export const SATURN_MOON_CATALOGUE_FILE = saturnMoons;
14
11
  export const URANUS_MOON_CATALOGUE_FILE = uranusMoons;
15
12
  export const NEPTUNE_MOON_CATALOGUE_FILE = neptuneMoons;
16
13
  export const PLUTO_MOON_CATALOGUE_FILE = plutoMoons;
17
- export const SATURN_RING_FILE = saturnRings;
18
- export const URANUS_RING_FILE = uranusRings;
19
- export const NEPTUNE_RING_FILE = neptuneRings;
@@ -0,0 +1,3 @@
1
+ export declare const SATURN_RING_FILE: unknown;
2
+ export declare const URANUS_RING_FILE: unknown;
3
+ export declare const NEPTUNE_RING_FILE: unknown;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Saturn's, Uranus's and Neptune's ring bands as they are read (data/rings/<planet>.json, O-033 T-118). Raw JSON in its own file, apart from the moon lists
3
+ * in `outerPlanetData.ts`, so a planet that carries its rings in the catalogue (O-048 T-205) does not pull the moon lists into the first download.
4
+ */
5
+ import neptuneRings from "../../../data/rings/neptune.json" with { type: "json" };
6
+ import saturnRings from "../../../data/rings/saturn.json" with { type: "json" };
7
+ import uranusRings from "../../../data/rings/uranus.json" with { type: "json" };
8
+ export const SATURN_RING_FILE = saturnRings;
9
+ export const URANUS_RING_FILE = uranusRings;
10
+ export const NEPTUNE_RING_FILE = neptuneRings;
@@ -1,4 +1,5 @@
1
1
  import { iauElementsFromRecord } from "../iauRotation.js";
2
+ import { recordPeriodDays } from "../siderealPeriod.js";
2
3
  import { createPlanetSunTrajectory } from "./planetTrajectory.js";
3
4
  import { MARS } from "./mars.js";
4
5
  import { createMoonSystem, HISTORICAL_MOON_FIT_SPAN, moonFitSource } from "./moonSystem.js";
@@ -34,16 +35,16 @@ const marsMoon = (id, label, radiusKm, massKg, worstM, header) => MARS_MOON_SYST
34
35
  });
35
36
  export const PHOBOS = marsMoon("phobos", "Phobos", 11.08, 1.08e16, 0.0593, "Radius (km) = 13.1 x11.1 x9.3 Density (g cm^-3) = 1.90 +- 0.08; Mass (10^20 kg ) = 1.08 (10^-4)");
36
37
  export const DEIMOS = marsMoon("deimos", "Deimos", 6.2, 1.8e15, 0.5101, "Radius (km) = 7.8 x 6.0 x 5.1 Density (g cm^-3) = 1.76 +- 0.30; Mass (10^20 kg ) = 1.80 (10^-5)");
37
- const saturnMoon = (id, label, radiusKm, gmKm3S2, worstM, header) => SATURN_MOON_SYSTEM.mappedMoon({ id, label, radiusKm, gmKm3S2, worstM, header, span: HISTORICAL_MOON_FIT_SPAN });
38
- export const MIMAS = saturnMoon("mimas", "Mimas", 198.8, 2.503489, 0.1777, "Mean Radius (km) = 198.8 +- 1.5, GM (km^3/s^2) = 2.503489");
39
- export const ENCELADUS = saturnMoon("enceladus", "Enceladus", 252.3, 7.210367, 0.155, "Mean Radius (km) = 252.3 +- 0.6, GM (km^3/s^2) = 7.210367");
40
- export const TETHYS = saturnMoon("tethys", "Tethys", 536.3, 41.21, 0.1733, "Mean Radius (km) = 536.3 +- 1.5, GM (km^3/s^2) = 41.21 +- 0.007");
41
- export const DIONE = saturnMoon("dione", "Dione", 562.5, 73.116, 0.1322, "Mean Radius (km) = 562.5 +- 5, GM (km^3/s^2) = 73.116 +- 0.02");
42
- export const RHEA = saturnMoon("rhea", "Rhea", 764.5, 153.94, 0.1271, "Mean Radius (km) = 764.5 +- 2, GM (km^3/s^2) = 153.94 +- 0.16");
43
- export const TITAN = saturnMoon("titan", "Titan", 2575.5, 8978.14, 0.5305, "Mean Radius (km) = 2575.5 +- 2.0, GM (km^3/s^2) = 8978.14 +- 0.06");
44
- export const IAPETUS = saturnMoon("iapetus", "Iapetus", 734.5, 120.52, 0.0715, "Radius (km) = 734.5 +- 4.0, GM (km^3/s^2) = 120.52 +- 0.03");
45
- export const TRITON = NEPTUNE_MOON_SYSTEM.mappedMoon({ id: "triton", label: "Triton", radiusKm: 1352.6, gmKm3S2: 1428.495, worstM: 0.5118, span: HISTORICAL_MOON_FIT_SPAN, header: "Mean radius (km) = 1352.6 +- 2.4, GM (km^3/s^2) = 1428.495 +- 0.62" });
46
- export const CHARON = PLUTO_MOON_SYSTEM.mappedMoon({ id: "charon", label: "Charon", radiusKm: 606, gmKm3S2: 106.10, worstM: 0.6237, header: "GM (km^3/s^2) = 106.10 +- 0.3, Radius (km, IAU2015) = 606 +- 0.5" });
38
+ const saturnMoon = (id, label, radiusKm, gmKm3S2, worstM, header, orbit) => SATURN_MOON_SYSTEM.mappedMoon({ id, label, radiusKm, gmKm3S2, worstM, header, orbitPeriodDays: recordPeriodDays(orbit), span: HISTORICAL_MOON_FIT_SPAN });
39
+ export const MIMAS = saturnMoon("mimas", "Mimas", 198.8, 2.503489, 0.1777, "Mean Radius (km) = 198.8 +- 1.5, GM (km^3/s^2) = 2.503489", mimasOrbit);
40
+ export const ENCELADUS = saturnMoon("enceladus", "Enceladus", 252.3, 7.210367, 0.155, "Mean Radius (km) = 252.3 +- 0.6, GM (km^3/s^2) = 7.210367", enceladusOrbit);
41
+ export const TETHYS = saturnMoon("tethys", "Tethys", 536.3, 41.21, 0.1733, "Mean Radius (km) = 536.3 +- 1.5, GM (km^3/s^2) = 41.21 +- 0.007", tethysOrbit);
42
+ export const DIONE = saturnMoon("dione", "Dione", 562.5, 73.116, 0.1322, "Mean Radius (km) = 562.5 +- 5, GM (km^3/s^2) = 73.116 +- 0.02", dioneOrbit);
43
+ export const RHEA = saturnMoon("rhea", "Rhea", 764.5, 153.94, 0.1271, "Mean Radius (km) = 764.5 +- 2, GM (km^3/s^2) = 153.94 +- 0.16", rheaOrbit);
44
+ export const TITAN = saturnMoon("titan", "Titan", 2575.5, 8978.14, 0.5305, "Mean Radius (km) = 2575.5 +- 2.0, GM (km^3/s^2) = 8978.14 +- 0.06", titanOrbit);
45
+ export const IAPETUS = saturnMoon("iapetus", "Iapetus", 734.5, 120.52, 0.0715, "Radius (km) = 734.5 +- 4.0, GM (km^3/s^2) = 120.52 +- 0.03", iapetusOrbit);
46
+ export const TRITON = NEPTUNE_MOON_SYSTEM.mappedMoon({ id: "triton", label: "Triton", radiusKm: 1352.6, gmKm3S2: 1428.495, worstM: 0.5118, orbitPeriodDays: recordPeriodDays(tritonOrbit), span: HISTORICAL_MOON_FIT_SPAN, header: "Mean radius (km) = 1352.6 +- 2.4, GM (km^3/s^2) = 1428.495 +- 0.62" });
47
+ export const CHARON = PLUTO_MOON_SYSTEM.mappedMoon({ id: "charon", label: "Charon", radiusKm: 606, gmKm3S2: 106.10, worstM: 0.6237, orbitPeriodDays: recordPeriodDays(charonOrbit), header: "GM (km^3/s^2) = 106.10 +- 0.3, Radius (km, IAU2015) = 606 +- 0.5" });
47
48
  /** The mapped moons by system, in the order the moon lists give them. */
48
49
  export const PLANET_MOON_DEFINITIONS = Object.freeze([PHOBOS, DEIMOS, MIMAS, ENCELADUS, TETHYS, DIONE, RHEA, TITAN, IAPETUS, TRITON, CHARON]);
49
50
  export const PLANET_MOON_BINDINGS = Object.freeze([
@@ -26,6 +26,10 @@ export interface CelestialBodyDefinition {
26
26
  readonly gmKm3S2?: number;
27
27
  /** The one centre this body's own provider computes in; absent only for the root. */
28
28
  readonly parentId?: BodyId;
29
+ /** A moon's sidereal period about its parent, days, from its catalogue record or mean elements: what an orbit line spans (read once; absent where the data give none). */
30
+ readonly orbitPeriodDays?: number;
31
+ /** True when this moon's orbit line keeps the default fading end instead of closing its loop (the Moon's, which is not drawn from a full-lap record). */
32
+ readonly orbitLineFades?: boolean;
29
33
  readonly orientation: OrientationModel;
30
34
  /** What is claimed, over which dates, and what is known to be off. Never affects State. */
31
35
  readonly accuracy: {
@@ -4,6 +4,8 @@ export interface TimelineEvent {
4
4
  readonly id: string;
5
5
  readonly label: string;
6
6
  readonly type?: string;
7
+ /** The id of an object in the scene the event is about; Go to frames it. */
8
+ readonly object?: string;
7
9
  }
8
10
  /** Validates and returns a frozen copy: times sorted ascending (ties allowed), ids unique. */
9
11
  export declare function createEvents(input: readonly TimelineEvent[]): readonly TimelineEvent[];
@@ -38,14 +38,8 @@ export interface MeanElementRecord {
38
38
  readonly gmKm3S2: number;
39
39
  };
40
40
  }
41
- /**
42
- * How the table's period P becomes the rate of the mean longitude of a fixed ellipse.
43
- * `table`: P is already the sidereal period (the Saturn and Neptune rows; Mimas 0.942422 d is the known sidereal period).
44
- * `apsis-corrected`: P is the period of M alone and the periapsis also moves once round per `apsisPeriodYears`; the mean longitude
45
- * then turns once per 1 / (1/P - 1/Papsis), the rule Io's definition uses (the Jovian rows).
46
- */
47
- export type PeriodRule = "table" | "apsis-corrected" | "iau-rate";
48
- export declare function siderealPeriodDaysFor(record: MeanElementRecord, rule: PeriodRule): number;
41
+ import { siderealPeriodDaysFor, type PeriodRule } from "./siderealPeriod.js";
42
+ export { siderealPeriodDaysFor, type PeriodRule };
49
43
  /** The instant the elements hold, UTC milliseconds: JD(TDB) taken as TT, less TT minus UTC. */
50
44
  export declare function epochUtcMsOf(record: MeanElementRecord): number;
51
45
  /**
@@ -5,21 +5,8 @@ import { createOrbTwoBodyAdapter } from "./twoBodyAdapter.js";
5
5
  const DEGREES = Math.PI / 180;
6
6
  const DAY_MS = 86_400_000;
7
7
  const UNIX_EPOCH_JD = 2440587.5;
8
- const DAYS_PER_YEAR = 365.25;
9
- export function siderealPeriodDaysFor(record, rule) {
10
- const { periodDays, apsisPeriodYears } = record.elements;
11
- if (rule === "table")
12
- return periodDays;
13
- if (rule === "iau-rate") {
14
- const rate = record.rotation?.primeMeridianDeg.perDay;
15
- if (rate === undefined || rate === 0)
16
- throw new RangeError(`${record.id}: no IAU rotation rate`);
17
- return 360 / Math.abs(rate);
18
- }
19
- if (apsisPeriodYears === null)
20
- throw new RangeError(`${record.id}: the table gives no period of the apsides`);
21
- return 1 / (1 / periodDays - 1 / (apsisPeriodYears * DAYS_PER_YEAR));
22
- }
8
+ import { siderealPeriodDaysFor } from "./siderealPeriod.js";
9
+ export { siderealPeriodDaysFor };
23
10
  /** The instant the elements hold, UTC milliseconds: JD(TDB) taken as TT, less TT minus UTC. */
24
11
  export function epochUtcMsOf(record) {
25
12
  return Math.round((record.epoch.jdTdb - UNIX_EPOCH_JD) * DAY_MS - record.epoch.ttMinusUtcSeconds * 1000);
@@ -0,0 +1,27 @@
1
+ /** The fields of a `data/orbits/*.json` record the period reads. */
2
+ export interface PeriodRecord {
3
+ readonly id: string;
4
+ readonly elements: {
5
+ readonly periodDays: number;
6
+ readonly apsisPeriodYears: number | null;
7
+ };
8
+ readonly rotation?: {
9
+ readonly primeMeridianDeg: {
10
+ readonly perDay: number;
11
+ };
12
+ };
13
+ }
14
+ /**
15
+ * How the table's period P becomes the rate of the mean longitude of a fixed ellipse.
16
+ * `table`: P is already the sidereal period (the Saturn and Neptune rows; Mimas 0.942422 d is the known sidereal period).
17
+ * `apsis-corrected`: P is the period of M alone and the periapsis also moves once round per `apsisPeriodYears`; the mean longitude
18
+ * then turns once per 1 / (1/P - 1/Papsis), the rule Io's definition uses (the Jovian rows).
19
+ */
20
+ export type PeriodRule = "table" | "apsis-corrected" | "iau-rate";
21
+ export declare function siderealPeriodDaysFor(record: PeriodRecord, rule: PeriodRule): number;
22
+ /** The record's sidereal period, days, by the rule the record itself names (`model.periodRule`). */
23
+ export declare const recordPeriodDays: (record: PeriodRecord & {
24
+ readonly model: {
25
+ readonly periodRule: string;
26
+ };
27
+ }) => number;
@@ -0,0 +1,18 @@
1
+ // A mean-element record's sidereal period, kept apart from the propagator so a body definition can read it without loading the two-body code.
2
+ const DAYS_PER_YEAR = 365.25;
3
+ export function siderealPeriodDaysFor(record, rule) {
4
+ const { periodDays, apsisPeriodYears } = record.elements;
5
+ if (rule === "table")
6
+ return periodDays;
7
+ if (rule === "iau-rate") {
8
+ const rate = record.rotation?.primeMeridianDeg.perDay;
9
+ if (rate === undefined || rate === 0)
10
+ throw new RangeError(`${record.id}: no IAU rotation rate`);
11
+ return 360 / Math.abs(rate);
12
+ }
13
+ if (apsisPeriodYears === null)
14
+ throw new RangeError(`${record.id}: the table gives no period of the apsides`);
15
+ return 1 / (1 / periodDays - 1 / (apsisPeriodYears * DAYS_PER_YEAR));
16
+ }
17
+ /** The record's sidereal period, days, by the rule the record itself names (`model.periodRule`). */
18
+ export const recordPeriodDays = (record) => siderealPeriodDaysFor(record, record.model.periodRule);
@@ -192,9 +192,9 @@ export function AstraeusShell({ experience, snapshot, developerMode, onDeveloper
192
192
  }
193
193
  }
194
194
  };
195
- const activatePreset = (preset) => {
195
+ const activatePreset = (preset, atUtcMs = snapshot.timeUtcMs) => {
196
196
  if (preset.request.kind !== "overview") {
197
- const target = availableObjectById(experience, preset.request.target, snapshot.timeUtcMs);
197
+ const target = availableObjectById(experience, preset.request.target, atUtcMs);
198
198
  if (target === undefined)
199
199
  return;
200
200
  setSelectedObjectId(target.id);
@@ -205,6 +205,10 @@ export function AstraeusShell({ experience, snapshot, developerMode, onDeveloper
205
205
  };
206
206
  const seekToEvent = (event) => {
207
207
  seek(event.timeUtcMs);
208
+ // The event's own object, framed as the picker's Focus does (and `camera.lookAt` opens): the event, never a default body, names it.
209
+ const object = event.object === undefined ? undefined : availableObjectById(experience, event.object, event.timeUtcMs);
210
+ if (object !== undefined)
211
+ activatePreset(focusPresetFor(experience, object), event.timeUtcMs);
208
212
  if (info?.kind === "event")
209
213
  setInfo({ kind: "event", id: event.id });
210
214
  };
@@ -188,9 +188,9 @@ export function AstraeusShell({ experience, snapshot, developerMode, onDeveloper
188
188
  }
189
189
  }
190
190
  };
191
- const activatePreset = (preset) => {
191
+ const activatePreset = (preset, atUtcMs = snapshot.timeUtcMs) => {
192
192
  if (preset.request.kind !== "overview") {
193
- const target = availableObjectById(experience, preset.request.target, snapshot.timeUtcMs);
193
+ const target = availableObjectById(experience, preset.request.target, atUtcMs);
194
194
  if (target === undefined)
195
195
  return;
196
196
  setSelectedObjectId(target.id);
@@ -201,6 +201,10 @@ export function AstraeusShell({ experience, snapshot, developerMode, onDeveloper
201
201
  };
202
202
  const seekToEvent = (event) => {
203
203
  seek(event.timeUtcMs);
204
+ // The event's own object, framed as the picker's Focus does (and `camera.lookAt` opens): the event, never a default body, names it.
205
+ const object = event.object === undefined ? undefined : availableObjectById(experience, event.object, event.timeUtcMs);
206
+ if (object !== undefined)
207
+ activatePreset(focusPresetFor(experience, object), event.timeUtcMs);
204
208
  if (info?.kind === "event")
205
209
  setInfo({ kind: "event", id: event.id });
206
210
  };
@@ -2,8 +2,9 @@ import { Scene } from "../api/scene.js";
2
2
  export declare const JOURNEY_LAUNCH_UTC_MS: number;
3
3
  export declare const JOURNEY_JUPITER_UTC_MS: number;
4
4
  export declare const JOURNEY_SATURN_UTC_MS: number;
5
+ export declare const JOURNEY_URANUS_UTC_MS: number;
5
6
  export declare const JOURNEY_END_UTC_MS: number;
6
7
  /** The distance the journey ends at, AU (I-114). */
7
8
  export declare const JOURNEY_END_AU = 170;
8
- /** The made-up journey as a Scene. Needs the planet series loaded (it reads Earth, Jupiter and Saturn from the Sun). */
9
+ /** The made-up journey as a Scene. Needs the planet series loaded (it reads Earth, Jupiter, Saturn and Uranus from the Sun). */
9
10
  export declare function buildSyntheticJourneyScene(): Scene;
@@ -1,9 +1,10 @@
1
- // O-047 T-203: a made-up probe journey from 1977 out to 170 AU, built only through the public Scene API (ARCH-01: no real mission, name or data).
2
- // It leaves Earth's place on 5 September 1977, passes Jupiter on 5 March 1979 and Saturn on 12 November 1980, then flies straight out to 170 AU by 1 January 2026.
1
+ // O-047 T-203, O-049 T-212: a made-up probe journey from 1977 out to 170 AU, built only through the public Scene API (ARCH-01: no real mission, name or data).
2
+ // It leaves Earth's place on 5 September 1977, passes Jupiter on 5 March 1979, Saturn on 12 November 1980 and Uranus on 24 January 1986, then flies straight out to 170 AU by 1 January 2026.
3
+ // Uranus adds its five main moons (listed moons, one rule, orbit lines on; T-212). The giant planets draw their rings by default (catalogue data, O-048 T-205), Europa, Ganymede and Titan draw their orbit lines (T-206) and each pass names its planet as the event's object (T-207).
3
4
  // In one scene it proves: moons at historical dates (the data packages are handed to `toDefinition`), Saturn's orbit line, paced playback, provenance that changes along the path,
4
5
  // the opening selection and a camera that zooms out to the whole path (I-114). The planets' places come from the planet series, so the series must be loaded before this builds (the site does).
5
6
  import { Scene } from "../api/scene.js";
6
- import { callisto, dione, earth, enceladus, europa, ganymede, iapetus, io, jupiter, mimas, rhea, saturn, sun, tethys, titan } from "../api/bodies.js";
7
+ import { callisto, dione, earth, enceladus, europa, ganymede, iapetus, io, jupiter, mimas, rhea, saturn, sun, tethys, titan, uranus } from "../api/bodies.js";
7
8
  import { solarSystemScale } from "../core/scalePolicy.js";
8
9
  const DAY_MS = 86_400_000;
9
10
  const YEAR_S = 31_557_600;
@@ -11,6 +12,7 @@ const AU_KM = 149_597_870.7;
11
12
  export const JOURNEY_LAUNCH_UTC_MS = Date.UTC(1977, 8, 5);
12
13
  export const JOURNEY_JUPITER_UTC_MS = Date.UTC(1979, 2, 5);
13
14
  export const JOURNEY_SATURN_UTC_MS = Date.UTC(1980, 10, 12);
15
+ export const JOURNEY_URANUS_UTC_MS = Date.UTC(1986, 0, 24);
14
16
  export const JOURNEY_END_UTC_MS = Date.UTC(2026, 0, 1);
15
17
  /** The distance the journey ends at, AU (I-114). */
16
18
  export const JOURNEY_END_AU = 170;
@@ -20,16 +22,18 @@ const length = (a) => Math.hypot(a[0], a[1], a[2]);
20
22
  const mix = (a, b, f) => [a[0] + (b[0] - a[0]) * f, a[1] + (b[1] - a[1]) * f, a[2] + (b[2] - a[2]) * f];
21
23
  const scaled = (a, k) => [a[0] * k, a[1] * k, a[2] * k];
22
24
  const made = (stretch, accuracy, sourceType) => ({ sourceType, sources: [`Made up for the journey test (${stretch}); not a real spacecraft`], accuracy, notes: "Exists to prove a long recorded path, moons at their dates and paced playback." });
23
- /** The made-up journey as a Scene. Needs the planet series loaded (it reads Earth, Jupiter and Saturn from the Sun). */
25
+ /** The made-up journey as a Scene. Needs the planet series loaded (it reads Earth, Jupiter, Saturn and Uranus from the Sun). */
24
26
  export function buildSyntheticJourneyScene() {
25
- const scene = new Scene().addBody(sun).addBody(earth, { enlarge: 60, orbit: true }).addBody(jupiter, { orbit: true }).addBody(io, { orbit: true }).addBody(europa).addBody(ganymede).addBody(callisto)
26
- .addBody(saturn, { orbit: true }).addBody(mimas).addBody(enceladus).addBody(tethys).addBody(dione).addBody(rhea).addBody(titan).addBody(iapetus).setTime(JOURNEY_LAUNCH_UTC_MS);
27
+ const scene = new Scene().addBody(sun).addBody(earth, { enlarge: 60, orbit: true }).addBody(jupiter, { orbit: true }).addBody(io, { orbit: true }).addBody(europa, { orbit: true }).addBody(ganymede, { orbit: true }).addBody(callisto)
28
+ .addBody(saturn, { orbit: true }).addBody(mimas).addBody(enceladus).addBody(tethys).addBody(dione).addBody(rhea).addBody(titan, { orbit: true }).addBody(iapetus)
29
+ .addBody(uranus, { orbit: true }).addBody("miranda", { orbit: true }).addBody("ariel", { orbit: true }).addBody("umbriel", { orbit: true }).addBody("titania", { orbit: true }).addBody("oberon", { orbit: true }).setTime(JOURNEY_LAUNCH_UTC_MS);
27
30
  const place = (id, time) => [...scene.stateOf(id, time).positionKm];
28
31
  const pass = (id, time) => { const p = place(id, time); return scaled(p, 1 + PASS_KM / length(p)); };
29
32
  const launch = place("earth", JOURNEY_LAUNCH_UTC_MS);
30
33
  const atJupiter = pass("jupiter", JOURNEY_JUPITER_UTC_MS);
31
34
  const atSaturn = pass("saturn", JOURNEY_SATURN_UTC_MS);
32
- const out = scaled(atSaturn, (JOURNEY_END_AU * AU_KM) / length(atSaturn));
35
+ const atUranus = pass("uranus", JOURNEY_URANUS_UTC_MS);
36
+ const out = scaled(atUranus, (JOURNEY_END_AU * AU_KM) / length(atUranus));
33
37
  const leg = (from, to, t0, t1, stepMs) => {
34
38
  const n = Math.max(1, Math.round((t1 - t0) / stepMs));
35
39
  return Array.from({ length: n }, (_, i) => ({ time: Math.round(t0 + ((t1 - t0) * i) / n), positionKm: mix(from, to, i / n) }));
@@ -37,7 +41,8 @@ export function buildSyntheticJourneyScene() {
37
41
  const samples = [
38
42
  ...leg(launch, atJupiter, JOURNEY_LAUNCH_UTC_MS, JOURNEY_JUPITER_UTC_MS, 15 * DAY_MS),
39
43
  ...leg(atJupiter, atSaturn, JOURNEY_JUPITER_UTC_MS, JOURNEY_SATURN_UTC_MS, 15 * DAY_MS),
40
- ...leg(atSaturn, out, JOURNEY_SATURN_UTC_MS, JOURNEY_END_UTC_MS, 365.25 * DAY_MS),
44
+ ...leg(atSaturn, atUranus, JOURNEY_SATURN_UTC_MS, JOURNEY_URANUS_UTC_MS, 15 * DAY_MS),
45
+ ...leg(atUranus, out, JOURNEY_URANUS_UTC_MS, JOURNEY_END_UTC_MS, 365.25 * DAY_MS),
41
46
  { time: JOURNEY_END_UTC_MS, positionKm: out },
42
47
  ];
43
48
  scene.addTrajectory({
@@ -48,16 +53,17 @@ export function buildSyntheticJourneyScene() {
48
53
  lineFixedTo: "sun",
49
54
  provenance: made("whole journey", "None claimed.", "illustrative"),
50
55
  provenanceSpans: [
51
- { start: JOURNEY_LAUNCH_UTC_MS, end: JOURNEY_SATURN_UTC_MS + 90 * DAY_MS, provenance: made("planet passes", "None claimed. Straight legs between two planets' places.", "reconstructed") },
52
- { start: JOURNEY_SATURN_UTC_MS + 90 * DAY_MS, end: JOURNEY_END_UTC_MS, provenance: made("outbound cruise", "None claimed. A straight line out to 170 AU.", "illustrative") },
56
+ { start: JOURNEY_LAUNCH_UTC_MS, end: JOURNEY_URANUS_UTC_MS + 90 * DAY_MS, provenance: made("planet passes", "None claimed. Straight legs between two planets' places.", "reconstructed") },
57
+ { start: JOURNEY_URANUS_UTC_MS + 90 * DAY_MS, end: JOURNEY_END_UTC_MS, provenance: made("outbound cruise", "None claimed. A straight line out to 170 AU.", "illustrative") },
53
58
  ],
54
- description: "An invented probe that leaves Earth in 1977, passes Jupiter in 1979 and Saturn in 1980, then flies straight out to 170 AU by 2026.",
59
+ description: "An invented probe that leaves Earth in 1977, passes Jupiter in 1979, Saturn in 1980 and Uranus in 1986, then flies straight out to 170 AU by 2026.",
55
60
  knownLimitations: ["Made up; not a real spacecraft.", "Straight legs: it ignores gravity and does not follow any real trajectory."],
56
- anchors: [{ id: "traveller-jupiter", time: JOURNEY_JUPITER_UTC_MS }, { id: "traveller-saturn", time: JOURNEY_SATURN_UTC_MS }],
61
+ anchors: [{ id: "traveller-jupiter", time: JOURNEY_JUPITER_UTC_MS }, { id: "traveller-saturn", time: JOURNEY_SATURN_UTC_MS }, { id: "traveller-uranus", time: JOURNEY_URANUS_UTC_MS }],
57
62
  });
58
63
  scene.addEvents([
59
- { id: "traveller-jupiter", label: "Made-up pass of Jupiter", time: JOURNEY_JUPITER_UTC_MS, type: "encounter" },
60
- { id: "traveller-saturn", label: "Made-up pass of Saturn", time: JOURNEY_SATURN_UTC_MS, type: "encounter" },
64
+ { id: "traveller-jupiter", label: "Made-up pass of Jupiter", time: JOURNEY_JUPITER_UTC_MS, type: "encounter", object: "jupiter" },
65
+ { id: "traveller-saturn", label: "Made-up pass of Saturn", time: JOURNEY_SATURN_UTC_MS, type: "encounter", object: "saturn" },
66
+ { id: "traveller-uranus", label: "Made-up pass of Uranus", time: JOURNEY_URANUS_UTC_MS, type: "encounter", object: "uranus" },
61
67
  ], { provenance: { sourceType: "illustrative", sources: ["Made up"], accuracy: "None claimed.", notes: "Not real passes." } });
62
68
  scene.setTimeline({
63
69
  start: JOURNEY_LAUNCH_UTC_MS,
@@ -66,7 +72,7 @@ export function buildSyntheticJourneyScene() {
66
72
  rate: 30 * DAY_MS / 1000,
67
73
  pacing: [
68
74
  { near: { type: "encounter", within: 30 * DAY_MS / 1000 }, rate: DAY_MS / 1000 },
69
- { from: JOURNEY_SATURN_UTC_MS + 120 * DAY_MS, to: JOURNEY_END_UTC_MS, rate: YEAR_S },
75
+ { from: JOURNEY_URANUS_UTC_MS + 120 * DAY_MS, to: JOURNEY_END_UTC_MS, rate: YEAR_S },
70
76
  ],
71
77
  });
72
78
  scene.setScale(solarSystemScale);