@johnmorrisdotca/wakusei-planets 0.74.2 → 0.75.1

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 (59) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/NOTICE.md +4 -3
  3. package/README.md +7 -7
  4. package/dist/bodies/dwarfs.js +1 -1
  5. package/dist/bodies/earth-look.js +1 -1
  6. package/dist/bodies/jupiter.js +1 -1
  7. package/dist/bodies/mars.js +1 -1
  8. package/dist/bodies/moons-neptune.js +1 -1
  9. package/dist/bodies/moons-pluto.js +2 -0
  10. package/dist/bodies/moons-saturn.js +1 -1
  11. package/dist/bodies/neptune.js +1 -1
  12. package/dist/bodies/pluto.js +1 -0
  13. package/dist/bodies/saturn.js +1 -1
  14. package/dist/bodies/uranus.js +1 -1
  15. package/dist/bodies/venus.js +1 -1
  16. package/dist/data/discovery.js +30 -0
  17. package/dist/data/estimated-moons.js +354 -354
  18. package/dist/data/moon-catalogue.d.ts +1 -1
  19. package/dist/data/moon-catalogue.js +368 -368
  20. package/dist/data/orbits.js +3 -0
  21. package/dist/element.d.ts +1 -1
  22. package/dist/element.js +19 -2
  23. package/dist/facts.d.ts +1 -1
  24. package/dist/facts.js +4 -1
  25. package/dist/flat/bodies.d.ts +11 -10
  26. package/dist/flat/bodies.js +62 -28
  27. package/dist/flat/element.d.ts +55 -16
  28. package/dist/flat/element.js +746 -86
  29. package/dist/flat/index.d.ts +4 -2
  30. package/dist/flat/index.js +5 -3
  31. package/dist/flat/look.d.ts +206 -0
  32. package/dist/flat/look.js +305 -0
  33. package/dist/flat/marks.d.ts +122 -0
  34. package/dist/flat/marks.js +60 -0
  35. package/dist/flat/scene.d.ts +119 -2
  36. package/dist/flat/scene.js +130 -2
  37. package/dist/flat/words.d.ts +16 -0
  38. package/dist/flat/words.js +74 -1
  39. package/dist/moon-catalogue.d.ts +9 -9
  40. package/dist/moon-catalogue.js +11 -10
  41. package/dist/moon-pages/element.js +0 -2
  42. package/dist/moon-pages/hero.d.ts +1 -4
  43. package/dist/moon-pages/hero.js +5 -10
  44. package/dist/portrait/model.js +3 -3
  45. package/dist/scene/body.d.ts +1 -0
  46. package/dist/scene/body.js +8 -4
  47. package/dist/scene/glsl.js +3 -1
  48. package/dist/scene/look.d.ts +15 -0
  49. package/dist/scene/look.js +19 -0
  50. package/dist/scene/name-label.d.ts +10 -0
  51. package/dist/scene/name-label.js +93 -1
  52. package/dist/scene/painter.d.ts +2 -1
  53. package/dist/scene/painter.js +8 -4
  54. package/dist/scene/textures.d.ts +2 -2
  55. package/dist/space/element.d.ts +15 -1
  56. package/dist/space/element.js +23 -1
  57. package/dist/version.d.ts +1 -1
  58. package/dist/version.js +1 -1
  59. package/package.json +1 -1
@@ -0,0 +1,60 @@
1
+ // The marks a page lays on the flat map: points on the ground with a name, a shape and a colour, in groups the key names. They are the way in for anything a page wants on the map (the moons' sub-points, favourites, orbiters, landers).
2
+ // Pure: no DOM.
3
+ import { wrapLongitude } from "./geometry.js";
4
+ /**
5
+ * The shapes a mark can have.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { MARK_SHAPES } from "@johnmorrisdotca/wakusei-planets/flat";
10
+ *
11
+ * console.log(MARK_SHAPES.join(", "));
12
+ * ```
13
+ */
14
+ export const MARK_SHAPES = ["dot", "ring", "diamond", "square", "cross", "star"];
15
+ /**
16
+ * Check a list of marks and fill in what is left out: a mark with no finite place or no id or name is dropped, a longitude is wrapped to -180 up to 180, a latitude is held to the poles, a shape the map does not know is a dot, the size is held between 2 and 12 and a later mark with the same id replaces the earlier.
17
+ *
18
+ * @param group - The group a mark with none of its own belongs to.
19
+ * @param marks - The page's marks.
20
+ * @returns The marks the map holds, in the order given.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * import { readMarks } from "@johnmorrisdotca/wakusei-planets/flat";
25
+ *
26
+ * const held = readMarks("favourites", [
27
+ * { id: "a", lat: 95, lon: 200, name: "A" },
28
+ * { id: "b", lat: Number.NaN, lon: 0, name: "B" },
29
+ * ]);
30
+ * console.log(held.length, held[0]!.lat, held[0]!.lon);
31
+ * ```
32
+ */
33
+ export function readMarks(group, marks) {
34
+ const out = new Map();
35
+ for (const mark of marks) {
36
+ if (typeof mark?.id !== "string" || mark.id === "" || !Number.isFinite(mark.lat) || !Number.isFinite(mark.lon))
37
+ continue;
38
+ if (markName(mark.name, "en") === "")
39
+ continue;
40
+ const size = Number.isFinite(mark.size) ? Math.min(12, Math.max(2, mark.size)) : 4;
41
+ out.delete(mark.id);
42
+ out.set(mark.id, { ...mark, group: mark.group ?? group, shape: MARK_SHAPES.includes(mark.shape ?? "dot") ? (mark.shape ?? "dot") : "dot", size, lat: Math.max(-90, Math.min(90, mark.lat)), lon: wrapLongitude(mark.lon) });
43
+ }
44
+ return [...out.values()];
45
+ }
46
+ /**
47
+ * A mark's name in a language: the text itself, or the language's own and else the English.
48
+ *
49
+ * @param name - A mark's `name`.
50
+ * @param lang - `en` or `ja`.
51
+ * @returns The name.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * import { markName } from "@johnmorrisdotca/wakusei-planets/flat";
56
+ *
57
+ * console.log(markName({ en: "Io", ja: "イオ" }, "ja"), markName("Io", "ja"), markName({ en: "Io" }, "ja"));
58
+ * ```
59
+ */
60
+ export const markName = (name, lang) => (name === undefined ? "" : typeof name === "string" ? name : ((lang === "ja" ? name.ja : undefined) ?? name.en ?? ""));
@@ -1,11 +1,12 @@
1
1
  import { type GroundPoint } from "../ground-track.ts";
2
+ import { type MoonId } from "../facts.ts";
2
3
  import { type OrbiterId, type OrbiterStatus } from "../orbiters.ts";
3
4
  import { type FlatBodyId } from "./bodies.ts";
4
5
  import { type FlatView } from "./geometry.ts";
5
6
  /**
6
7
  * Where the Sun is overhead on a body: latitude and east longitude in degrees, from the package's own ephemeris and the body's IAU pole and prime meridian. The longitude is in -180 up to 180, like the map's.
7
8
  *
8
- * @param body - `moon` or `mars`.
9
+ * @param body - Any body the flat map draws.
9
10
  * @param ms - Milliseconds since 1970 (UTC).
10
11
  * @returns The point.
11
12
  *
@@ -18,6 +19,37 @@ import { type FlatView } from "./geometry.ts";
18
19
  * ```
19
20
  */
20
21
  export declare function flatSun(body: FlatBodyId, ms: number): GroundPoint;
22
+ /**
23
+ * How fast the Sun moves across a body's ground, in degrees of longitude a second at a moment: about 0.0042 on the Earth and Mars, 0.00014 on the Moon, 0.00002 on Mercury. It sets how often a running clock needs to draw the night.
24
+ *
25
+ * @param body - Any body the flat map draws.
26
+ * @param ms - Milliseconds since 1970 (UTC).
27
+ * @returns Degrees a second, always positive.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * import { flatSunRate } from "@johnmorrisdotca/wakusei-planets/flat";
32
+ *
33
+ * console.log(flatSunRate("mars", Date.UTC(2026, 10, 12)).toFixed(4), flatSunRate("moon", Date.UTC(2026, 10, 12)).toFixed(5));
34
+ * ```
35
+ */
36
+ export declare function flatSunRate(body: FlatBodyId, ms: number): number;
37
+ /**
38
+ * The sunrise and sunset line: the circle of the body's surface where the Sun is on the horizon, as longitude and latitude with the longitude carried on without a jump (so a flat map draws it again a world to the left and right). It is the circle 90 degrees from the point where the Sun is overhead.
39
+ *
40
+ * @param sun - Where the Sun is overhead (`flatSun`).
41
+ * @param steps - How many steps round it.
42
+ * @returns The points; the last is a whole turn of longitude from the first.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * import { flatSun, sunriseLine } from "@johnmorrisdotca/wakusei-planets/flat";
47
+ *
48
+ * const line = sunriseLine(flatSun("mars", Date.UTC(2026, 10, 12)), 8);
49
+ * console.log(line.length, Math.abs(line[8]![0] - line[0]![0]));
50
+ * ```
51
+ */
52
+ export declare const sunriseLine: (sun: GroundPoint, steps?: number) => [number, number][];
21
53
  /**
22
54
  * One orbiter as the flat map shows it at a moment.
23
55
  *
@@ -80,7 +112,7 @@ export declare const hasPath: (id: OrbiterId) => boolean;
80
112
  * @param cell - The cell's side in pixels of the view.
81
113
  * @param view - The map's view.
82
114
  * @param sun - Where the Sun is overhead.
83
- * @param body - `moon` or `mars`: the night's colour and the twilight's width.
115
+ * @param body - Any body the flat map draws: the night's colour and the twilight's width.
84
116
  *
85
117
  * @example
86
118
  * ```ts
@@ -150,3 +182,88 @@ export declare function flatTrack(id: OrbiterId, ms: number, points?: number): {
150
182
  * ```
151
183
  */
152
184
  export declare function trackPieces(points: readonly GroundPoint[]): [GroundPoint, GroundPoint][];
185
+ /**
186
+ * The moons the package places round a body: their ids, in the package's order. Empty for a body with none (Mercury, Venus, the moons themselves).
187
+ *
188
+ * @param body - Any body the flat map draws.
189
+ * @returns The moons' ids.
190
+ *
191
+ * @example
192
+ * ```ts
193
+ * import { moonsOfBody } from "@johnmorrisdotca/wakusei-planets/flat";
194
+ *
195
+ * console.log(moonsOfBody("mars").join(", "), moonsOfBody("venus").length);
196
+ * ```
197
+ */
198
+ export declare const moonsOfBody: (body: FlatBodyId) => readonly MoonId[];
199
+ /**
200
+ * One moon as the flat map of its planet shows it at a moment: the place on the planet's ground that it is straight above, and how far it is from the planet's centre.
201
+ *
202
+ * @example
203
+ * ```ts
204
+ * import { flatMoons, type FlatMoon } from "@johnmorrisdotca/wakusei-planets/flat";
205
+ *
206
+ * const io: FlatMoon = flatMoons("jupiter", Date.UTC(2026, 10, 23)).find((moon) => moon.id === "io")!;
207
+ * console.log(io.lat.toFixed(1), io.distanceKm > 400_000);
208
+ * ```
209
+ */
210
+ export interface FlatMoon {
211
+ id: MoonId;
212
+ /** The latitude of the point on the planet with the moon straight overhead, degrees. */
213
+ lat: number;
214
+ /** Its longitude in -180 up to 180, degrees east. */
215
+ lon: number;
216
+ /** The distance from the planet's centre, in kilometres. */
217
+ distanceKm: number;
218
+ }
219
+ /**
220
+ * Where each moon of a body is overhead at a moment: the point on the body's ground with the moon straight above it, for a flat map of the moons' planet. The Earth has the Moon, Mars two, Jupiter six, Saturn nineteen, Uranus five, Neptune four, Pluto three; a body with none gives an empty list.
221
+ *
222
+ * @param host - Any body the flat map draws.
223
+ * @param ms - Milliseconds since 1970 (UTC).
224
+ * @returns The moons, nearest first.
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * import { flatMoons } from "@johnmorrisdotca/wakusei-planets/flat";
229
+ *
230
+ * const moons = flatMoons("mars", Date.UTC(2026, 10, 23, 12));
231
+ * console.log(moons.map((moon) => `${moon.id} ${moon.lat.toFixed(0)}, ${moon.lon.toFixed(0)}`).join("; "));
232
+ * ```
233
+ */
234
+ export declare function flatMoons(host: FlatBodyId, ms: number): FlatMoon[];
235
+ /**
236
+ * The track of each moon over its planet's ground: where it is overhead from before the moment to after it, half a turn of the planet either way (at least one hour, at most two days), as points with their moments. The planet turns under the moon, so a close moon of a fast planet draws a long path round the map.
237
+ *
238
+ * @param host - Any body the flat map draws.
239
+ * @param ms - Milliseconds since 1970 (UTC): the moment at the track's middle.
240
+ * @param points - How many steps along the track.
241
+ * @returns For each moon, its points (longitude in -180 up to 180), or an empty map for a body with no moons.
242
+ *
243
+ * @example
244
+ * ```ts
245
+ * import { flatMoonTracks } from "@johnmorrisdotca/wakusei-planets/flat";
246
+ *
247
+ * const tracks = flatMoonTracks("jupiter", Date.UTC(2026, 10, 23), 20);
248
+ * console.log(tracks.get("io")?.length, tracks.size);
249
+ * ```
250
+ */
251
+ export declare function flatMoonTracks(host: FlatBodyId, ms: number, points?: number): Map<MoonId, {
252
+ lat: number;
253
+ lon: number;
254
+ ms: number;
255
+ }[]>;
256
+ /**
257
+ * How long a track of the moons of a planet is, either side of the moment, in milliseconds: half a turn of the planet, at least an hour and at most two days.
258
+ *
259
+ * @param host - Any body the flat map draws.
260
+ * @returns Milliseconds.
261
+ *
262
+ * @example
263
+ * ```ts
264
+ * import { flatMoonTrackHalf } from "@johnmorrisdotca/wakusei-planets/flat";
265
+ *
266
+ * console.log(flatMoonTrackHalf("jupiter") / 3_600_000);
267
+ * ```
268
+ */
269
+ export declare const flatMoonTrackHalf: (host: FlatBodyId) => number;
@@ -1,15 +1,18 @@
1
1
  // What the flat map shows at a moment, as numbers: where the Sun is overhead, where each orbiter is over the ground, the shading of the night side, a craft's coverage circle and its ground track cut for a flat map.
2
2
  // Pure: no DOM, no clock reads (the moment is always given).
3
3
  import { splitTrail } from "../ground-track.js";
4
+ import { system } from "../ephemeris.js";
5
+ import { BODIES, MOONS_OF } from "../facts.js";
4
6
  import { orbiterElements, orbiterGround, orbiterGroundTrack, orbiterNumbers, orbiterDim } from "../orbiters.js";
5
7
  import { subSolarPoint } from "../places.js";
8
+ import { cross, dot } from "../vec.js";
6
9
  import { flatBody } from "./bodies.js";
7
10
  import { pixelsPerDegree, wrapLongitude } from "./geometry.js";
8
11
  const RAD = Math.PI / 180;
