@johnmorrisdotca/wakusei-planets 0.56.0 → 0.58.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.58.0] - 2026-11-17
6
+
7
+ - **Landing sites with their country's flag** (MODULES-1398; John Morris, 2026-11-16). New entry point `/landing-sites`: `LANDING_SITES`, 39 landings that touched down softly and were heard from (28 on the Moon: Apollo 11 to 17, Surveyor 1, 3, 5, 6 and 7, Luna 9, 13, 16, 17, 20, 21, 23 and 24, Chang'e 3 to 6, Chandrayaan-3, SLIM, IM-1, Blue Ghost 1, IM-2; 11 on Mars: Mars 3, Viking 1 and 2, Pathfinder, Spirit, Opportunity, Phoenix, Curiosity, InSight, Perseverance, Zhurong), each with its names in English and Japanese, its day, its point, its agency, its ISO country code and the page each coordinate is from, plus `landingSitesOf`, `findLandingSite` and `flagCodeOf`. The points are the place tables' own and a test pins them together; the Moon's were compared row by row with NASA NSSDCA's table. The attribute `site-flags` (property `siteFlags`) on `<wakusei-body>` and `<wakusei-space>` puts the country's flag in the tip of a place and, on a body at least 110 pixels of radius across on the screen, names each landing site beside its dot with its flag; the flag is `<hata-flag>`, drawn when the page has imported `@johnmorrisdotca/hata` (no new dependency: without it only the name shows). `wakusei-place`'s `detail` gains `site`. Nothing changes with the attribute off. The demo's Places row has a Flags button (`flags=1` in the address). `@johnmorrisdotca/hata` is a dev dependency, for the tests and the demo. Guide: Landing sites, with their flags.
8
+
9
+ ## [0.57.0] - 2026-11-17
10
+
11
+ - **A planet, a moon or the Sun is round wherever it is in the picture** (MODULES-1390; John Morris, 2026-11-20). In the space view's wide windows the Sun near the left edge was a wide flat ellipse, the Moon at the bottom stretched tall and the Earth near a corner stretched along the diagonal. The cause is the perspective camera itself, not a stale aspect, a non-uniform scale on the magnified bodies or a frame's up vector: a sphere `theta` off the line of sight is drawn `1 / cos(theta)` as long as it is wide, along the line to the middle of the picture, and the view's field of view (35 degrees top to bottom, 80 degrees across a 2012 by 745 window) puts the edge 37 degrees out and a corner more. Measured as the long axis over the short from the drawn pixels, in a 2012 by 745 window: Venus 1.267, the Earth 1.081 (the painter's own bodies at the edges and corners of that window: 1.21 to 1.24), all now 1.00 to 1.01. A narrower field of view was not taken: within 3% at the corners it would need under 30 degrees across, which moves the camera three times as far back and changes every travel and arrival framing. Each body is now drawn as the ellipsoid that projects to a circle: the sphere squeezed, across the line of sight to it, by `1 / sqrt(1 + tan²θ · d² / (d² − r²))` (the circular sections of the cone of sight), done in the vertex shaders of the globe, its rings and its name (`src/scene/round.ts`). The colours, light, map, rings, glow and name are the sphere's own, and the body's centre, its depth, picking and every camera path (travel, arrival, the Pair and Body frames) are unchanged. The radius on the screen (`placeOf(id).r`, what a press is tested against, the names' offset and the map tiles' choice) is now the drawn one, `1 / cos(theta)` times that in the middle (a press near the edge of a wide window used to miss the outer fifth of a disc), and the marks over the Earth and over a body follow the squeezed surface. `PaintInfo.round` (default `true`, in effect only with `view` and a perspective camera) turns it off for a scene of your own. Tests: `e2e/round-bodies.demo.ts` (the Sun, Mars and the Moon at the left, top, right, bottom and corners of a wide, a tall and a square window; the Sun's glow; the space view's Earth, Moon and Venus in two wide windows) and `test/round.test.ts`.
12
+
5
13
  ## [0.56.0] - 2026-11-17
6
14
 
7
15
  - **A move from the Earth view out to a planet or the Sun goes straight, not out to the whole system and back** (MODULES-1388, linked to MODULES-1371; John Morris, 2026-11-16). The site hands the planets view over at the Earth view's far distance (187 Earth radii, the Earth a few pixels across) with the destination turned into the picture; in the squeezed scale that distance already shows the whole system, and the planner then backed off from the Earth to a stand on the line of the last view, 2.2 times the distance between the two bodies for the Earth to Pluto, to turn there and come in. Where that stand is more than 1.2 times as far from the body left as the camera began (`BACK_UP`), the planner now tries the straight way, a swing (straight at the destination with it in the picture, the look direction turned round it over the last stretch), and takes it when its walk has no fault of any kind more than the other. Measured on the inputs the space view handed the planner (`test/data/travel-site-inputs.json`), how far out the camera goes, in the larger of the distance between the bodies and where it began (`out` in `test/travel-harness.ts`): the Earth to Mars 1.52 before and 1.00 now, to Pluto 2.23 and 0.64, to the Sun 1.00 and 1.00; over 180 moves from the Earth (ten destinations, three directions, both pictures' shapes, both scales) the ones over 1.2 fall from 15 to 3 (the tall picture with the destination 50 degrees off, where the swing has a fault) and the farthest from 3.22 to 1.6. Stops between the turn and the way on (MODULES-1384), over the 54 moves of `test/travel-smooth.test.ts`: 26 before and 26 now; the moves that start the way on during the turn fall from 42 to 35, those 7 being swings, which keep their own timing.
package/README.md CHANGED
@@ -19,7 +19,7 @@ Wakusei Planets runs in the browser of a phone, a tablet or a computer: nothing
19
19
 
20
20
  <p align="center"><img alt="The demo on a desk: Saturn in the painted look, turning in the big view, with the page's links to the portrait builder, the colouring sheets, the space view, the star page and the size line-up above it, and the choice of body and its moons below" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-desk.webp" width="620"> <img alt="The same page on a phone: the same links in rows, and Saturn in the painted look below them" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-phone.webp" width="200"></p>
21
21
 
22
- <p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.56.0/docs/images/lineup-desk.png" width="640"></p>
22
+ <p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.58.0/docs/images/lineup-desk.png" width="640"></p>
23
23
 
24
24
  ## Who it is for
25
25
 
@@ -388,7 +388,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
388
388
 
389
389
  ## The portrait builder
390
390
 
