@johnmorrisdotca/wakusei-planets 0.71.0 → 0.72.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,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.72.0] - 2026-11-20
6
+
7
+ - **The copy-paste snippet names the current package** (MODULES-1719). `VERSION` in `src/version.ts` had stayed at 0.54.0 while releases bumped `package.json` only, so a copied snippet asked for `@0.54.0`. It is 0.71.0, the same as `package.json`, and `test/version.test.ts` fails when the two disagree. The texture address types in `test/api-snapshot.txt` name 0.71.0 as well.
8
+
9
+ - **A distance on Eros, Ryugu, Bennu, Dimorphos, Tempel 1 and 67P** (MODULES-1045). `placeDistanceKm` is the great circle on a volume-equivalent mean radius. `placeDistance` returns `{ km, accuracyKm }`. `accuracyKm` is the shape bound from the published extents, or `null` when none is stated (a sphere in `BODIES`, and 67P). `placeDistance` is on the API snapshot.
10
+
5
11
  ## [0.71.0] - 2026-11-19
6
12
 
7
13
  - **`<wakusei-moon-pages>`: the moon pages as an element** (`./moon-pages/element`). `<wakusei-moon-pages planet="saturn">` is the demo's moon page in one element: the four tabs (Orbits, Map and portrait, Main moons, Every moon), in English and Japanese (`lang`, or the nearest `lang` up the page, followed as it changes), with the plan, the portrait, the cards' bodies and the planet's looks fetched only when their tab first opens. A change of `planet` draws the other planet. It never writes the page's address: the choices are the attributes `tab`, `view`, `reach`, `colour`, `sort` and `order`, a choice made in it is reflected on them and sent as `wakusei-moon-pages-change` (`detail`: the whole `MoonPagesState`), and a slot named `planets` takes a page's own links to the other planets. `texture-base` and `texture-far-base` are handed to the bodies it draws. `MOON_PAGE_TABS` lists the tabs.
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.71.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.72.0/docs/images/lineup-desk.png" width="640"></p>
23
23
 
24
24
  ## Who it is for
25
25
 
@@ -423,7 +423,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
423
423
 
424
424
  ## The portrait builder
425
425
 
426
- <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.71.0/docs/images/portrait-family.png" width="640"></p>
426
+ <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.72.0/docs/images/portrait-family.png" width="640"></p>
427
427
 
428
428
  [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.
429
429
 
@@ -580,7 +580,7 @@ BODIES.pluto.kind; // "dwarf-planet"
580
580
 
581
581
  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:
582
582
 
583
- > Morris, J. (2026). *Wakusei Planets* (version 0.71.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
583
+ > Morris, J. (2026). *Wakusei Planets* (version 0.72.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
584
584
 
585
585
  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).
586
586
 
@@ -0,0 +1,57 @@
1
+ /** One irregular body a distance can be measured on: a volume-equivalent mean radius, and the published full extents when the source gives them. */
2
+ export interface PlaceMeanRadius {
3
+ /** The radius of the sphere with the body's measured volume, in kilometres. */
4
+ radiusKm: number;
5
+ /** The published full extents in kilometres, longest first. Absent when the source gives none. */
6
+ axesKm?: readonly [number, number] | readonly [number, number, number];
7
+ /** Where the radius and the extents were read. */
8
+ source: string;
9
+ /** A fact that is not a shape bound. */
10
+ note?: string;
11
+ }
12
+ /**
13
+ * The six place bodies `BODIES` has no radius for. Read 2026-11-19, one request a second, from JPL's Small-Body Database except Dimorphos, which is not in it.
14
+ *
15
+ * Eros: diameter 16.84 ± 0.06 km (Yeomans et al. 2000), extents 34.4 × 11.2 × 11.2 km (Veverka et al. 2000).
16
+ * Ryugu: diameter 0.896 ± 0.004 km, extents 1.004 × 0.876 km, two axes (Watanabe et al. 2019).
17
+ * Bennu: diameter 0.48444 ± 0.00030 km, extents 0.5047 × 0.4918 × 0.4567 km (Daly et al. 2020).
18
+ * Dimorphos: volume-equivalent diameter 151 ± 5 m, extents 177 ± 2 × 174 ± 4 × 116 ± 2 m (Daly et al., Nature 2023). The volume is the shape model's, not an ellipsoid of those extents.
19
+ * Tempel 1: diameter 6.0 ± 0.2 km, extents 7.6 × 4.9 km, two axes, preliminary (A'Hearn et al. 2005).
20
+ * 67P: diameter 3.4 ± 0.1 km (Sierks et al. 2015). No extents.
21
+ */
22
+ export declare const PLACE_MEAN_RADII: {
23
+ readonly eros: {
24
+ readonly radiusKm: 8.42;
25
+ readonly axesKm: readonly [34.4, 11.2, 11.2];
26
+ readonly source: "JPL SBDB: Yeomans et al. 2000; Veverka et al. 2000";
27
+ };
28
+ readonly ryugu: {
29
+ readonly radiusKm: 0.448;
30
+ readonly axesKm: readonly [1.004, 0.876];
31
+ readonly source: "JPL SBDB, Watanabe et al. 2019";
32
+ readonly note: "Two extents only.";
33
+ };
34
+ readonly bennu: {
35
+ readonly radiusKm: 0.24222;
36
+ readonly axesKm: readonly [0.5047, 0.4918, 0.4567];
37
+ readonly source: "JPL SBDB, Daly et al. 2020";
38
+ };
39
+ readonly dimorphos: {
40
+ readonly radiusKm: 0.0755;
41
+ readonly axesKm: readonly [0.177, 0.174, 0.116];
42
+ readonly source: "Daly et al., Nature 2023";
43
+ };
44
+ readonly "tempel-1": {
45
+ readonly radiusKm: 3;
46
+ readonly axesKm: readonly [7.6, 4.9];
47
+ readonly source: "JPL SBDB, A'Hearn et al. 2005";
48
+ readonly note: "The extents are preliminary, and only two.";
49
+ };
50
+ readonly "67p": {
51
+ readonly radiusKm: 1.7;
52
+ readonly source: "JPL SBDB, Sierks et al. 2015";
53
+ readonly note: "The diameter is 3.4 ± 0.1 km, so the mean radius is uncertain by 0.05 km. The nucleus is two lobes, and the source gives no extents.";
54
+ };
55
+ };
56
+ /** Half the spread of the semi-axes, in kilometres. The extents are full lengths. */
57
+ export declare const shapeHalfRangeKm: (axesKm: readonly number[]) => number;
@@ -0,0 +1,24 @@
1
+ // Volume-equivalent mean radii for the place bodies that are not in BODIES. The extents are the published full lengths, two when the source gives two. accuracyKm uses only those extents.
2
+ /**
3
+ * The six place bodies `BODIES` has no radius for. Read 2026-11-19, one request a second, from JPL's Small-Body Database except Dimorphos, which is not in it.
4
+ *
5
+ * Eros: diameter 16.84 ± 0.06 km (Yeomans et al. 2000), extents 34.4 × 11.2 × 11.2 km (Veverka et al. 2000).
6
+ * Ryugu: diameter 0.896 ± 0.004 km, extents 1.004 × 0.876 km, two axes (Watanabe et al. 2019).
7
+ * Bennu: diameter 0.48444 ± 0.00030 km, extents 0.5047 × 0.4918 × 0.4567 km (Daly et al. 2020).
8
+ * Dimorphos: volume-equivalent diameter 151 ± 5 m, extents 177 ± 2 × 174 ± 4 × 116 ± 2 m (Daly et al., Nature 2023). The volume is the shape model's, not an ellipsoid of those extents.
9
+ * Tempel 1: diameter 6.0 ± 0.2 km, extents 7.6 × 4.9 km, two axes, preliminary (A'Hearn et al. 2005).
10
+ * 67P: diameter 3.4 ± 0.1 km (Sierks et al. 2015). No extents.
11
+ */
12
+ export const PLACE_MEAN_RADII = {
13
+ eros: { radiusKm: 8.42, axesKm: [34.4, 11.2, 11.2], source: "JPL SBDB: Yeomans et al. 2000; Veverka et al. 2000" },
14
+ ryugu: { radiusKm: 0.448, axesKm: [1.004, 0.876], source: "JPL SBDB, Watanabe et al. 2019", note: "Two extents only." },
15
+ bennu: { radiusKm: 0.24222, axesKm: [0.5047, 0.4918, 0.4567], source: "JPL SBDB, Daly et al. 2020" },
16
+ dimorphos: { radiusKm: 0.0755, axesKm: [0.177, 0.174, 0.116], source: "Daly et al., Nature 2023" },
17
+ "tempel-1": { radiusKm: 3, axesKm: [7.6, 4.9], source: "JPL SBDB, A'Hearn et al. 2005", note: "The extents are preliminary, and only two." },
18
+ "67p": { radiusKm: 1.7, source: "JPL SBDB, Sierks et al. 2015", note: "The diameter is 3.4 ± 0.1 km, so the mean radius is uncertain by 0.05 km. The nucleus is two lobes, and the source gives no extents." },
19
+ };
20
+ /** Half the spread of the semi-axes, in kilometres. The extents are full lengths. */
21
+ export const shapeHalfRangeKm = (axesKm) => {
22
+ const semis = axesKm.map((km) => km / 2);
23
+ return (Math.max(...semis) - Math.min(...semis)) / 2;
24
+ };
package/dist/places.d.ts CHANGED
@@ -240,9 +240,39 @@ export declare function nearestPlace(places: readonly Place[], lat: number, lon:
240
240
  degrees: number;
241
241
  } | undefined;
242
242
  /**
243
- * The distance over the surface between two places on a body, in kilometres: the great circle on a sphere of the body's equatorial radius from `BODIES` (1737.4 km for the Moon, 3396.19 km for Mars; flattening is not allowed for, which is 0.6 per cent on Mars and nothing on the Moon). A body the package has no radius for (Eros, Ryugu, Bennu, Dimorphos and the two comets: their shapes are not spheres) is a `RangeError`.
243
+ * The distance over the surface between two points, and the shape bound on it.
244
244
  *
245
- * @param body - A body of `PLACE_BODIES` that has a radius in `BODIES`.
245
+ * `km` is the great circle. On a body in `BODIES` the sphere is the equatorial radius (1737.4 km for the Moon, 3396.19 km for Mars; flattening is not allowed for, which is 0.6 per cent on Mars and nothing on the Moon). On Eros, Ryugu, Bennu, Dimorphos, Tempel 1 and 67P the sphere is the volume-equivalent mean radius.
246
+ *
247
+ * `accuracyKm` is the shape bound: the same angle times half the spread of the published semi-axes. It is `null` when no shape bound is stated, which is a sphere in `BODIES`, and 67P (the source gives no extents; the 0.05 km uncertainty of its mean radius is a note, not this bound).
248
+ *
249
+ * @param body - A body of `PLACE_BODIES`.
250
+ * @param a - A place, or a latitude and east longitude.
251
+ * @param b - The other.
252
+ * @returns The kilometres, and the shape bound in kilometres, or `null` when none is stated.
253
+ *
254
+ * @example
255
+ * ```ts
256
+ * import { placeDistance } from "@johnmorrisdotca/wakusei-planets/places";
257
+ *
258
+ * const d = placeDistance("bennu", { lat: 0, lon: 0 }, { lat: 0, lon: 90 });
259
+ * console.log(d.km.toFixed(3), d.accuracyKm?.toFixed(3) ?? "not stated");
260
+ * ```
261
+ */
262
+ export declare function placeDistance(body: PlaceBody, a: Place | {
263
+ lat: number;
264
+ lon: number;
265
+ }, b: Place | {
266
+ lat: number;
267
+ lon: number;
268
+ }): {
269
+ km: number;
270
+ accuracyKm: number | null;
271
+ };
272
+ /**
273
+ * The distance over the surface between two places on a body, in kilometres: `placeDistance(body, a, b).km`.
274
+ *
275
+ * @param body - A body of `PLACE_BODIES`.
246
276
  * @param a - A place, or a latitude and east longitude.
247
277
  * @param b - The other.
248
278
  * @returns Kilometres.
package/dist/places.js CHANGED
@@ -3,6 +3,7 @@
3
3
  // themselves are the entry points `/places/<body>`, so a page pays only for the body it shows.
4
4
  import { apparent } from "./ephemeris.js";
5
5
  import { BODIES } from "./facts.js";
6
+ import { PLACE_MEAN_RADII, shapeHalfRangeKm } from "./place-radii.js";
6
7
  import { cross, dot } from "./vec.js";
7
8
  import { moment } from "./when.js";
8
9
  export { layerOf, MARK_RULES, PLACE_LAYERS, marksToShow, placeMarks, placeRank, pointUnder, readPlaceLayers, readSurfaceNames, spotView, surfacePoint, turnToPlace } from "./place-marks.js";
@@ -211,9 +212,42 @@ export function nearestPlace(places, lat, lon, ...kinds) {
211
212
  return best;
212
213
  }
213
214
  /**
214
- * The distance over the surface between two places on a body, in kilometres: the great circle on a sphere of the body's equatorial radius from `BODIES` (1737.4 km for the Moon, 3396.19 km for Mars; flattening is not allowed for, which is 0.6 per cent on Mars and nothing on the Moon). A body the package has no radius for (Eros, Ryugu, Bennu, Dimorphos and the two comets: their shapes are not spheres) is a `RangeError`.
215
+ * The distance over the surface between two points, and the shape bound on it.
215
216
  *
216
- * @param body - A body of `PLACE_BODIES` that has a radius in `BODIES`.
217
+ * `km` is the great circle. On a body in `BODIES` the sphere is the equatorial radius (1737.4 km for the Moon, 3396.19 km for Mars; flattening is not allowed for, which is 0.6 per cent on Mars and nothing on the Moon). On Eros, Ryugu, Bennu, Dimorphos, Tempel 1 and 67P the sphere is the volume-equivalent mean radius.
218
+ *
219
+ * `accuracyKm` is the shape bound: the same angle times half the spread of the published semi-axes. It is `null` when no shape bound is stated, which is a sphere in `BODIES`, and 67P (the source gives no extents; the 0.05 km uncertainty of its mean radius is a note, not this bound).
220
+ *
221
+ * @param body - A body of `PLACE_BODIES`.
222
+ * @param a - A place, or a latitude and east longitude.
223
+ * @param b - The other.
224
+ * @returns The kilometres, and the shape bound in kilometres, or `null` when none is stated.
225
+ *
226
+ * @example
227
+ * ```ts
228
+ * import { placeDistance } from "@johnmorrisdotca/wakusei-planets/places";
229
+ *
230
+ * const d = placeDistance("bennu", { lat: 0, lon: 0 }, { lat: 0, lon: 90 });
231
+ * console.log(d.km.toFixed(3), d.accuracyKm?.toFixed(3) ?? "not stated");
232
+ * ```
233
+ */
234
+ export function placeDistance(body, a, b) {
235
+ if (!PLACE_BODIES.includes(body))
236
+ throw new RangeError(`places are held for ${PLACE_BODIES.join(", ")}, not "${String(body)}"`);
237
+ const radians = angleBetween(a.lat, a.lon, b.lat, b.lon) * RAD;
238
+ const facts = BODIES[body];
239
+ if (facts !== undefined)
240
+ return { km: radians * facts.radiusKm, accuracyKm: null };
241
+ const mean = PLACE_MEAN_RADII[body];
242
+ if (mean === undefined)
243
+ throw new RangeError(`the package has no radius for ${body}`);
244
+ const accuracyKm = "axesKm" in mean ? radians * shapeHalfRangeKm(mean.axesKm) : null;
245
+ return { km: radians * mean.radiusKm, accuracyKm };
246
+ }
247
+ /**
248
+ * The distance over the surface between two places on a body, in kilometres: `placeDistance(body, a, b).km`.
249
+ *
250
+ * @param body - A body of `PLACE_BODIES`.
217
251
  * @param a - A place, or a latitude and east longitude.
218
252
  * @param b - The other.
219
253
  * @returns Kilometres.
@@ -229,12 +263,7 @@ export function nearestPlace(places, lat, lon, ...kinds) {
229
263
  * ```
230
264
  */
231
265
  export function placeDistanceKm(body, a, b) {
232
- if (!PLACE_BODIES.includes(body))
233
- throw new RangeError(`places are held for ${PLACE_BODIES.join(", ")}, not "${String(body)}"`);
234
- const facts = BODIES[body];
235
- if (facts === undefined)
236
- throw new RangeError(`the package has no radius for ${body}, an irregular body: no distance over a sphere is given`);
237
- return (angleBetween(a.lat, a.lon, b.lat, b.lon) * RAD * facts.radiusKm);
266
+ return placeDistance(body, a, b).km;
238
267
  }
239
268
  /**
240
269
  * The great-circle angle between two points on a sphere, in degrees.
@@ -11,7 +11,7 @@ import { type BodyMapSource } from "../door/map.ts";
11
11
  * console.log(TEXTURE_BASE);
12
12
  * ```
13
13
  */
14
- export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.54.0/dist/textures/";
14
+ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.72.0/dist/textures/";
15
15
  /**
16
16
  * Where the sharpest surface pictures are: the files of this exact version in the repository, on jsDelivr's GitHub address. The npm package holds only the two smaller widths, so a page that
17
17
  * never zooms in never fetches them. Set `texture-far-base` on an element to serve them yourself.
@@ -23,7 +23,7 @@ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdot
23
23
  * console.log(TEXTURE_FAR_BASE);
24
24
  * ```
25
25
  */
26
- export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.54.0/textures/";
26
+ export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.72.0/textures/";
27
27
  /**
28
28
  * Where the finer map tiles are by default: the demo site's `tiles/` folder (GitHub Pages sends `access-control-allow-origin: *`). The tiles are made by `scripts/make-body-tiles.py` and are in no package and no repository:
29
29
  * a page that serves its own gives the folder in the `tiles` attribute, and `tiles="off"` turns them off. A page that sets `texture-base` (it serves its own pictures) has none unless it says where they are.
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.54.0";
1
+ export declare const VERSION = "0.72.0";
package/dist/version.js CHANGED
@@ -1 +1,2 @@
1
- export const VERSION = "0.54.0";
1
+ // The published package version. Snippets and texture addresses name it. test/version.test.ts keeps it equal to package.json.
2
+ export const VERSION = "0.72.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmorrisdotca/wakusei-planets",
3
- "version": "0.71.0",
3
+ "version": "0.72.0",
4
4
  "description": "Wakusei Planets 惑星 — The Sun, planets and moons for the web: each as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, axial tilt and rotation as data, and positions of the moons for any date and time. SVG for the lines, three.js (optional) for the rest.",
5
5
  "keywords": [
6
6
  "planets",