9
12
  /**
10
13
  * Where the Sun is overhead on a body: latitude and east longitude in degrees, from the package's own ephemeris and the body's IAU pole and prime meridian. The longitude is in -180 up to 180, like the map's.
11
14
  *
12
- * @param body - `moon` or `mars`.
15
+ * @param body - Any body the flat map draws.
13
16
  * @param ms - Milliseconds since 1970 (UTC).
14
17
  * @returns The point.
15
18
  *
@@ -25,6 +28,41 @@ export function flatSun(body, ms) {
25
28
  const sun = subSolarPoint(flatBody(body).id, ms);
26
29
  return { lat: sun.lat, lon: wrapLongitude(sun.lon) };
27
30
  }
31
+ /**
32
+ * How fast the Sun moves across a body's ground, in degrees of longitude a second at a moment: about 0.0042 on the Earth and Mars, 0.00014 on the Moon, 0.00002 on Mercury. It sets how often a running clock needs to draw the night.
33
+ *
34
+ * @param body - Any body the flat map draws.
35
+ * @param ms - Milliseconds since 1970 (UTC).
36
+ * @returns Degrees a second, always positive.
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * import { flatSunRate } from "@johnmorrisdotca/wakusei-planets/flat";
41
+ *
42
+ * console.log(flatSunRate("mars", Date.UTC(2026, 10, 12)).toFixed(4), flatSunRate("moon", Date.UTC(2026, 10, 12)).toFixed(5));
43
+ * ```
44
+ */
45
+ export function flatSunRate(body, ms) {
46
+ const a = flatSun(body, ms);
47
+ const b = flatSun(body, ms + 60_000);
48
+ return Math.abs(wrapLongitude(b.lon - a.lon)) / 60;
49
+ }
50
+ /**
51
+ * The sunrise and sunset line: the circle of the body's surface where the Sun is on the horizon, as longitude and latitude with the longitude carried on without a jump (so a flat map draws it again a world to the left and right). It is the circle 90 degrees from the point where the Sun is overhead.
52
+ *
53
+ * @param sun - Where the Sun is overhead (`flatSun`).
54
+ * @param steps - How many steps round it.
55
+ * @returns The points; the last is a whole turn of longitude from the first.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * import { flatSun, sunriseLine } from "@johnmorrisdotca/wakusei-planets/flat";
60
+ *
61
+ * const line = sunriseLine(flatSun("mars", Date.UTC(2026, 10, 12)), 8);
62
+ * console.log(line.length, Math.abs(line[8]![0] - line[0]![0]));
63
+ * ```
64
+ */
65
+ export const sunriseLine = (sun, steps = 144) => circleOutline(sun.lat, sun.lon, 90, steps).points;
28
66
  /**
29
67
  * Where an orbiter is over the ground at a moment, with its height and how sure its place is. `undefined` for a craft with no public path (Tianwen-1, CAPSTONE), which the map does not draw.
30
68
  *
@@ -75,7 +113,7 @@ const smooth = (a, b, x) => {
75
113
  * @param cell - The cell's side in pixels of the view.
76
114
  * @param view - The map's view.
77
115
  * @param sun - Where the Sun is overhead.
78
- * @param body - `moon` or `mars`: the night's colour and the twilight's width.
116
+ * @param body - Any body the flat map draws: the night's colour and the twilight's width.
79
117
  *
80
118
  * @example
81
119
  * ```ts
@@ -193,3 +231,93 @@ export function trackPieces(points) {
193
231
  out.push(...splitTrail(points[i - 1], points[i]));
194
232
  return out;
195
233
  }
234
+ /**
235
+ * The moons the package places round a body: their ids, in the package's order. Empty for a body with none (Mercury, Venus, the moons themselves).
236
+ *
237
+ * @param body - Any body the flat map draws.
238
+ * @returns The moons' ids.
239
+ *
240
+ * @example
241
+ * ```ts
242
+ * import { moonsOfBody } from "@johnmorrisdotca/wakusei-planets/flat";
243
+ *
244
+ * console.log(moonsOfBody("mars").join(", "), moonsOfBody("venus").length);
245
+ * ```
246
+ */
247
+ export const moonsOfBody = (body) => (Object.prototype.hasOwnProperty.call(MOONS_OF, body) ? MOONS_OF[body] : []);
248
+ /** The ground point under each moon of a planet, from the planet's pole and prime meridian and the moon's place in the same frame. */
249
+ function groundPoints(host, ms) {
250
+ const { planet, moons } = system(host, ms);
251
+ const radius = BODIES[host].radiusKm;
252
+ const east = cross(planet.pole, planet.meridian);
253
+ return moons.map((moon) => {
254
+ const along = [moon.x / moon.distance, moon.y / moon.distance, moon.z / moon.distance];
255
+ const lat = Math.asin(Math.max(-1, Math.min(1, dot(along, planet.pole)))) / RAD;
256
+ const lon = Math.atan2(dot(along, east), dot(along, planet.meridian)) / RAD;
257
+ return { id: moon.id, lat, lon: wrapLongitude(lon), distanceKm: moon.distance * radius };
258
+ });
259
+ }
260
+ /**
261
+ * Where each moon of a body is overhead at a moment: the point on the body's ground with the moon straight above it, for a flat map of the moons' planet. The Earth has the Moon, Mars two, Jupiter six, Saturn nineteen, Uranus five, Neptune four, Pluto three; a body with none gives an empty list.
262
+ *
263
+ * @param host - Any body the flat map draws.
264
+ * @param ms - Milliseconds since 1970 (UTC).
265
+ * @returns The moons, nearest first.
266
+ *
267
+ * @example
268
+ * ```ts
269
+ * import { flatMoons } from "@johnmorrisdotca/wakusei-planets/flat";
270
+ *
271
+ * const moons = flatMoons("mars", Date.UTC(2026, 10, 23, 12));
272
+ * console.log(moons.map((moon) => `${moon.id} ${moon.lat.toFixed(0)}, ${moon.lon.toFixed(0)}`).join("; "));
273
+ * ```
274
+ */
275
+ export function flatMoons(host, ms) {
276
+ return moonsOfBody(host).length === 0 ? [] : groundPoints(host, ms);
277
+ }
278
+ /**
279
+ * The track of each moon over its planet's ground: where it is overhead from before the moment to after it, half a turn of the planet either way (at least one hour, at most two days), as points with their moments. The planet turns under the moon, so a close moon of a fast planet draws a long path round the map.
280
+ *
281
+ * @param host - Any body the flat map draws.
282
+ * @param ms - Milliseconds since 1970 (UTC): the moment at the track's middle.
283
+ * @param points - How many steps along the track.
284
+ * @returns For each moon, its points (longitude in -180 up to 180), or an empty map for a body with no moons.
285
+ *
286
+ * @example
287
+ * ```ts
288
+ * import { flatMoonTracks } from "@johnmorrisdotca/wakusei-planets/flat";
289
+ *
290
+ * const tracks = flatMoonTracks("jupiter", Date.UTC(2026, 10, 23), 20);
291
+ * console.log(tracks.get("io")?.length, tracks.size);
292
+ * ```
293
+ */
294
+ export function flatMoonTracks(host, ms, points = 48) {
295
+ const out = new Map();
296
+ if (moonsOfBody(host).length === 0)
297
+ return out;
298
+ const half = flatMoonTrackHalf(host);
299
+ for (let i = 0; i <= points; i += 1) {
300
+ const at = ms - half + (2 * half * i) / points;
301
+ for (const moon of groundPoints(host, at)) {
302
+ let list = out.get(moon.id);
303
+ if (list === undefined)
304
+ out.set(moon.id, (list = []));
305
+ list.push({ lat: moon.lat, lon: moon.lon, ms: at });
306
+ }
307
+ }
308
+ return out;
309
+ }
310
+ /**
311
+ * How long a track of the moons of a planet is, either side of the moment, in milliseconds: half a turn of the planet, at least an hour and at most two days.
312
+ *
313
+ * @param host - Any body the flat map draws.
314
+ * @returns Milliseconds.
315
+ *
316
+ * @example
317
+ * ```ts
318
+ * import { flatMoonTrackHalf } from "@johnmorrisdotca/wakusei-planets/flat";
319
+ *
320
+ * console.log(flatMoonTrackHalf("jupiter") / 3_600_000);
321
+ * ```
322
+ */
323
+ export const flatMoonTrackHalf = (host) => Math.min(48, Math.max(1, Math.abs(BODIES[host].rotationHours) / 2)) * 3_600_000;
@@ -53,3 +53,19 @@ export declare const say: (lang: FlatLang, key: string, values?: Record<string,
53
53
  * ```
54
54
  */
55
55
  export declare function coordinateText(lang: FlatLang, axis: "lat" | "lon", degrees: number): string;
56
+ /**
57
+ * A latitude or longitude as a short label for the map's grid: `30°N` and `60°W`, or `北緯30°` and `西経60°`; `0°` for the equator and the prime meridian, and `180°` for the opposite meridian.
58
+ *
59
+ * @param lang - `en` or `ja`.
60
+ * @param axis - `lat` or `lon`.
61
+ * @param degrees - Degrees, north and east positive.
62
+ * @returns The label.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * import { gridText } from "@johnmorrisdotca/wakusei-planets/flat";
67
+ *
68
+ * console.log(gridText("en", "lat", 30), gridText("en", "lon", -60), gridText("ja", "lat", -30), gridText("en", "lon", 0));
69
+ * ```
70
+ */
71
+ export declare function gridText(lang: FlatLang, axis: "lat" | "lon", degrees: number): string;
@@ -1,5 +1,5 @@
1
1
  // The flat map's own words, in English and Japanese. The names of the bodies, the orbiters and the places come from the package's own tables (`BODIES`, `ORBITER_FACTS`, each place's `name`), not from here.
2
- // The keys that chikyu-earth's flat map also has (`map`, `controls`, `myPlace`, `footprint`, `groundTrack`, `zoomIn`, `zoomOut`, `all`, `help`) say the same thing in the same words, so a page that swaps one map for the other keeps its wording.
2
+ // The keys that chikyu-earth's flat map also has (`map`, `controls`, `myPlace`, `footprint`, `groundTrack`, `zoomIn`, `zoomOut`, `all`, `help`, `lookGroup`, `lookMap`, `lookPhoto`, `key`, `keyShow`, `keyHide`, `keyMarks`) say the same thing in the same words, so a page that swaps one map for the other keeps its wording.
3
3
  /**
4
4
  * The words the flat map writes, one table for each language: `{body}`, `{name}`, `{altitude}` and the like are filled in. The Japanese is standard, polite Japanese.
5
5
  *
@@ -52,6 +52,31 @@ export const FLAT_WORDS = {
52
52
  nothing: "Nothing to show.",
53
53
  help: "Arrow keys move from one orbiter or mark to the next, Enter chooses it, plus and minus zoom.",
54
54
  shown: "{orbiters} orbiters and {places} places shown",
55
+ oppositeMeridian: "Opposite side",
56
+ lookGroup: "Look of the map",
57
+ lookMap: "Map",
58
+ lookPhoto: "Photo",
59
+ key: "Key",
60
+ keyShow: "Show the key to the map",
61
+ keyHide: "Hide the key to the map",
62
+ keyMarks: "What the marks on the map are",
63
+ keySun: "The Sun is overhead",
64
+ keyNight: "The night side, darker",
65
+ keySunrise: "Sunrise or sunset line: the Sun is on the horizon",
66
+ keyHome: "My place",
67
+ keyOrbiter: "An orbiter",
68
+ keyOrbiterApprox: "An orbiter whose position is approximate",
69
+ keyRing: "What you chose",
70
+ keyFootprint: "Footprint: the area that can see the orbiter",
71
+ keyTrack: "Ground track: dashed behind the orbiter, solid ahead",
72
+ creditShort: "{body}: {who}",
73
+ creditWide: "{body}: {who} ({licence})",
74
+ announceMark: "{name}, {lat}, {lon}",
75
+ kind_mark: "mark",
76
+ moons: "Moons",
77
+ keyMoon: "A moon, over the place on the ground it is straight above",
78
+ keyMoonTrack: "A moon's track over the ground: dashed behind it, solid ahead",
79
+ announceMoon: "{name}, a moon of {body}, straight above {lat}, {lon}, {km} km from the centre",
55
80
  },
56
81
  ja: {
57
82
  map: "{body}の平面地図",
@@ -94,6 +119,31 @@ export const FLAT_WORDS = {
94
119
  nothing: "表示するものがありません。",
95
120
  help: "矢印キーで次の周回機や印へ移り、Enter キーで選びます。プラスとマイナスのキーで拡大・縮小します。",
96
121
  shown: "周回機{orbiters}機と地点{places}か所を表示中",
122
+ oppositeMeridian: "反対側",
123
+ lookGroup: "地図の見た目",
124
+ lookMap: "地図",
125
+ lookPhoto: "写真",
126
+ key: "凡例",
127
+ keyShow: "地図の凡例を表示する",
128
+ keyHide: "地図の凡例を閉じる",
129
+ keyMarks: "地図の印が表すもの",
130
+ keySun: "太陽が真上にある場所",
131
+ keyNight: "夜の側:暗くなっています",
132
+ keySunrise: "日の出・日の入りの線:太陽が地平線にあるところ",
133
+ keyHome: "自分の場所",
134
+ keyOrbiter: "周回機",
135
+ keyOrbiterApprox: "位置がおおよその周回機",
136
+ keyRing: "選んだもの",
137
+ keyFootprint: "可視範囲:その周回機が見える範囲",
138
+ keyTrack: "地上軌跡:周回機の後ろは点線、前は実線",
139
+ creditShort: "{body}:{who}",
140
+ creditWide: "{body}:{who}({licence})",
141
+ announceMark: "{name}、{lat}、{lon}",
142
+ kind_mark: "印",
143
+ moons: "衛星",
144
+ keyMoon: "衛星:その真下にある地表の場所に描きます",
145
+ keyMoonTrack: "衛星の地上軌跡:後ろは点線、前は実線",
146
+ announceMoon: "{name}、{body}の衛星、真下は{lat}、{lon}、中心から {km} km",
97
147
  },
98
148
  };
99
149
  /**
@@ -133,3 +183,26 @@ export function coordinateText(lang, axis, degrees) {
133
183
  return `${axis === "lat" ? (degrees < 0 ? "南緯" : "北緯") : degrees < 0 ? "西経" : "東経"}${value}°`;
134
184
  return `${value}° ${axis === "lat" ? (degrees < 0 ? "S" : "N") : degrees < 0 ? "W" : "E"}`;
135
185
  }
186
+ /**
187
+ * A latitude or longitude as a short label for the map's grid: `30°N` and `60°W`, or `北緯30°` and `西経60°`; `0°` for the equator and the prime meridian, and `180°` for the opposite meridian.
188
+ *
189
+ * @param lang - `en` or `ja`.
190
+ * @param axis - `lat` or `lon`.
191
+ * @param degrees - Degrees, north and east positive.
192
+ * @returns The label.
193
+ *
194
+ * @example
195
+ * ```ts
196
+ * import { gridText } from "@johnmorrisdotca/wakusei-planets/flat";
197
+ *
198
+ * console.log(gridText("en", "lat", 30), gridText("en", "lon", -60), gridText("ja", "lat", -30), gridText("en", "lon", 0));
199
+ * ```
200
+ */
201
+ export function gridText(lang, axis, degrees) {
202
+ const value = Math.abs(Math.round(degrees));
203
+ if (value === 0 || (axis === "lon" && value === 180))
204
+ return `${value}°`;
205
+ if (lang === "ja")
206
+ return `${axis === "lat" ? (degrees < 0 ? "南緯" : "北緯") : degrees < 0 ? "西経" : "東経"}${value}°`;
207
+ return `${value}°${axis === "lat" ? (degrees < 0 ? "S" : "N") : degrees < 0 ? "W" : "E"}`;
208
+ }
@@ -163,8 +163,8 @@ export interface MoonDiscovery {
163
163
  */
164
164
  export type MoonSizeSource = "measured" | "sheet" | "derived";
165
165
  /**
166
- * Where a moon's magnitude comes from: `sheet` (the V(1,0) magnitude on its JPL Horizons data sheet) or `wikipedia` (the absolute magnitude of English Wikipedia's table of the moons of its planet, which takes the irregular
167
- * moons' from the Minor Planet Center's Natural Satellites Ephemeris Service; read on `MOON_MAGNITUDES_READ`, the page is in `MOON_MAGNITUDE_PAGES`). A size worked out from a `wikipedia` magnitude is an estimate: it assumes the
166
+ * Where a moon's magnitude comes from: `sheet` (the V(1,0) magnitude on its JPL Horizons data sheet) or `usno` (the V(1,0) column of the U.S. Naval Observatory's satellite table for The Astronomical Almanac, read on
167
+ * `MOON_MAGNITUDES_READ`; the file is in `MOON_MAGNITUDE_PAGES`). A size worked out from a `usno` magnitude is an estimate: it assumes the
168
168
  * albedo `ASSUMED_ALBEDO`, and `radiusFrom` says `derived`.
169
169
  *
170
170
  * @example
@@ -175,27 +175,27 @@ export type MoonSizeSource = "measured" | "sheet" | "derived";
175
175
  * console.log(from);
176
176
  * ```
177
177
  */
178
- export type MoonMagnitudeSource = "sheet" | "wikipedia";
178
+ export type MoonMagnitudeSource = "sheet" | "usno";
179
179
  /**
180
- * The day the magnitudes marked `wikipedia` were read from English Wikipedia's tables (CC BY-SA 4.0): one request for each of the four pages.
180
+ * The day the magnitudes marked `usno` were read from the U.S. Naval Observatory's satellite table (a US government work): one request.
181
181
  *
182
182
  * @example
183
183
  * ```ts
184
184
  * import { MOON_MAGNITUDES_READ } from "@johnmorrisdotca/wakusei-planets/moon-catalogue";
185
185
  *
186
- * console.log("Wikipedia read on", MOON_MAGNITUDES_READ);
186
+ * console.log("Almanac read on", MOON_MAGNITUDES_READ);
187
187
  * ```
188
188
  */
189
- export declare const MOON_MAGNITUDES_READ = "2026-11-18";
189
+ export declare const MOON_MAGNITUDES_READ = "2026-11-23";
190
190
  /**
191
- * The English Wikipedia page each host's `wikipedia` magnitudes were read from.
191
+ * The U.S. Naval Observatory file each host's `usno` magnitudes were read from.
192
192
  *
193
193
  * @example
194
194
  * ```ts
195
195
  * import { findCatalogueMoon, MOON_MAGNITUDE_PAGES } from "@johnmorrisdotca/wakusei-planets/moon-catalogue";
196
196
  *
197
197
  * const moon = findCatalogueMoon("Ymir")!;
198
- * if (moon.magnitudeFrom === "wikipedia") console.log(MOON_MAGNITUDE_PAGES[moon.host]);
198
+ * if (moon.magnitudeFrom === "usno") console.log(MOON_MAGNITUDE_PAGES[moon.host]);
199
199
  * ```
200
200
  */
201
201
  export declare const MOON_MAGNITUDE_PAGES: Readonly<Partial<Record<HostId, string>>>;
@@ -249,7 +249,7 @@ export interface CatalogueMoon {
249
249
  radiusFrom: MoonSizeSource | null;
250
250
  /** The geometric albedo, where the Horizons sheet gives one. */
251
251
  albedo: number | null;
252
- /** The V(1,0) magnitude (as bright as it would be 1 au from the Sun and from us), where the Horizons sheet gives one, else, for an irregular moon with no size, the absolute magnitude of English Wikipedia's table (see `magnitudeFrom`). */
252
+ /** The V(1,0) magnitude (as bright as it would be 1 au from the Sun and from us), where the Horizons sheet gives one, else, for an irregular moon with no size, the Almanac's V(1,0) where that column prints one (see `magnitudeFrom`). */
253
253
  magnitude: number | null;
254
254
  /** Where `magnitude` comes from; `null` when there is none. */
255
255
  magnitudeFrom: MoonMagnitudeSource | null;
@@ -59,32 +59,33 @@ const OSCULATING = new Map();
59
59
  }
60
60
  }
61
61
  /**
62
- * The day the magnitudes marked `wikipedia` were read from English Wikipedia's tables (CC BY-SA 4.0): one request for each of the four pages.
62
+ * The day the magnitudes marked `usno` were read from the U.S. Naval Observatory's satellite table (a US government work): one request.
63
63
  *
64
64
  * @example
65
65
  * ```ts
66
66
  * import { MOON_MAGNITUDES_READ } from "@johnmorrisdotca/wakusei-planets/moon-catalogue";
67
67
  *
68
- * console.log("Wikipedia read on", MOON_MAGNITUDES_READ);
68
+ * console.log("Almanac read on", MOON_MAGNITUDES_READ);
69
69
  * ```
70
70
  */
71
- export const MOON_MAGNITUDES_READ = "2026-11-18";
71
+ export const MOON_MAGNITUDES_READ = "2026-11-23";
72
+ const ALMANAC = "https://aa.usno.navy.mil/downloads/publications/Satellite_data_web_b_2024_2.txt";
72
73
  /**
73
- * The English Wikipedia page each host's `wikipedia` magnitudes were read from.
74
+ * The U.S. Naval Observatory file each host's `usno` magnitudes were read from.
74
75
  *
75
76
  * @example
76
77
  * ```ts
77
78
  * import { findCatalogueMoon, MOON_MAGNITUDE_PAGES } from "@johnmorrisdotca/wakusei-planets/moon-catalogue";
78
79
  *
79
80
  * const moon = findCatalogueMoon("Ymir")!;
80
- * if (moon.magnitudeFrom === "wikipedia") console.log(MOON_MAGNITUDE_PAGES[moon.host]);
81
+ * if (moon.magnitudeFrom === "usno") console.log(MOON_MAGNITUDE_PAGES[moon.host]);
81
82
  * ```
82
83
  */
83
84
  export const MOON_MAGNITUDE_PAGES = {
84
- jupiter: "https://en.wikipedia.org/wiki/Moons_of_Jupiter",
85
- saturn: "https://en.wikipedia.org/wiki/Moons_of_Saturn",
86
- uranus: "https://en.wikipedia.org/wiki/Moons_of_Uranus",
87
- neptune: "https://en.wikipedia.org/wiki/Moons_of_Neptune",
85
+ jupiter: ALMANAC,
86
+ saturn: ALMANAC,
87
+ uranus: ALMANAC,
88
+ neptune: ALMANAC,
88
89
  };
89
90
  /**
90
91
  * The albedo a `derived` size takes when the Horizons sheet gives none: 0.04, the albedo the sheet gives for Himalia, the largest of the irregular moons. The few other irregular moons with an albedo on their sheets have 0.03
@@ -100,7 +101,7 @@ export const MOON_MAGNITUDE_PAGES = {
100
101
  export const ASSUMED_ALBEDO = 0.04;
101
102
  const FRAMES = ["ecliptic", "equatorial", "laplace"];
102
103
  const SIZE_FROM = ["measured", "sheet"];
103
- const MAGNITUDE_FROM = ["sheet", "wikipedia"];
104
+ const MAGNITUDE_FROM = ["sheet", "usno"];
104
105
  function moonOf(row) {
105
106
  const [id, name, designation, number, host, code, year, by, reference, o, radius, sigma, from, albedo, magnitude, worstKm, worstDegrees, farDegrees, group, ja, confirmed, drawn, magnitudeSource] = row;
106
107
  const orbit = o === null
@@ -102,7 +102,6 @@ tr:last-child > * { border-bottom: 0; }
102
102
  .hero { position: relative; overflow: hidden; height: min(78vh, 720px); min-height: 520px; background: #000; border-radius: 16px; }
103
103
  .hero:fullscreen { width: 100%; height: 100%; min-height: 0; border-radius: 0; }
104
104
  .hero-planet { position: absolute; z-index: 1; top: 50%; right: -70%; width: 124%; aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; }
105
- .hero-planet.clip-disc { width: 52%; right: 4%; border-radius: 50%; overflow: hidden; }
106
105
  .hero-planet wakusei-body, .hero-disc wakusei-body { --wakusei-size: 100%; width: 100%; height: 100%; display: block; }
107
106
  .hero-moons { position: absolute; inset: 0; z-index: 2; }
108
107
  .hero-moon { position: absolute; transform: translate(-50%, -50%); display: block; margin: 0; padding: 0; border: 0; background: none; color: #fff; touch-action: manipulation; }
@@ -497,7 +496,6 @@ export class WakuseiMoonPages extends HTMLElement {
497
496
  planet.setAttribute("pitch", String(pose.pitch));
498
497
  this.#textures(planet);
499
498
  const frame = this.#$("#hero-planet");
500
- frame.classList.toggle("clip-disc", host === "jupiter");
501
499
  frame.replaceChildren(planet);
502
500
  const zoom = heroZoom(host);
503
501
  if (zoom !== 1)
@@ -3,15 +3,12 @@ import type { MoonPageHost, PageCard } from "./data.ts";
3
3
  export declare const HERO_ARC: Record<MoonPageHost, readonly string[]>;
4
4
  /** A second, smaller row: the named moons the package draws that are not in the arc. Saturn's list is the small moons of the reference; Methone is not drawn here. None of these has a photo map. */
5
5
  export declare const HERO_SMALL: Record<MoonPageHost, readonly string[]>;
6
- /** Where the painted face is turned, in degrees, so the familiar side of the planet meets the moons. Jupiter's longitude is the package's best-known side, turned so the Great Red Spot sits in the visible half. Saturn's pitch looks over the pole: the near half of the rings, the one drawn in front of the globe, then crosses the lower part of the globe. A negative pitch puts that half on the upper globe and the far half, which the globe hides, on the lower. */
6
+ /** Where the painted face is turned, in degrees, so the familiar side of the planet meets the moons. Jupiter's longitude is the package's best-known side, turned so the Great Red Spot sits in the visible half. Jupiter's and Saturn's pitch looks over the pole: the near half of the rings, the one drawn in front of the globe, then crosses the lower part of the globe, and the ring is an ellipse. A negative pitch puts that half on the upper globe and the far half, which the globe hides, on the lower. */
7
7
  export declare const HERO_POSE: Record<MoonPageHost, {
8
8
  meridian: number;
9
9
  tilt: number;
10
10
  pitch?: number;
11
11
  }>;
12
- /**
13
- * How far a hero planet is zoomed. A tight portrait fits the rings, and Jupiter's faint rings would shrink the globe to a third of the frame, so Jupiter is zoomed until the globe fills it. Saturn's rings are the picture, and stay at 1.
14
- */
15
12
  export declare function heroZoom(host: MoonPageHost): number;
16
13
  /** One moon of the hero: its name, the disc's width in pixels, and the centre as a percent of the hero. */
17
14
  export interface HeroMoon {