391
- <p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.56.0/docs/images/portrait-family.png" width="640"></p>
391
+ <p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.58.0/docs/images/portrait-family.png" width="640"></p>
392
392
 
393
393
  [The portrait builder](https://johnmorrisdotca.github.io/wakusei-planets/portrait.html) puts any bodies in one picture: drag them, size them, turn them, order them front to back, arrange them in a row, an arc, a grid or at true orbit distance (true or readable sizes, a planet's moons round it in orbit order), light them from one direction, and take the code, a PNG or an SVG. The scene is kept in the address, and every body is drawn in one WebGL scene, so the page holds one WebGL context. [The portrait builder](docs/guides/portrait-builder.md) is its guide.
394
394
 
@@ -445,6 +445,7 @@ The reference is a site, made from the source's own doc comments: every export h
445
445
  | `.../space` | Where the Sun, the Moon and the planets are for a date, in two scales, and where a camera riding along looks: `frameAt`, `createTrack`, `placeSun`, `placeAround`, `ridePose`. No browser. |
446
446
  | `.../space/element` | `<wakusei-space>`: the Earth, the Moon, the Sun and the planets in their places. |
447
447
  | `.../plan` | The top-down plan: `planAt`, `planSvg`, `planText`. `.../plan/element` is `<wakusei-plan>`, in SVG with no WebGL. |
448
+ | `.../landing-sites` | The 39 soft landings on the Moon and Mars as plain data: `LANDING_SITES`, `landingSitesOf`, `findLandingSite`, `flagCodeOf`. No browser, no three.js. |
448
449
  | `.../nearest` | The bodies nearest to a body on a date (`nearest`, `within`), when two bodies come closest (`closestApproach`, `conjunctions`) and how far apart they are (`distance`, `distanceRange`). No browser. |
449
450
  | `.../sheets` | Printable colouring sheets for children: the Sun, the planets and the big moons in thick lines with the real colours and three facts, and all the planets at one scale, in English and Japanese (`kidsSvg`, `kidsSheet`, `kidsFacts`). |
450
451
  | `.../look` | What a body needs to be drawn with three.js. |
@@ -494,6 +495,7 @@ Each guide has a Japanese twin in [docs/guides/ja](docs/guides/ja/getting-starte
494
495
  | [Starman and the Tesla Roadster](docs/guides/roadster.md) | where the car launched on the first Falcon Heavy is on any date from 2018 to the start of 2036, its distances, speeds, orbit and key moments |
495
496
  | [Comets](docs/guides/comets.md) | 34 well-known comets with orbits from JPL: where each is on any date, its distances, orbit line, last and next perihelion, meteor showers, and a door to add a new comet |
496
497
  | [Places on the Moon, Mars and 31 more bodies](docs/guides/places.md) | every landing, rover, crash, impact and atmospheric-entry site and the named features of 33 bodies, with positions, dates and sources, the famous ones marked, and the Sun's point, the terminator and the local solar time on any body |
498
+ | [Landing sites, with their flags](docs/guides/landing-sites.md) | the 28 soft landings on the Moon and 11 on Mars as one small plain list (names in English and Japanese, day, point, agency, country, the page each coordinate is from), and `site-flags` on the 3D views: the sites named beside their dots with their country's flag, from `@johnmorrisdotca/hata` when the page has it |
497
499
  | [Which face of a body the view looks at](docs/guides/which-face.md) | `subCameraPoint()` and `faceTo()` on the space view and on a body's picture: the longitude and latitude under the camera, and a turn to a point, for a card picture that follows the view |
498
500
  | [Data files](docs/guides/data-files.md) | CSV and Parquet tables of the bodies, orbits and spacecraft, for Python, R and Rust |
499
501
  | [Serve it yourself](docs/guides/serve-it-yourself.md) | A small Node server over the package, that you host |
@@ -537,7 +539,7 @@ BODIES.pluto.kind; // "dwarf-planet"
537
539
 
538
540
  If this package helps a paper, a talk or a class, please cite it as software. GitHub's "Cite this repository" button reads [CITATION.cff](CITATION.cff) and gives BibTeX and APA; in plain text:
539
541
 
540
- > Morris, J. (2026). *Wakusei Planets* (version 0.56.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
542
+ > Morris, J. (2026). *Wakusei Planets* (version 0.58.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
541
543
 
542
544
  Cite the version you used (`npm ls @johnmorrisdotca/wakusei-planets`), and cite the sources of the numbers you use as well: [NOTICE.md](NOTICE.md) names each one, with the paper or the page it was read from (the IAU working group's report for sizes and poles, VSOP87B, ELP2000-82B, L1.2 and TASS1.7 for positions, and NASA's JPL Horizons for the fits and the spacecraft).
543
545
 
package/dist/element.d.ts CHANGED
@@ -102,6 +102,13 @@ export declare class WakuseiBody extends HTMLElement {
102
102
  */
103
103
  get places(): PlaceLayer[];
104
104
  set places(layers: readonly PlaceLayer[] | null);
105
+ /**
106
+ * Whether the places carry their country's flag (the attribute `site-flags`): the tip of a place with a country shows its flag, and on a body close enough on the screen (110 pixels of radius) the landing sites (`LANDING_SITES` from
107
+ * `/landing-sites`) are named beside their dots, each with its flag. The flag is `<hata-flag>` from `@johnmorrisdotca/hata`, which the page imports itself (`import "@johnmorrisdotca/hata/element/define"`); until it is defined the name stands alone. Needs `places`.
108
+ * The `wakusei-place` event's detail carries the landing site as `site` where the place is one. Setting it writes the attribute.
109
+ */
110
+ get siteFlags(): boolean;
111
+ set siteFlags(on: boolean);
105
112
  /** The marks laid on the body now: each place's id, its layer and where its mark is, in CSS pixels from the picture's top left. */
106
113
  get placesShown(): readonly {
107
114
  id: string;
package/dist/element.js CHANGED
@@ -107,7 +107,7 @@ const TEMPLATE = `<style>
107
107
  * ```
108
108
  */
109
109
  export class WakuseiBody extends HTMLElement {
110
- static observedAttributes = ["body", "star", "quality", ...STAR_ATTRS, "look", "size", "time", "tilt", "pitch", "phase", "meridian", "turn", "rate", "moons", "range", "scale-to", "span-km", "fit", "live", "texture-base", "texture-far-base", "tiles", "data", "lang", "labels", "places", "surface-names", "cutaway", ...NAME_LABEL_ATTRIBUTES];
110
+ static observedAttributes = ["body", "star", "quality", ...STAR_ATTRS, "look", "size", "time", "tilt", "pitch", "phase", "meridian", "turn", "rate", "moons", "range", "scale-to", "span-km", "fit", "live", "texture-base", "texture-far-base", "tiles", "data", "lang", "labels", "places", "surface-names", "site-flags", "cutaway", ...NAME_LABEL_ATTRIBUTES];
111
111
  #stage;
112
112
  #state = "line";
113
113
  #renderer;
@@ -287,6 +287,17 @@ export class WakuseiBody extends HTMLElement {
287
287
  else
288
288
  this.setAttribute("places", layers.join(" "));
289
289
  }
290
+ /**
291
+ * Whether the places carry their country's flag (the attribute `site-flags`): the tip of a place with a country shows its flag, and on a body close enough on the screen (110 pixels of radius) the landing sites (`LANDING_SITES` from
292
+ * `/landing-sites`) are named beside their dots, each with its flag. The flag is `<hata-flag>` from `@johnmorrisdotca/hata`, which the page imports itself (`import "@johnmorrisdotca/hata/element/define"`); until it is defined the name stands alone. Needs `places`.
293
+ * The `wakusei-place` event's detail carries the landing site as `site` where the place is one. Setting it writes the attribute.
294
+ */
295
+ get siteFlags() {
296
+ return this.hasAttribute("site-flags");
297
+ }
298
+ set siteFlags(on) {
299
+ this.toggleAttribute("site-flags", on);
300
+ }
290
301
  /** The marks laid on the body now: each place's id, its layer and where its mark is, in CSS pixels from the picture's top left. */
291
302
  get placesShown() {
292
303
  return this.#placeLayer?.shown ?? [];
@@ -425,7 +436,8 @@ export class WakuseiBody extends HTMLElement {
425
436
  if (this.#placeLayer === undefined && this.shadowRoot !== null) {
426
437
  this.#placeLayer = createPlaceLayer(this.shadowRoot, {
427
438
  lang: () => (this.getAttribute("lang") === "ja" ? "ja" : "en"),
428
- pick: (place, at) => this.dispatchEvent(new CustomEvent("wakusei-place", { detail: { body, place, x: at.x, y: at.y }, bubbles: true, composed: true })),
439
+ flags: () => this.hasAttribute("site-flags"),
440
+ pick: (place, site, at) => this.dispatchEvent(new CustomEvent("wakusei-place", { detail: { body, place, site, x: at.x, y: at.y }, bubbles: true, composed: true })),
429
441
  });
430
442
  // a picture with buttons in it is a group, not an image
431
443
  if (this.getAttribute("role") === "img")
@@ -456,7 +468,7 @@ export class WakuseiBody extends HTMLElement {
456
468
  height: h,
457
469
  radiusPx: (Math.min(w, h) / 2) * (state.zoom / state.extent),
458
470
  }, facts.radiusKm, names, [], this.getAttribute("lang") === "ja" ? "ja" : "en");
459
- this.#placeLayer.set(marks);
471
+ this.#placeLayer.set(marks, (Math.min(w, h) / 2) * (state.zoom / state.extent));
460
472
  }
461
473
  /** What the element is doing now. */
462
474
  get state() {
@@ -561,7 +573,7 @@ export class WakuseiBody extends HTMLElement {
561
573
  this.#refreshLimits();
562
574
  }
563
575
  this.#lastAnchors = -1;
564
- if (name === "places" || name === "lang" || name === "body" || name === "look" || name === "star" || name === "surface-names")
576
+ if (name === "places" || name === "site-flags" || name === "lang" || name === "body" || name === "look" || name === "star" || name === "surface-names")
565
577
  this.#markPlaces();
566
578
  this.#queue();
567
579
  }
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Where a site's coordinates come from: the source's name and the address of the page the numbers were read from.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * import type { LandingSource } from "@johnmorrisdotca/wakusei-planets/landing-sites";
7
+ * import { LANDING_SITES } from "@johnmorrisdotca/wakusei-planets/landing-sites";
8
+ *
9
+ * const source: LandingSource = LANDING_SITES[0]!.source;
10
+ * console.log(source.name, source.url);
11
+ * ```
12
+ */
13
+ export interface LandingSource {
14
+ name: string;
15
+ url: string;
16
+ }
17
+ /**
18
+ * One landing site. `place` is the id of the same site in the place tables (`findPlace` on `/places/moon` or `/places/mars` takes it, and the 3D views' `wakusei-place` event carries it). Latitude is planetocentric and longitude east, from -180 to 180,
19
+ * as in the place tables. `country` is an ISO 3166-1 alpha-2 code in capitals, and `SU` for the Soviet Union (the code ISO 3166-3 kept for it); `flagCodeOf` turns it into the code a flag element wants. `agency` is who flew it.
20
+ * `source` is where the numbers were read, `checkedAgainst` a second NASA page that agrees, `page` the NSSDCA page of the mission where there is one, and `stand` the id of the site in the standing view (`/surface`), for the one place a reader can stand.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * import type { LandingSite } from "@johnmorrisdotca/wakusei-planets/landing-sites";
25
+ * import { LANDING_SITES } from "@johnmorrisdotca/wakusei-planets/landing-sites";
26
+ *
27
+ * const site: LandingSite = LANDING_SITES.find((one) => one.id === "moon/apollo-17")!;
28
+ * console.log(site.name.en, site.lat, site.lon, site.country, site.stand);
29
+ * ```
30
+ */
31
+ export interface LandingSite {
32
+ /** `<body>/<slug>`, unique. */
33
+ id: string;
34
+ /** The id of the same place in the place tables. */
35
+ place: string;
36
+ /** The ids of the other places the tables hold on the same spot (the rover, the descent stage), so a mark on any of them is this site. */
37
+ alsoAt?: readonly string[];
38
+ body: "moon" | "mars";
39
+ name: {
40
+ en: string;
41
+ ja: string;
42
+ };
43
+ /** When it touched down (ISO, UTC, to the minute). */
44
+ date: string;
45
+ lat: number;
46
+ lon: number;
47
+ agency: {
48
+ en: string;
49
+ ja: string;
50
+ };
51
+ /** ISO 3166-1 alpha-2 in capitals, or `SU`. */
52
+ country: string;
53
+ /** True where the source gives the point as "about" or says the real place can be kilometres away. */
54
+ approximate?: true;
55
+ /** The id of the site in the standing view, where a reader can stand there. */
56
+ stand?: string;
57
+ /** A word about how it ended, in English, where the sources say. */
58
+ note?: string;
59
+ source: LandingSource;
60
+ /** A second page that gives the same place. */
61
+ checkedAgainst?: LandingSource;
62
+ /** The mission's page at NASA NSSDCA, where it loads. */
63
+ page?: string;
64
+ }
65
+ /**
66
+ * Every landing on the Moon and Mars that touched down softly and was heard from, 28 on the Moon (Apollo 11 to 17, Surveyor 1, 3, 5, 6 and 7, Luna 9, 13, 16, 17, 20, 21, 23 and 24, Chang'e 3, 4, 5 and 6, Chandrayaan-3, SLIM, IM-1, Blue Ghost 1 and IM-2) and 11 on
67
+ * Mars (Mars 3, Viking 1 and 2, Pathfinder, Spirit, Opportunity, Phoenix, Curiosity, InSight, Perseverance and Zhurong), the Moon's first and Mars's after, each by date. Landers that did not survive the landing (Mars 2 and 6, Beagle 2, Schiaparelli) are not here; they are
68
+ * in the place tables as crashes.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * import { LANDING_SITES } from "@johnmorrisdotca/wakusei-planets/landing-sites";
73
+ *
74
+ * console.log(LANDING_SITES.length, "sites;", LANDING_SITES.filter((site) => site.country === "CN").map((site) => site.name.en).join(", "));
75
+ * ```
76
+ */
77
+ export declare const LANDING_SITES: readonly LandingSite[];
78
+ /**
79
+ * The landing sites of one body, by date.
80
+ *
81
+ * @param body - `moon` or `mars`.
82
+ * @returns Its sites.
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * import { landingSitesOf } from "@johnmorrisdotca/wakusei-planets/landing-sites";
87
+ *
88
+ * console.log(landingSitesOf("mars").map((site) => `${site.name.en} ${site.date.slice(0, 4)}`).join(", "));
89
+ * ```
90
+ */
91
+ export declare function landingSitesOf(body: LandingSite["body"]): LandingSite[];
92
+ /**
93
+ * A landing site by its id (`moon/apollo-11`), by the id of its place in the place tables (`moon/apollo-11-lunar-module`, or its rover's), or by its name in English or Japanese in any case, or `undefined`.
94
+ *
95
+ * @param text - The id, place id or name.
96
+ * @returns The site, or `undefined` when none matches.
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * import { findLandingSite } from "@johnmorrisdotca/wakusei-planets/landing-sites";
101
+ *
102
+ * console.log(findLandingSite("moon/apollo-11-lunar-module")?.name.ja, findLandingSite("zhurong")?.country, findLandingSite("nowhere"));
103
+ * ```
104
+ */
105
+ export declare function findLandingSite(text: string): LandingSite | undefined;
106
+ /**
107
+ * The code a flag element (`<hata-flag code="...">`, from `@johnmorrisdotca/hata`) takes for a country as the place tables and the landing sites write it: the two letters of ISO 3166-1 in capitals, `SU` for the Soviet Union, and GCAT's `J` for Japan
108
+ * (`JP`). A country with no flag to show (an agency of several countries) or with no code gives `undefined`.
109
+ *
110
+ * @param country - A site's `country`, or a place's.
111
+ * @returns The code, or `undefined`.
112
+ *
113
+ * @example
114
+ * ```ts
115
+ * import { flagCodeOf } from "@johnmorrisdotca/wakusei-planets/landing-sites";
116
+ *
117
+ * console.log(flagCodeOf("J"), flagCodeOf("SU"), flagCodeOf("us"), flagCodeOf("ESA"), flagCodeOf(undefined));
118
+ * ```
119
+ */
120
+ export declare function flagCodeOf(country: string | undefined): string | undefined;
@@ -0,0 +1,339 @@
1
+ // The landing sites: every landing on the Moon and Mars that touched down softly and was heard from, as one small plain list a page can draw a card, a flat map or a marker from. Pure: no DOM, no three.js, no tables of places;
2
+ // the record carries what a card needs (names in English and Japanese, the day, the point, who flew it, the country as a flag code, and where each number is from). The points are the ones the place tables (`/places/moon`, `/places/mars`)
3
+ // hold, and `test/landing-sites.test.ts` pins the two together, so a site on a card is the site on the globe. Typed by hand from the sources named in each record; nothing is guessed, and a site with no primary source is left out.
4
+ // Moon: NASA NSSDCA's "Table of Anthropogenic Impacts and Spacecraft on the Moon", read 2026-11-17 (every row below was checked against the page). Mars: the Mars Orbital Data Explorer's list of landing sites, NASA NSSDCA's Viking pages,
5
+ // NASA GISS's Mars24 lander list and GCAT, each named in the record; where the record's own source is GCAT, a NASA page (`checkedAgainst`) agrees with it to the 0.01 degree the page prints.
6
+ const NSS = "https://nssdc.gsfc.nasa.gov/nmc/spacecraft/display.action?id=";
7
+ const AGENCY = {
8
+ NASA: { en: "NASA", ja: "NASA" },
9
+ USSR: { en: "Soviet space programme", ja: "ソ連の宇宙計画" },
10
+ CNSA: { en: "CNSA (China)", ja: "中国国家航天局 (CNSA)" },
11
+ ISRO: { en: "ISRO", ja: "インド宇宙研究機関 (ISRO)" },
12
+ JAXA: { en: "JAXA", ja: "宇宙航空研究開発機構 (JAXA)" },
13
+ IM: { en: "Intuitive Machines", ja: "インテュイティブ・マシーンズ" },
14
+ FF: { en: "Firefly Aerospace", ja: "ファイアフライ・エアロスペース" },
15
+ };
16
+ const SRC_NASA_MOON = { name: "NASA NSSDCA, Table of Anthropogenic Impacts and Spacecraft on the Moon", url: "https://nssdc.gsfc.nasa.gov/planetary/lunar/lunar_artifact_impacts.html" };
17
+ const SRC_ODE = { name: "NASA Planetary Data System, Mars Orbital Data Explorer, landing sites", url: "https://ode.rsl.wustl.edu/mars/pagehelp/Content/Missions_Instruments/Landing_Sites.htm" };
18
+ const SRC_MARS24 = { name: "NASA GISS, Mars24 Sunclock, Mars lander missions", url: "https://www.giss.nasa.gov/tools/mars24/help/landers.html" };
19
+ const SRC_GCAT = { name: "GCAT, J. McDowell (CC BY 4.0)", url: "https://planet4589.org/space/gcat/" };
20
+ /**
21
+ * Every landing on the Moon and Mars that touched down softly and was heard from, 28 on the Moon (Apollo 11 to 17, Surveyor 1, 3, 5, 6 and 7, Luna 9, 13, 16, 17, 20, 21, 23 and 24, Chang'e 3, 4, 5 and 6, Chandrayaan-3, SLIM, IM-1, Blue Ghost 1 and IM-2) and 11 on
22
+ * Mars (Mars 3, Viking 1 and 2, Pathfinder, Spirit, Opportunity, Phoenix, Curiosity, InSight, Perseverance and Zhurong), the Moon's first and Mars's after, each by date. Landers that did not survive the landing (Mars 2 and 6, Beagle 2, Schiaparelli) are not here; they are
23
+ * in the place tables as crashes.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * import { LANDING_SITES } from "@johnmorrisdotca/wakusei-planets/landing-sites";
28
+ *
29
+ * console.log(LANDING_SITES.length, "sites;", LANDING_SITES.filter((site) => site.country === "CN").map((site) => site.name.en).join(", "));
30
+ * ```
31
+ */
32
+ export const LANDING_SITES = [
33
+ {
34
+ id: "moon/luna-9", place: "moon/luna-9", body: "moon", name: { en: "Luna 9", ja: "ルナ9号" },
35
+ date: "1966-02-03T18:45Z", lat: 7.13, lon: -64.37, agency: AGENCY.USSR,
36
+ country: "SU", approximate: true,
37
+ source: SRC_NASA_MOON,
38
+ },
39
+ {
40
+ id: "moon/surveyor-1", place: "moon/surveyor-1", body: "moon", name: { en: "Surveyor 1", ja: "サーベイヤー1号" },
41
+ date: "1966-06-02T06:17Z", lat: -2.4745, lon: -43.3398, agency: AGENCY.NASA,
42
+ country: "US",
43
+ source: SRC_NASA_MOON, page: `${NSS}1966-045A`,
44
+ },
45
+ {
46
+ id: "moon/luna-13", place: "moon/luna-13", body: "moon", name: { en: "Luna 13", ja: "ルナ13号" },
47
+ date: "1966-12-24T18:01Z", lat: 18.87, lon: -62.05, agency: AGENCY.USSR,
48
+ country: "SU",
49
+ source: SRC_NASA_MOON,
50
+ },
51
+ {
52
+ id: "moon/surveyor-3", place: "moon/surveyor-3", body: "moon", name: { en: "Surveyor 3", ja: "サーベイヤー3号" },
53
+ date: "1967-04-20T00:04Z", lat: -3.0162, lon: -23.418, agency: AGENCY.NASA,
54
+ country: "US",
55
+ source: SRC_NASA_MOON, page: `${NSS}1967-035A`,
56
+ },
57
+ {
58
+ id: "moon/surveyor-5", place: "moon/surveyor-5", body: "moon", name: { en: "Surveyor 5", ja: "サーベイヤー5号" },
59
+ date: "1967-09-11T00:46Z", lat: 1.4551, lon: 23.1943, agency: AGENCY.NASA,
60
+ country: "US",
61
+ source: SRC_NASA_MOON, page: `${NSS}1967-084A`,
62
+ },
63
+ {
64
+ id: "moon/surveyor-6", place: "moon/surveyor-6", body: "moon", name: { en: "Surveyor 6", ja: "サーベイヤー6号" },
65
+ date: "1967-11-10T01:01Z", lat: 0.4742, lon: -1.4275, agency: AGENCY.NASA,
66
+ country: "US",
67
+ source: SRC_NASA_MOON, page: `${NSS}1967-112A`,
68
+ },
69
+ {
70
+ id: "moon/surveyor-7", place: "moon/surveyor-7", body: "moon", name: { en: "Surveyor 7", ja: "サーベイヤー7号" },
71
+ date: "1968-01-10T01:05Z", lat: -40.9812, lon: -11.5127, agency: AGENCY.NASA,
72
+ country: "US",
73
+ source: SRC_NASA_MOON, page: `${NSS}1968-001A`,
74
+ },
75
+ {
76
+ id: "moon/apollo-11", place: "moon/apollo-11-lunar-module", body: "moon", name: { en: "Apollo 11", ja: "アポロ11号" },
77
+ date: "1969-07-20T20:17Z", lat: 0.6742, lon: 23.4731, agency: AGENCY.NASA,
78
+ country: "US",
79
+ source: SRC_NASA_MOON, page: `${NSS}1969-059C`,
80
+ },
81
+ {
82
+ id: "moon/apollo-12", place: "moon/apollo-12-lunar-module", body: "moon", name: { en: "Apollo 12", ja: "アポロ12号" },
83
+ date: "1969-11-19T06:54Z", lat: -3.0128, lon: -23.4219, agency: AGENCY.NASA,
84
+ country: "US",
85
+ source: SRC_NASA_MOON, page: `${NSS}1969-099C`,
86
+ },
87
+ {
88
+ id: "moon/luna-16", place: "moon/luna-16", body: "moon", name: { en: "Luna 16", ja: "ルナ16号" },
89
+ date: "1970-09-20T05:17Z", lat: -0.5137, lon: 56.3638, agency: AGENCY.USSR,
90
+ country: "SU",
91
+ source: SRC_NASA_MOON,
92
+ },
93
+ {
94
+ id: "moon/luna-17", place: "moon/luna-17", body: "moon", name: { en: "Luna 17", ja: "ルナ17号" },
95
+ alsoAt: ["moon/lunokhod-1"],
96
+ date: "1970-11-17T03:47Z", lat: 38.2376, lon: -35.0016, agency: AGENCY.USSR,
97
+ country: "SU", note: "Carried Lunokhod 1.",
98
+ source: SRC_NASA_MOON,
99
+ },
100
+ {
101
+ id: "moon/apollo-14", place: "moon/apollo-14-lunar-module", body: "moon", name: { en: "Apollo 14", ja: "アポロ14号" },
102
+ date: "1971-02-05T09:18Z", lat: -3.6459, lon: -17.4719, agency: AGENCY.NASA,
103
+ country: "US",
104
+ source: SRC_NASA_MOON, page: `${NSS}1971-008C`,
105
+ },
106
+ {
107
+ id: "moon/apollo-15", place: "moon/apollo-15-lunar-module", body: "moon", name: { en: "Apollo 15", ja: "アポロ15号" },
108
+ alsoAt: ["moon/apollo-15-lunar-rover"],
109
+ date: "1971-07-30T22:16Z", lat: 26.1324, lon: 3.6333, agency: AGENCY.NASA,
110
+ country: "US",
111
+ source: SRC_NASA_MOON, page: `${NSS}1971-063C`,
112
+ },
113
+ {
114
+ id: "moon/luna-20", place: "moon/luna-20", body: "moon", name: { en: "Luna 20", ja: "ルナ20号" },
115
+ date: "1972-02-21T19:18Z", lat: 3.7863, lon: 56.6242, agency: AGENCY.USSR,
116
+ country: "SU",
117
+ source: SRC_NASA_MOON,
118
+ },
119
+ {
120
+ id: "moon/apollo-16", place: "moon/apollo-16-lunar-module", body: "moon", name: { en: "Apollo 16", ja: "アポロ16号" },
121
+ alsoAt: ["moon/apollo-16-lunar-rover"],
122
+ date: "1972-04-21T02:23Z", lat: -8.9734, lon: 15.5011, agency: AGENCY.NASA,
123
+ country: "US",
124
+ source: SRC_NASA_MOON, page: `${NSS}1972-031C`,
125
+ },
126
+ {
127
+ id: "moon/apollo-17", place: "moon/apollo-17-lunar-module", body: "moon", name: { en: "Apollo 17", ja: "アポロ17号" },
128
+ alsoAt: ["moon/apollo-17-lunar-rover"],
129
+ date: "1972-12-11T19:54Z", lat: 20.1911, lon: 30.7723, agency: AGENCY.NASA,
130
+ country: "US", stand: "apollo-17",
131
+ source: SRC_NASA_MOON, page: `${NSS}1972-096C`,
132
+ },
133
+ {
134
+ id: "moon/luna-21", place: "moon/luna-21", body: "moon", name: { en: "Luna 21", ja: "ルナ21号" },
135
+ date: "1973-01-15T22:35Z", lat: 25.9994, lon: 30.4076, agency: AGENCY.USSR,
136
+ country: "SU", note: "Carried Lunokhod 2.",
137
+ source: SRC_NASA_MOON,
138
+ },
139
+ {
140
+ id: "moon/luna-23", place: "moon/luna-23", body: "moon", name: { en: "Luna 23", ja: "ルナ23号" },
141
+ date: "1974-11-06T05:37Z", lat: 12.6667, lon: 62.1511, agency: AGENCY.USSR,
142
+ country: "SU",
143
+ source: SRC_NASA_MOON,
144
+ },
145
+ {
146
+ id: "moon/luna-24", place: "moon/luna-24", body: "moon", name: { en: "Luna 24", ja: "ルナ24号" },
147
+ date: "1976-08-18T06:36Z", lat: 12.7142, lon: 62.2129, agency: AGENCY.USSR,
148
+ country: "SU",
149
+ source: SRC_NASA_MOON,
150
+ },
151
+ {
152
+ id: "moon/chang-e-3", place: "moon/chang-e-3", body: "moon", name: { en: "Chang'e 3", ja: "嫦娥3号" },
153
+ alsoAt: ["moon/yutu"],
154
+ date: "2013-12-14T13:11Z", lat: 44.1214, lon: -19.5117, agency: AGENCY.CNSA,
155
+ country: "CN",
156
+ source: SRC_NASA_MOON,
157
+ },
158
+ {
159
+ id: "moon/chang-e-4", place: "moon/chang-e-4", body: "moon", name: { en: "Chang'e 4", ja: "嫦娥4号" },
160
+ alsoAt: ["moon/yutu-2"],
161
+ date: "2019-01-03T02:26Z", lat: -45.4561, lon: 177.5885, agency: AGENCY.CNSA,
162
+ country: "CN",
163
+ source: SRC_NASA_MOON,
164
+ },
165
+ {
166
+ id: "moon/chang-e-5", place: "moon/chang-e-5-lander", body: "moon", name: { en: "Chang'e 5", ja: "嫦娥5号" },
167
+ date: "2020-12-01T15:11Z", lat: 43.0576, lon: -51.9161, agency: AGENCY.CNSA,
168
+ country: "CN",
169
+ source: SRC_NASA_MOON,
170
+ },
171
+ {
172
+ id: "moon/chandrayaan-3", place: "moon/chandrayaan-3-vikram", body: "moon", name: { en: "Chandrayaan-3", ja: "チャンドラヤーン3号" },
173
+ alsoAt: ["moon/pragyan"],
174
+ date: "2023-08-23T12:32Z", lat: -69.3741, lon: 32.32, agency: AGENCY.ISRO,
175
+ country: "IN",
176
+ source: SRC_NASA_MOON,
177
+ },
178
+ {
179
+ id: "moon/slim", place: "moon/slim", body: "moon", name: { en: "SLIM", ja: "SLIM" },
180
+ alsoAt: ["moon/lev-1", "moon/lev-2"],
181
+ date: "2024-01-19T15:19Z", lat: -13.316, lon: 25.251, agency: AGENCY.JAXA,
182
+ country: "JP",
183
+ source: SRC_NASA_MOON,
184
+ },
185
+ {
186
+ id: "moon/im-1", place: "moon/im-1-odysseus", body: "moon", name: { en: "IM-1 Odysseus", ja: "IM-1 オデュッセウス" },
187
+ date: "2024-02-22T23:23Z", lat: -80.13, lon: 1.44, agency: AGENCY.IM,
188
+ country: "US",
189
+ source: SRC_NASA_MOON,
190
+ },
191
+ {
192
+ id: "moon/chang-e-6", place: "moon/chang-e-6-lander", body: "moon", name: { en: "Chang'e 6", ja: "嫦娥6号" },
193
+ date: "2024-06-01T22:23Z", lat: -41.6385, lon: -153.9852, agency: AGENCY.CNSA,
194
+ country: "CN",
195
+ source: SRC_NASA_MOON,
196
+ },
197
+ {
198
+ id: "moon/blue-ghost-1", place: "moon/blue-ghost-1", body: "moon", name: { en: "Blue Ghost 1", ja: "ブルーゴースト ミッション1" },
199
+ date: "2025-03-02T08:34Z", lat: 18.562, lon: 61.81, agency: AGENCY.FF,
200
+ country: "US",
201
+ source: SRC_NASA_MOON, page: `${NSS}2025-010A`,
202
+ },
203
+ {
204
+ id: "moon/im-2", place: "moon/im-2-athena", body: "moon", name: { en: "IM-2 Athena", ja: "IM-2 アテナ" },
205
+ date: "2025-03-06T17:28Z", lat: -84.7906, lon: 29.1957, agency: AGENCY.IM,
206
+ country: "US",
207
+ source: SRC_NASA_MOON, page: `${NSS}PRIME-1`,
208
+ },
209
+ {
210
+ id: "mars/mars-3", place: "mars/mars-3-lander", body: "mars", name: { en: "Mars 3", ja: "マルス3号" },
211
+ alsoAt: ["mars/prop-m"],
212
+ date: "1971-12-02T13:47Z", lat: -45.045, lon: -157.977, agency: AGENCY.USSR,
213
+ country: "SU", approximate: true, note: "Soft landed, then fell silent after about 20 seconds.",
214
+ source: SRC_GCAT, checkedAgainst: SRC_MARS24,
215
+ },
216
+ {
217
+ id: "mars/viking-1", place: "mars/viking-1", body: "mars", name: { en: "Viking 1", ja: "バイキング1号" },
218
+ date: "1976-07-20T11:53Z", lat: 22.27, lon: -47.95, agency: AGENCY.NASA,
219
+ country: "US",
220
+ source: { name: "NASA NSSDCA, Viking 1 lander", url: `${NSS}1975-075C` }, checkedAgainst: SRC_MARS24, page: `${NSS}1975-075C`,
221
+ },
222
+ {
223
+ id: "mars/viking-2", place: "mars/viking-2", body: "mars", name: { en: "Viking 2", ja: "バイキング2号" },
224
+ date: "1976-09-03T22:37Z", lat: 47.6673, lon: 134.2809, agency: AGENCY.NASA,
225
+ country: "US",
226
+ source: { name: "NASA NSSDCA, Viking 2 lander", url: `${NSS}1975-083C` }, checkedAgainst: SRC_MARS24, page: `${NSS}1975-083C`,
227
+ },
228
+ {
229
+ id: "mars/mars-pathfinder", place: "mars/mars-pathfinder", body: "mars", name: { en: "Mars Pathfinder", ja: "マーズ・パスファインダー" },
230
+ alsoAt: ["mars/sojourner"],
231
+ date: "1997-07-04T16:56Z", lat: 19.095, lon: -33.253, agency: AGENCY.NASA,
232
+ country: "US",
233
+ source: SRC_ODE, checkedAgainst: SRC_MARS24, page: `${NSS}1996-068A`,
234
+ },
235
+ {
236
+ id: "mars/spirit", place: "mars/spirit", body: "mars", name: { en: "Spirit", ja: "スピリット" },
237
+ alsoAt: ["mars/spirit-s-lander"],
238
+ date: "2004-01-04T04:25Z", lat: -14.5719, lon: 175.4785, agency: AGENCY.NASA,
239
+ country: "US",
240
+ source: SRC_ODE, checkedAgainst: SRC_MARS24, page: `${NSS}2003-027A`,
241
+ },
242
+ {
243
+ id: "mars/opportunity", place: "mars/opportunity", body: "mars", name: { en: "Opportunity", ja: "オポチュニティ" },
244
+ alsoAt: ["mars/opportunity-s-lander"],
245
+ date: "2004-01-25T04:54Z", lat: -1.9483, lon: -5.5258, agency: AGENCY.NASA,
246
+ country: "US",
247
+ source: SRC_ODE, checkedAgainst: SRC_MARS24, page: `${NSS}2003-032A`,
248
+ },
249
+ {
250
+ id: "mars/phoenix", place: "mars/phoenix", body: "mars", name: { en: "Phoenix", ja: "フェニックス" },
251
+ date: "2008-05-25T23:38Z", lat: 67.9859, lon: -125.75, agency: AGENCY.NASA,
252
+ country: "US", note: "The source prints 68.22 N, a planetographic latitude; the latitude here is the planetocentric one.",
253
+ source: SRC_ODE, checkedAgainst: SRC_MARS24, page: `${NSS}2007-034A`,
254
+ },
255
+ {
256
+ id: "mars/curiosity", place: "mars/curiosity", body: "mars", name: { en: "Curiosity", ja: "キュリオシティ" },
257
+ alsoAt: ["mars/curiosity-s-descent-stage"],
258
+ date: "2012-08-06T05:17Z", lat: -4.5895, lon: 137.4417, agency: AGENCY.NASA,
259
+ country: "US",
260
+ source: SRC_GCAT, checkedAgainst: SRC_ODE, page: `${NSS}2011-070A`,
261
+ },
262
+ {
263
+ id: "mars/insight", place: "mars/insight", body: "mars", name: { en: "InSight", ja: "インサイト" },
264
+ date: "2018-11-26T19:44Z", lat: 4.5, lon: 135.62, agency: AGENCY.NASA,
265
+ country: "US",
266
+ source: SRC_MARS24, page: `${NSS}2018-042A`,
267
+ },
268
+ {
269
+ id: "mars/perseverance", place: "mars/perseverance", body: "mars", name: { en: "Perseverance", ja: "パーシビアランス" },
270
+ alsoAt: ["mars/perseverance-s-descent-stage"],
271
+ date: "2021-02-18T20:43Z", lat: 18.4446, lon: 77.4508, agency: AGENCY.NASA,
272
+ country: "US",
273
+ source: SRC_GCAT, checkedAgainst: SRC_MARS24, page: `${NSS}2020-052A`,
274
+ },
275
+ {
276
+ id: "mars/zhurong", place: "mars/zhurong", body: "mars", name: { en: "Zhurong", ja: "祝融号" },
277
+ alsoAt: ["mars/tianwen-1-lander"],
278
+ date: "2021-05-14T23:17Z", lat: 25.066, lon: 109.925, agency: AGENCY.CNSA,
279
+ country: "CN",
280
+ source: SRC_GCAT, checkedAgainst: SRC_MARS24,
281
+ },
282
+ ];
283
+ /**
284
+ * The landing sites of one body, by date.
285
+ *
286
+ * @param body - `moon` or `mars`.
287
+ * @returns Its sites.
288
+ *
289
+ * @example
290
+ * ```ts
291
+ * import { landingSitesOf } from "@johnmorrisdotca/wakusei-planets/landing-sites";
292
+ *
293
+ * console.log(landingSitesOf("mars").map((site) => `${site.name.en} ${site.date.slice(0, 4)}`).join(", "));
294
+ * ```
295
+ */
296
+ export function landingSitesOf(body) {
297
+ return LANDING_SITES.filter((site) => site.body === body);
298
+ }
299
+ /**
300
+ * A landing site by its id (`moon/apollo-11`), by the id of its place in the place tables (`moon/apollo-11-lunar-module`, or its rover's), or by its name in English or Japanese in any case, or `undefined`.
301
+ *
302
+ * @param text - The id, place id or name.
303
+ * @returns The site, or `undefined` when none matches.
304
+ *
305
+ * @example
306
+ * ```ts
307
+ * import { findLandingSite } from "@johnmorrisdotca/wakusei-planets/landing-sites";
308
+ *
309
+ * console.log(findLandingSite("moon/apollo-11-lunar-module")?.name.ja, findLandingSite("zhurong")?.country, findLandingSite("nowhere"));
310
+ * ```
311
+ */
312
+ export function findLandingSite(text) {
313
+ if (typeof text !== "string")
314
+ return undefined;
315
+ const wanted = text.trim().toLowerCase();
316
+ return LANDING_SITES.find((site) => site.id === wanted || site.place === wanted || site.alsoAt?.includes(wanted) === true || site.name.en.toLowerCase() === wanted || site.name.ja === text.trim() || site.id.slice(site.id.indexOf("/") + 1) === wanted);
317
+ }
318
+ /**
319
+ * The code a flag element (`<hata-flag code="...">`, from `@johnmorrisdotca/hata`) takes for a country as the place tables and the landing sites write it: the two letters of ISO 3166-1 in capitals, `SU` for the Soviet Union, and GCAT's `J` for Japan
320
+ * (`JP`). A country with no flag to show (an agency of several countries) or with no code gives `undefined`.
321
+ *
322
+ * @param country - A site's `country`, or a place's.
323
+ * @returns The code, or `undefined`.
324
+ *
325
+ * @example
326
+ * ```ts
327
+ * import { flagCodeOf } from "@johnmorrisdotca/wakusei-planets/landing-sites";
328
+ *
329
+ * console.log(flagCodeOf("J"), flagCodeOf("SU"), flagCodeOf("us"), flagCodeOf("ESA"), flagCodeOf(undefined));
330
+ * ```
331
+ */
332
+ export function flagCodeOf(country) {
333
+ if (country === undefined)
334
+ return undefined;
335
+ const code = country.trim().toUpperCase();
336
+ if (code === "J")
337
+ return "JP";
338
+ return /^[A-Z]{2}$/.test(code) ? code : undefined;
339
+ }
@@ -32,9 +32,9 @@ export declare const RING_VERTEX = "\nvarying vec3 vL;\nvarying vec3 vW;\nvoid m
32
32
  * The body's vertex shader for a perspective camera and a body anywhere in the scene: the normal and the position are in the scene's axes, the position in body radii from the body's centre
33
33
  * (`uScale` is the body's size in scene units), and `vV` points at the camera.
34
34
  */
35
- export declare const VERTEX_WORLD = "\nuniform float uScale;\nvarying vec3 vObj;\nvarying vec3 vN;\nvarying vec3 vW;\nvarying vec3 vV;\nvoid main() {\n vObj = vec3(position.z, position.x, position.y);\n vec4 w = modelMatrix * vec4(position, 1.0);\n vN = normalize(transpose(inverse(mat3(modelMatrix))) * normal);\n vW = mat3(modelMatrix) * position / uScale;\n vV = cameraPosition - w.xyz;\n gl_Position = projectionMatrix * viewMatrix * w;\n}";
35
+ export declare const VERTEX_WORLD = "\n\nuniform vec3 uRoundAxis;\nuniform float uRoundK;\nvec4 roundWorld(vec4 w) {\n if (uRoundK < 1.0) {\n vec3 c = modelMatrix[3].xyz;\n vec3 d = w.xyz - c;\n w.xyz = c + d - (1.0 - uRoundK) * uRoundAxis * dot(d, uRoundAxis);\n }\n return w;\n}\nuniform float uScale;\nvarying vec3 vObj;\nvarying vec3 vN;\nvarying vec3 vW;\nvarying vec3 vV;\nvoid main() {\n vObj = vec3(position.z, position.x, position.y);\n vec4 w = modelMatrix * vec4(position, 1.0);\n vN = normalize(transpose(inverse(mat3(modelMatrix))) * normal);\n vW = mat3(modelMatrix) * position / uScale;\n vV = cameraPosition - w.xyz;\n gl_Position = projectionMatrix * viewMatrix * roundWorld(w);\n}";
36
36
  /** The ring's vertex shader for a perspective camera, with the same frame as `VERTEX_WORLD`. */
37
- export declare const RING_VERTEX_WORLD = "\nuniform float uScale;\nvarying vec3 vL;\nvarying vec3 vW;\nvarying vec3 vV;\nvoid main() {\n vL = position;\n vec4 w = modelMatrix * vec4(position, 1.0);\n vW = mat3(modelMatrix) * position / uScale;\n vV = cameraPosition - w.xyz;\n gl_Position = projectionMatrix * viewMatrix * w;\n}";
37
+ export declare const RING_VERTEX_WORLD = "\n\nuniform vec3 uRoundAxis;\nuniform float uRoundK;\nvec4 roundWorld(vec4 w) {\n if (uRoundK < 1.0) {\n vec3 c = modelMatrix[3].xyz;\n vec3 d = w.xyz - c;\n w.xyz = c + d - (1.0 - uRoundK) * uRoundAxis * dot(d, uRoundAxis);\n }\n return w;\n}\nuniform float uScale;\nvarying vec3 vL;\nvarying vec3 vW;\nvarying vec3 vV;\nvoid main() {\n vL = position;\n vec4 w = modelMatrix * vec4(position, 1.0);\n vW = mat3(modelMatrix) * position / uScale;\n vV = cameraPosition - w.xyz;\n gl_Position = projectionMatrix * viewMatrix * roundWorld(w);\n}";
38
38
  /** The ring's fragment shader for a perspective camera: which side is seen comes from the direction to the camera. */
39
39
  export declare const RING_FRAGMENT_WORLD: string;
40
40
  export declare const GLOW_VERTEX = "\nvarying vec2 vP;\nvoid main() { vP = position.xy; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }";