@johnmorrisdotca/wakusei-planets 0.32.0 → 0.33.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 +12 -0
- package/NOTICE.md +11 -1
- package/README.md +6 -5
- package/dist/bodies/all.d.ts +1 -0
- package/dist/bodies/all.js +1 -0
- package/dist/bodies/minor.d.ts +1 -0
- package/dist/bodies/minor.js +16 -0
- package/dist/data/minor.d.ts +3 -0
- package/dist/data/minor.js +7 -0
- package/dist/data/tables.d.ts +4 -2
- package/dist/data/tables.js +1 -1
- package/dist/element.js +11 -2
- package/dist/embed.d.ts +1 -1
- package/dist/embed.js +3 -3
- package/dist/ephemeris.d.ts +7 -7
- package/dist/ephemeris.js +36 -13
- package/dist/facts.d.ts +28 -4
- package/dist/facts.js +24 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/nearest.js +6 -4
- package/dist/scene/textures.d.ts +2 -2
- package/dist/space/arrows.d.ts +29 -3
- package/dist/space/arrows.js +38 -6
- package/dist/space/bodies.d.ts +6 -6
- package/dist/space/bodies.js +6 -6
- package/dist/space/element.d.ts +4 -0
- package/dist/space/element.js +19 -4
- package/dist/space/frame.d.ts +28 -3
- package/dist/space/frame.js +40 -4
- package/dist/space/index.d.ts +2 -2
- package/dist/space/index.js +2 -2
- package/dist/space/scale.d.ts +4 -4
- package/dist/space/scale.js +8 -2
- package/dist/space/scene.d.ts +4 -2
- package/dist/space/scene.js +15 -14
- package/dist/stops.d.ts +1 -1
- package/dist/stops.js +4 -1
- package/dist/tables/all.d.ts +1 -0
- package/dist/tables/all.js +1 -0
- package/dist/tables/lazy.d.ts +5 -0
- package/dist/tables/lazy.js +12 -0
- package/dist/tables/minor.d.ts +1 -0
- package/dist/tables/minor.js +317 -0
- package/dist/textures/vesta-1024.webp +0 -0
- package/dist/textures/vesta-512.webp +0 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.33.0] - 2026-11-11
|
|
6
|
+
|
|
7
|
+
- **CI installs Playwright's browsers in bounded, cached steps** (KAZOKU-UI-100). A slow package mirror held `playwright install --with-deps` for the whole job limit on 2026-11-09 and 2026-11-10, so no test ran and the failure read as a test failure. `.github/actions/playwright` (the family's, kazoku-ui's copy is canonical) caches the browsers by Playwright's version, then installs the system libraries in a step of their own: two tries, each cut off after 7 minutes, and a failure that says it is the runner's package mirror and that nothing was run. Free: GitHub-hosted Linux runners and the cache.
|
|
8
|
+
- **`pnpm docs:check` reads a guide's front matter as strict YAML** (KAZOKU-UI-102). A title or description holding a colon and a space without quotes passed the old line reader while GitHub showed "Error in user YAML" above the page. `scripts/docs-site.mjs` (the family's, version `2026-11-10-strict-front-matter`) now fails with the file, the line and a plain sentence on an unquoted colon, an unquoted " #", a value that starts with a YAML character (`[ { & * ! | > % @` or a backtick), a tab, an indented continuation, a key twice and an unclosed quote.
|
|
9
|
+
- **Two arrows on each orbit, with a setting for the count** (MODULES-909, John: "too many arrows ... we probably only need 2 or max 4"). `ARROWS_PER_ORBIT` is now 2 (it was 6) and an orbit carries at most 4 (`MAX_ARROWS_PER_ORBIT`). `<wakusei-space>` has the attribute and property `arrows` for the count: 2 by default, 0 for none, anything else a whole number from 0 to 4 (`arrowCount` reads it); `arrowSites(line, count)` takes the same. The Moon's line has them too.
|
|
10
|
+
- **The far orbits are smooth curves** (MODULES-909). Sedna's, Eris's, Gonggong's and Haumea's lines (and Halley's, Pholus's and Chiron's) are cut at equal steps of the eccentric anomaly, not of time: cut in time, 96 points left the sharp turn near the Sun as one long straight stroke with corners. And `kepler` solved long orbits (e from 0.8, Sedna's 0.86) wrongly for a negative mean anomaly, which scattered half of Sedna's line far from the ellipse: it starts from a place on the right side of the orbit now.
|
|
11
|
+
|
|
12
|
+
- **Vesta, Pallas, Chiron, Pholus and Halley's comet are bodies** (MODULES-553). `MINOR_IDS` (and the type `MinorId`) name them and `BodyFacts.kind` has three new values, `asteroid`, `centaur` and `comet`; `BODY_IDS` is 52 long (it was 47). Each has its size, its shape where one is published (Vesta 569 x 554 x 453 km, Pallas 568 x 532 x 448, Halley 14.9 x 8.2), pole, rotation, colour, a line drawing and a shaded look, and a name in Japanese (ベスタ, パラス, ケイロン, ポルス, ハレー彗星); the numbers are JPL's Small-Body Database's and NOTICE.md gives each source and says which poles are estimated (Chiron's, Pholus's and Halley's are along the orbit's pole; Halley is drawn still). Vesta's painted look is Dawn's own photomap (public domain, 2.05 MB of pictures now ship, the budget is 2.1). The other four have never been imaged beyond a point of light (Halley's nucleus was photographed by Giotto, whose pictures' terms keep them out), so they are drawn from their numbers.
|
|
13
|
+
- **Their positions are tables fitted to JPL Horizons, within 1 arc-second** (MODULES-553). `@johnmorrisdotca/wakusei-planets/tables/minor` (new; also in `/tables`) holds Vesta and Pallas for 1900 to 2100 and Chiron, Pholus and Halley for 1800 to 2200, made by `scripts/make-minor-data.py`, about 48 kB gzipped. A comet moves fast near the Sun, so a table can now have segments of unequal length: `FittedTable.edges` says where each starts (Halley's are 43 days long at its perihelion and 16 years at its aphelion). Measured on 12 dates (`test/data/horizons-minor.json`, one Horizons request a date) the worst is 0.53 arc-seconds. `heliocentric`, `heliocentricModel` and `meanSunAu` take a `MinorId`; outside the table's years a body is a plain ellipse from Horizons' osculating elements (Halley's, from 1968, are 31 degrees off by 2026: `<wakusei-space>` loads the table itself, and `<wakusei-body>` fetches it when a minor body has a date). `nearest`, `within`, `closestApproach` and `conjunctions` include them, with `kind: "asteroid" | "centaur" | "comet"`, and `JOURNEY_STOPS` has a row for each (Vesta's and Pallas's GM from the Small-Body Database).
|
|
14
|
+
- **The space view offers them** (MODULES-553). `frameAt` has `minors` (`SPACE_MINORS`, `SpaceMinor`), `SPACE_BODIES` is the twenty-four bodies it places, the hopper goes Mars, Vesta, Ceres, Pallas, Jupiter and Saturn, Chiron, Halley, Uranus, Pholus, Neptune (by the size of their orbits), `findBody` reads their names in either language, and `bodyKindOf` says what they are. A small body has an orbit line (`planetOrbit` cuts a long ellipse at equal steps of the eccentric anomaly, so Halley's turn round the Sun is smooth), a name and a ring, and is drawn once it is half a pixel across (at true scale none of them is; the compressed scale gives each 0.2 Earth radii). The demo's picker has a "Small bodies" kind, and the body page and the embed builder a "Small bodies" row.
|
|
15
|
+
- **The test of the Horizons fixture's dates.** Horizons gives every time of a list the correction between terrestrial and universal time of the *first* date of the list, so `test/data/horizons.json` (a list from 1800 or 1900) puts a date in 2026 about a minute off. That is invisible for the slow bodies it holds and 0.6 arc-seconds for Vesta, so the minor bodies' reference is a file of its own with one request a date (`python3 -I scripts/fetch-horizons-reference.py minors`).
|
|
16
|
+
|
|
5
17
|
## [0.32.0] - 2026-11-10
|
|
6
18
|
|
|
7
19
|
- **The data door: `@johnmorrisdotca/wakusei-planets/door`** (MODULES-831, step 2; the shapes are kazoku-ui's `templates/data-door.ts`, copied unchanged to `src/data-door.ts`). One way to hand the package outside data and to say whose data is on the screen. `BodyMapSource` is a `TileSource` for the colour or the height of a body's map (the family's `MapPlace` and `ImageTile`; the keys end in `level/column/row` on the package's 512 pixel pyramid, and `mapKeys` names them), and `tilesSource(base)` is the package's own folder of tiles as a source, which is what the `tiles` attribute means; the attribute stays. `SmallBody` (name, `a`, `e`, `i`, `node`, `peri`, `M0`, `epoch`, `H`) and `SmallBodySource` are a record source of small bodies, read once, at most 200,000, with the records that cannot be drawn left out and counted; `smallBodyAt` says where one is on a date. `<wakusei-body>` and `<wakusei-space>` take `sources`, `addSource` (checked at once, returns its `remove()`), `removeSource`, `enableSource` and `data="own"`, and have `credits()` and the event `wakusei-creditschange`; `creditLine` writes the credit line with the licence beside each source, "non-commercial" or "share-alike" included, in English and Japanese. Off aborts a source's loads, frees its tiles and records, and drops its credit. The tiles of every body in a view share one 48 MB budget (`TILE_BUDGET_BYTES`), six loads at a time per source, and nothing is sent at rest. `OWN_SOURCES` (the pictures, the tiles and the orbit series) and `ownCredit` write the package's own credits from `NOTICE.md`, and a test holds that none is non-commercial or share-alike. A window of tiles that could not be made is no longer tried again after 30 seconds: it is tried again when the view changes. Every attribute and function is as it was; `createPainter` takes an optional `book`.
|
package/NOTICE.md
CHANGED
|
@@ -31,6 +31,15 @@ Ceres, Orcus, Haumea, Quaoar, Makemake, Gonggong, Eris and Sedna (Pluto is with
|
|
|
31
31
|
|
|
32
32
|
The tests compare the Galilean moons and four planets with astronomy-engine (MIT, https://github.com/cosinekitty/astronomy), a development dependency that is never shipped.
|
|
33
33
|
|
|
34
|
+
## The minor bodies
|
|
35
|
+
|
|
36
|
+
Vesta, Pallas, Chiron, Pholus and Halley's comet (`MINOR_IDS`). Values read on 2026-11-10 from JPL's Small-Body Database (https://ssd-api.jpl.nasa.gov/sbdb.api) and Horizons (https://ssd.jpl.nasa.gov/api/horizons.api); both are NASA/JPL, not subject to copyright in the United States (credit: NASA/JPL-Caltech).
|
|
37
|
+
|
|
38
|
+
- **Where they are**: JPL Horizons, fitted as Chebyshev tables from the solar system's barycentre (`scripts/make-minor-data.py`, `src/tables/minor.ts`) like the dwarf planets, with the Sun's swing about the barycentre worked out from the planets' masses: Vesta and Pallas 1900 to 2100, Chiron, Pholus and Halley 1800 to 2200, each within 1 arc-second of Horizons on the samples left out of each fit (0.6 at the worst on the 12 dates of `test/data/horizons.json`, one request a date). Halley's segments are of unequal length (43 days near the Sun, 16 years far from it). Halley is Horizons' record 90000030, the solution of the 1986 apparition (observations 1835 to 1994): a comet's orbit past that arc is a prediction, and its non-gravitational forces are in the solution. Outside the tables' years each runs on Horizons' osculating elements (Vesta 2020-01-01, Pallas 2017-04-27, Chiron 2017-06-12, Pholus 2010-06-22, Halley 1968-01-20; `src/data/minor.ts`) as a plain ellipse: a few degrees off a century from the epoch, and Pallas, a planet's pull on an orbit tipped 35 degrees, most.
|
|
39
|
+
- **Sizes and spin**, as the Small-Body Database gives them: Vesta, 569.24 x 554.48 x 452.66 km, pole RA 309.0611 and Dec 42.2324, rotation 5.3421276 h, GM 17.2882844 km^3/s^2, Park et al. 2025, Nature Astronomy (DOI 10.1038/s41550-025-02533-7); its prime meridian at J2000 (285.39 degrees, the Claudia system of Dawn's maps) is the IAU's, Archinal et al. 2018, Celestial Mechanics and Dynamical Astronomy 130:22. Pallas, 568 x 532 x 448 km, Marsset et al. 2020, Nature Astronomy 4:569; pole from Carry et al. 2010, Icarus 205:460 (ecliptic longitude 30, latitude -16, which is RA 33, Dec -3), rotation 7.8132214 h; GM 13.63 km^3/s^2, Vernazza et al. 2021, A&A 654:A56. Chiron, a diameter of 166 km (an occultation, listed by the Small-Body Database as "Dunham occultation list: Duham 1998"), rotation 5.918 h, Warner et al. 2009 (the Lightcurve Database). Pholus, a diameter of 190 km, Earth, Moon, and Planets 89:117 (2002), rotation 9.98 h, Lightcurve Database. Halley's nucleus, 14.9 x 8.2 km, Keller et al. 1987, A&A 187:807 (the Giotto flyby), radius 5.5 km (the Small-Body Database). Colours from the published albedos and spectral types (Vesta, V-type, albedo 0.42; Pallas, B-type, 0.155; Chiron, Cb, 0.15; Pholus, very red, 0.044; Halley, 0.04).
|
|
40
|
+
- **Vesta's picture** is Dawn's own: the global photomap on Wikimedia Commons (public domain; table above). The other four have never been imaged as more than a few pixels, except Halley, whose nucleus Giotto photographed in 1986 (ESA; those pictures' terms keep them out of this package): their shaded looks and line drawings are generic craters on the numbers' shape, which this paragraph says.
|
|
41
|
+
- **Estimated, not measured** (the pictures say so only here): Chiron's and Pholus's poles are not measured, so each is drawn with its spin axis along its orbit's pole (RA 258.793, Dec 72.317 for Chiron; RA 334.495, Dec 66.246 for Pholus). Halley's nucleus tumbles (about 2.2 days, a period this package does not model): it is drawn still, its axis along its orbit's pole. Vesta's and Pallas's features on the line look (Vesta's Rheasilvia basin at the south pole, and two bands for its equatorial troughs) are Dawn's; the craters are generic.
|
|
42
|
+
|
|
34
43
|
## The spacecraft
|
|
35
44
|
|
|
36
45
|
Voyager 1 and 2, New Horizons, Pioneer 10 and 11, Cassini, Galileo, Juno, Parker Solar Probe and the James Webb Space Telescope. Values read on 2026-11-08. NASA content is not subject to copyright in the United States; credit: NASA/JPL-Caltech. This package is not endorsed by NASA and uses none of its insignia.
|
|
@@ -93,6 +102,7 @@ Venus, Saturn, Neptune and the Sun were replaced from Solar System Scope's equir
|
|
|
93
102
|
| `enceladus-*.webp` | Enceladus | [Enceladus Color Map.jpg](https://commons.wikimedia.org/wiki/File:Enceladus_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18435), turned half way round the same way as Rhea's (the source does not say where it is centred; the fractured trailing terrain is put at 90 degrees east); the colours are false-colour (the blue of the tiger stripes is ultraviolet) and are turned most of the way to grey |
|
|
94
103
|
| `mimas-*.webp` | Mimas | [Map of Mimas 2010-02 PIA12780.jpg](https://commons.wikimedia.org/wiki/File:Map_of_Mimas_2010-02_PIA12780.jpg) | Public domain | NASA/JPL/Space Science Institute | Cassini ISS map of February 2010 (PIA12780), cropped inside its frame and labels; Herschel is at 110 degrees west as its own scale says |
|
|
95
104
|
| `ceres-*.webp` | Ceres | [PIA20354-Ceres-DwarfPlanet-MercatorMap-HAMO-20160322-0DegreeLongitude.jpg](https://commons.wikimedia.org/wiki/File:PIA20354-Ceres-DwarfPlanet-MercatorMap-HAMO-20160322-0DegreeLongitude.jpg) | Public domain | NASA/JPL-Caltech/UCLA/MPS/DLR/IDA | Dawn's colourised global map of Ceres (PIA20354, 140 m a pixel), longitude 0 in the middle as the file says (Occator's bright spots fall at 239 degrees east); the green and yellow high latitudes, where Dawn's colour coverage is incomplete (the map says so), are made the surface's own grey keeping their detail, and the last rows with no data repeat the nearest real ones; the colour is turned most of the way to grey |
|
|
105
|
+
| `vesta-*.webp` | Vesta | [Vesta map for GeoHack.png](https://commons.wikimedia.org/wiki/File:Vesta_map_for_GeoHack.png) | Public domain | NASA/JPL-Caltech/UCLA/MPS/DLR/IDA (as the file page gives it; hosted by the USGS Astrogeology Science Center's Gazetteer of Planetary Nomenclature) | Dawn Framing Camera global photomap of Vesta (grey, 3561 x 1781, north up), whose left edge is 330 degrees east (the file says so), turned a twelfth of the way round so longitude 0 is in the middle; the grey is given a faint warmth. Rheasilvia, the great basin at the south pole, shows at the bottom |
|
|
96
106
|
| `tethys-*.webp` | Tethys | [Tethys Color Map.jpg](https://commons.wikimedia.org/wiki/File:Tethys_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18439, Paul Schenk), turned half way round so longitude 0 is in the middle (the source does not say where it is centred; Odysseus, at 129 degrees west, falls at 131 degrees west and the dark trailing side at 90 degrees east); the colours are enhanced (ultraviolet to infrared) and are turned about half way to grey |
|
|
97
107
|
| `dione-*.webp` | Dione | [Dione Color Map.jpg](https://commons.wikimedia.org/wiki/File:Dione_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18434), turned half way round the same way as Tethys's (the source does not say where it is centred; the dark trailing side with its wispy fractures is put at 90 degrees east); the colours are enhanced and are turned about half way to grey |
|
|
98
108
|
| `iapetus-*.webp` | Iapetus | [Iapetus Color Map.jpg](https://commons.wikimedia.org/wiki/File:Iapetus_Color_Map.jpg) | Public domain | NASA/JPL-Caltech/Space Science Institute/Lunar and Planetary Institute | Cassini global colour map (PIA18436), turned half way round the same way (the source does not say where it is centred; the dark leading side, Cassini Regio, is put at 270 degrees east, 90 degrees west); the colours are enhanced and are turned a third of the way to grey |
|
|
@@ -100,7 +110,7 @@ Venus, Saturn, Neptune and the Sun were replaced from Solar System Scope's equir
|
|
|
100
110
|
| `charon-*.webp` | Charon | [Charon map iau1803c.jpg](https://commons.wikimedia.org/wiki/File:Charon_map_iau1803c.jpg) | Public domain | NASA/Johns Hopkins University Applied Physics Laboratory/Southwest Research Institute (via the IAU) | New Horizons global map of Charon (iau1803c, no labels or grid), as it is, with longitude 0 in the middle (the source does not say; the sharp hemisphere New Horizons saw best is the one that faces Pluto, which is longitude 0); the south, in the polar night New Horizons never saw, is continued from the last real rows and fades to the mean grey |
|
|
101
111
|
| `saturn-ring-2048.webp` | Saturn's rings | [Saturn's rings in visible light and radio.jpg](https://commons.wikimedia.org/wiki/File:Saturn's_rings_in_visible_light_and_radio.jpg) | Public domain | NASA / JPL / Space Science Institute | Cassini's natural-colour mosaic of the lit rings (PIA07874, from PIA06175), read along one radius into a strip of 2048 colours and opacities from 74,794 to 137,035 km. The radii are fitted to five edges the picture shows (the B ring's inner edge, the two edges of the Cassini Division, the Encke gap and the A ring's outer edge), each within 300 km. The opacity is taken from the brightness, and the colour balance is moved to match the Saturn portrait above; the F ring and the D ring are not in the picture |
|
|
102
112
|
|
|
103
|
-
The package does not ship the 2048 pixel widths: `TEXTURE_FAR_BASE` fetches them from this repository by jsDelivr's GitHub address when a view is zoomed in. The 512 and 1024 pixel widths of every picture, and the ring strip, are
|
|
113
|
+
The package does not ship the 2048 pixel widths: `TEXTURE_FAR_BASE` fetches them from this repository by jsDelivr's GitHub address when a view is zoomed in. The 512 and 1024 pixel widths of every picture, and the ring strip, are 2.05 MB in the package (the nine of 0.2.0 were 0.53 MB; Ceres adds 0.13 MB, Tethys, Dione, Iapetus, Triton and Charon 0.45 MB, and Vesta 0.08 MB). Where a source does not say where its map is centred, its row says what the picture was matched to.
|
|
104
114
|
|
|
105
115
|
## Finer map tiles
|
|
106
116
|
|
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.
|
|
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.33.0/docs/images/lineup-desk.png" width="640"></p>
|
|
23
23
|
|
|
24
24
|
## Who it is for
|
|
25
25
|
|
|
@@ -96,7 +96,7 @@ A bundled app imports it: `import "@johnmorrisdotca/wakusei-planets/element"` (a
|
|
|
96
96
|
|
|
97
97
|
## Features
|
|
98
98
|
|
|
99
|
-
- The Sun, the eight planets, Pluto, eight more dwarf planets and 29 moons, each with its real size, flattening, axial tilt, pole and rotation as data.
|
|
99
|
+
- The Sun, the eight planets, Pluto, eight more dwarf planets, five minor bodies (the asteroids Vesta and Pallas, the centaurs Chiron and Pholus and Halley's comet) and 29 moons, each with its real size, flattening, axial tilt, pole and rotation as data.
|
|
100
100
|
- Three looks: a clean `line` drawing (an SVG string), a shaded `realistic` sphere worked out in a shader, and a `painted` surface map from public-domain imagery.
|
|
101
101
|
- The sky for any date and time: a body's pole, rotation, phase and ring opening as the Earth sees it, and a planet's moons where they are then.
|
|
102
102
|
- One WebGL context for the page, nothing drawn at rest, at most thirty frames a second, and everything freed when an element leaves.
|
|
@@ -126,7 +126,7 @@ Import the element once in client code, and the entry point of each body you dra
|
|
|
126
126
|
| `realistic` | A shaded sphere drawn from the body's real colours and features, lit from the Sun's side, with the rings casting shadows. No pictures: the surface is worked out in a shader. | `three`, the body's entry point |
|
|
127
127
|
| `painted` | A real surface map from public-domain NASA, USGS and JPL imagery. Small pictures first (1.31 MB for all of them in the package), a sharper one fetched when you zoom in, and finer map tiles for the part in view when you zoom right up, in a body, a portrait or the space view (Mars, the Moon, the Earth and ten moons: [close zoom](docs/guides/close-zoom.md)). | `three`, the body's entry point |
|
|
128
128
|
|
|
129
|
-
Every body has its real size relative to the others (`scale-to="jupiter"`), its axial tilt and its rotation. The Sun, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto are drawn, and so are the eight other dwarf planets (Ceres, Orcus, Haumea, Quaoar, Makemake, Gonggong, Eris and Sedna; Haumea and Quaoar as the long shapes they are, and Ceres with a painted map from Dawn) and 29 moons (the Moon, Phobos and Deimos, the four Galilean moons, Saturn's seven larger moons, Uranus's five, Proteus, Triton and Nereid, Charon, Nix and Hydra, and Vanth, Hiʻiaka, Namaka and Dysnomia, the moons of the dwarf planets whose orbits are published with a date). The Earth is drawn like the rest in the realistic and painted looks (NASA's Blue Marble), and its line look is [chikyu-earth](https://github.com/johnmorrisdotca/chikyu-earth)'s own globe: `import "@johnmorrisdotca/wakusei-planets/earth"` (it needs `@johnmorrisdotca/chikyu-earth` 0.10.0 or later installed). The painted looks cover the Sun, the planets from Mercury to Earth and Pluto, Ceres, the Moon, the four Galilean moons, Saturn's Mimas, Enceladus, Tethys, Dione, Rhea, Titan and Iapetus, Triton and Charon, and Saturn's rings are Cassini's own picture of them.
|
|
129
|
+
Every body has its real size relative to the others (`scale-to="jupiter"`), its axial tilt and its rotation. The Sun, Mercury, Venus, Mars, Jupiter, Saturn, Uranus, Neptune and Pluto are drawn, and so are the eight other dwarf planets (Ceres, Orcus, Haumea, Quaoar, Makemake, Gonggong, Eris and Sedna; Haumea and Quaoar as the long shapes they are, and Ceres with a painted map from Dawn) five minor bodies (Vesta, with Dawn's own map, Pallas, Chiron, Pholus and Halley's comet, each its own shape, size and spin as the Small-Body Database has them) and 29 moons (the Moon, Phobos and Deimos, the four Galilean moons, Saturn's seven larger moons, Uranus's five, Proteus, Triton and Nereid, Charon, Nix and Hydra, and Vanth, Hiʻiaka, Namaka and Dysnomia, the moons of the dwarf planets whose orbits are published with a date). The Earth is drawn like the rest in the realistic and painted looks (NASA's Blue Marble), and its line look is [chikyu-earth](https://github.com/johnmorrisdotca/chikyu-earth)'s own globe: `import "@johnmorrisdotca/wakusei-planets/earth"` (it needs `@johnmorrisdotca/chikyu-earth` 0.10.0 or later installed). The painted looks cover the Sun, the planets from Mercury to Earth and Pluto, Ceres, the Moon, the four Galilean moons, Saturn's Mimas, Enceladus, Tethys, Dione, Rhea, Titan and Iapetus, Triton and Charon, and Saturn's rings are Cassini's own picture of them.
|
|
130
130
|
|
|
131
131
|
## A star from its numbers
|
|
132
132
|
|
|
@@ -372,7 +372,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
|
|
|
372
372
|
|
|
373
373
|
## The portrait builder
|
|
374
374
|
|
|
375
|
-
<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.
|
|
375
|
+
<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.33.0/docs/images/portrait-family.png" width="640"></p>
|
|
376
376
|
|
|
377
377
|
[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.
|
|
378
378
|
|
|
@@ -493,6 +493,7 @@ BODIES.pluto.kind; // "dwarf-planet"
|
|
|
493
493
|
- **The planets** (Mercury to Neptune, VSOP87B cut to 995 of its 35,080 terms) are within 5 arc-seconds of Horizons on 60 dates from 1800 to 2200, Mars the worst at 4.8, and the tests hold each to 6 or less; the series is good for the years 1750 to 2250 and slowly worse beyond. Pluto's table is within 0.2.
|
|
494
494
|
- **The Moon** (ELP2000-82B cut to its 540 largest terms) is within 4.7 arc-seconds on the same 60 dates, held to 5.8.
|
|
495
495
|
- **The moons** are less exact: Jupiter's four big moons are within 0.15 degree and Saturn's seven inner ones within 2.1, Uranus's Miranda within 3 and Neptune's Nereid within 6.3; one degree on a moon's orbit is about the width of the moon on a screen. [Accuracy](docs/guides/accuracy.md) has each moon's number.
|
|
496
|
+
- **The minor bodies** (Vesta, Pallas, Chiron, Pholus, Halley) are within an arc-second of Horizons in the years their tables cover (Vesta and Pallas 1900 to 2100, the others 1800 to 2200; 0.5 at the worst on the dates checked); outside them they are plain ellipses from Horizons' elements of one epoch, a few degrees off a century away (and Halley's 31 degrees off in 2026 without its table: the space view loads it).
|
|
496
497
|
- **The dwarf planets** are within 0.2 arc-seconds of Horizons in the years their tables cover (1800 to 2200, Ceres 1900 to 2100); outside them the positions are plain ellipses, good for a few years either side of June 2026. Their moons other than Pluto's are not checked against Horizons, and a dwarf planet's pole is estimated where it is not measured (NOTICE.md says which).
|
|
497
498
|
- **The spacecraft** follow Horizons' own record, within 1,000 km near a planet and elsewhere a millionth of the distance from the Sun; a path after today is Horizons' prediction, not a fact.
|
|
498
499
|
- **Star sizes** in the line-up are each from a refereed paper, with the paper's error; WOH G64's and Stephenson 2-18's are estimated (from the spectrum and the brightness, and from a dust-shell fit) and not measured, and UY Scuti's distance is not a parallax. A star's surface (cells, spots, glow) is drawn for looks and says so.
|
|
@@ -507,7 +508,7 @@ BODIES.pluto.kind; // "dwarf-planet"
|
|
|
507
508
|
|
|
508
509
|
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:
|
|
509
510
|
|
|
510
|
-
> Morris, J. (2026). *Wakusei Planets* (version 0.
|
|
511
|
+
> Morris, J. (2026). *Wakusei Planets* (version 0.33.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
|
|
511
512
|
|
|
512
513
|
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).
|
|
513
514
|
|
package/dist/bodies/all.d.ts
CHANGED
package/dist/bodies/all.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { registerLook } from "../scene/look.js";
|
|
2
|
+
import { rock } from "../scene/recipes.js";
|
|
3
|
+
// The minor bodies, drawn from their numbers: a rock of the body's colour with craters. Vesta has Dawn's own map as its painted look; the others have never been seen as more than a few pixels
|
|
4
|
+
// (Halley's nucleus was photographed by the Giotto probe in 1986, a picture whose terms keep it out of this package), so their craters and patches are made up.
|
|
5
|
+
registerLook({
|
|
6
|
+
id: "vesta",
|
|
7
|
+
surface: rock({ dark: "#7d776d", light: "#bdb6aa", craters: 1.5, contrast: 0.9, seed: 81, patches: 3 }),
|
|
8
|
+
relief: 0.8,
|
|
9
|
+
ambient: 0.02,
|
|
10
|
+
painted: { map: "vesta", widths: [512, 1024, 2048], far: 2048 },
|
|
11
|
+
mapped: true,
|
|
12
|
+
});
|
|
13
|
+
registerLook({ id: "pallas", surface: rock({ dark: "#5e6064", light: "#92949a", craters: 1.2, contrast: 0.8, seed: 83, patches: 2.6 }), relief: 0.7, ambient: 0.02 });
|
|
14
|
+
registerLook({ id: "chiron", surface: rock({ dark: "#6f7073", light: "#a5a6a9", craters: 0.9, contrast: 0.7, seed: 85, patches: 2.4 }), relief: 0.6, ambient: 0.02 });
|
|
15
|
+
registerLook({ id: "pholus", surface: rock({ dark: "#6b3524", light: "#a85c42", craters: 0.9, contrast: 0.7, seed: 87, patches: 2.6 }), relief: 0.6, ambient: 0.02 });
|
|
16
|
+
registerLook({ id: "halley", surface: rock({ dark: "#25221f", light: "#4a4541", craters: 0.8, contrast: 0.9, seed: 89, patches: 3.2 }), relief: 0.9, ambient: 0.02 });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export const MINOR_ELEMENTS = {
|
|
2
|
+
vesta: { epoch: 1577836800000, a: 2.361908654291772, e: 0.08857261385730482, i: 7.14181494423702, node: 103.8092892453337, w: 150.8357762126256, m: 163.3754032354997, n: 0.271524753 },
|
|
3
|
+
pallas: { epoch: 1493251200000, a: 2.773023116113918, e: 0.2306545322740501, i: 34.83970334384021, node: 173.0883296888898, w: 309.9974922427895, m: 263.9040941962388, n: 0.21343903 },
|
|
4
|
+
chiron: { epoch: 1497225600000, a: 13.64597936638133, e: 0.3824171374703196, i: 6.94959060447848, node: 209.2011323125998, w: 339.6529896907077, m: 151.975605480683, n: 0.019552262 },
|
|
5
|
+
pholus: { epoch: 1277164800000, a: 20.30484241567553, e: 0.5718479422462566, i: 24.66709981611229, node: 119.4098618882261, w: 354.7063272595453, m: 73.88199769909997, n: 0.010772206 },
|
|
6
|
+
halley: { epoch: -61516800000, a: 17.92863504856929, e: 0.9679359956953212, i: 162.1905300439129, node: 59.09894720612437, w: 112.2414314637764, m: 274.3823371364693, n: 0.012983244 },
|
|
7
|
+
};
|
package/dist/data/tables.d.ts
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
export interface FittedTable {
|
|
3
3
|
/** Milliseconds since 1970, in terrestrial time, at the start of the first segment. */
|
|
4
4
|
start: number;
|
|
5
|
-
/** The length of a segment in milliseconds. */
|
|
5
|
+
/** The length of a segment in milliseconds (the mean length, for a table with `edges`). */
|
|
6
6
|
segment: number;
|
|
7
|
+
/** Where each segment starts, in milliseconds from `start`, and where the last ends: one more than there are segments. Left out, every segment is `segment` long; a body that moves fast in one part of its orbit and slowly in another (a comet) has segments of unequal length. */
|
|
8
|
+
edges?: readonly number[];
|
|
7
9
|
/** The error on samples held back from the fit, in arc-seconds. */
|
|
8
10
|
worst: number;
|
|
9
11
|
/** By segment, then x, y, z, then the Chebyshev coefficients, in au. */
|
|
10
12
|
segments: readonly (readonly (readonly number[])[])[];
|
|
11
13
|
}
|
|
12
14
|
/**
|
|
13
|
-
* Teach `heliocentric` a body's fitted table. The entry points `@johnmorrisdotca/wakusei-planets/tables/ceres` and `/tables/
|
|
15
|
+
* Teach `heliocentric` a body's fitted table. The entry points `@johnmorrisdotca/wakusei-planets/tables/ceres`, `/tables/dwarfs` and `/tables/minor` call this as they load.
|
|
14
16
|
*
|
|
15
17
|
* @param id - The body's name.
|
|
16
18
|
* @param table - Its Chebyshev segments, as `scripts/make-dwarf-data.py` writes them.
|
package/dist/data/tables.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const KEY = Symbol.for("johnmorrisdotca.wakusei-planets.tables");
|
|
4
4
|
const tables = (globalThis[KEY] ??= new Map());
|
|
5
5
|
/**
|
|
6
|
-
* Teach `heliocentric` a body's fitted table. The entry points `@johnmorrisdotca/wakusei-planets/tables/ceres` and `/tables/
|
|
6
|
+
* Teach `heliocentric` a body's fitted table. The entry points `@johnmorrisdotca/wakusei-planets/tables/ceres`, `/tables/dwarfs` and `/tables/minor` call this as they load.
|
|
7
7
|
*
|
|
8
8
|
* @param id - The body's name.
|
|
9
9
|
* @param table - Its Chebyshev segments, as `scripts/make-dwarf-data.py` writes them.
|
package/dist/element.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { carryControls } from "@johnmorrisdotca/kazoku-ui/view-controls";
|
|
2
2
|
import "./tables/ceres.js";
|
|
3
3
|
import "./tables/dwarfs.js";
|
|
4
|
-
import { loadMoonTheory } from "./tables/lazy.js";
|
|
4
|
+
import { loadMinorTables, loadMoonTheory } from "./tables/lazy.js";
|
|
5
5
|
import { orbitPath } from "./ephemeris.js";
|
|
6
|
-
import { BODIES } from "./facts.js";
|
|
6
|
+
import { BODIES, MINOR_IDS } from "./facts.js";
|
|
7
7
|
import { extentOf, ROOM } from "./scene/extent.js";
|
|
8
8
|
import { createGate, frameCap } from "./gate.js";
|
|
9
9
|
import { lineSvg } from "./line.js";
|
|
@@ -606,6 +606,15 @@ export class WakuseiBody extends HTMLElement {
|
|
|
606
606
|
const request = this.#request();
|
|
607
607
|
if (request.moons)
|
|
608
608
|
this.#wantTheory(request.id);
|
|
609
|
+
// a minor body with a date is placed from its fitted table, fetched the first time one is asked for
|
|
610
|
+
if (request.start !== undefined && MINOR_IDS.includes(request.id)) {
|
|
611
|
+
void loadMinorTables().then((loaded) => {
|
|
612
|
+
if (!loaded)
|
|
613
|
+
return;
|
|
614
|
+
this.#live = createLive();
|
|
615
|
+
this.#queue(true);
|
|
616
|
+
});
|
|
617
|
+
}
|
|
609
618
|
const frame = this.#live.at(request, performance.now());
|
|
610
619
|
if (frame.anchors !== this.#lastAnchors) {
|
|
611
620
|
this.#lastAnchors = frame.anchors;
|
package/dist/embed.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export interface EmbedSettings {
|
|
|
68
68
|
/** The package's address on the CDN, with its version. */
|
|
69
69
|
cdn?: string;
|
|
70
70
|
}
|
|
71
|
-
/** The entry point that holds a body's shaded and painted look: the body's own, `dwarfs` for the dwarf planets besides Pluto, `moons-<planet>` for a moon and `moons-dwarf` for a moon of a dwarf planet. */
|
|
71
|
+
/** The entry point that holds a body's shaded and painted look: the body's own, `dwarfs` for the dwarf planets besides Pluto, `minor` for Vesta, Pallas, Chiron, Pholus and Halley, `moons-<planet>` for a moon and `moons-dwarf` for a moon of a dwarf planet. */
|
|
72
72
|
export declare function entryOf(id: BodyId): string;
|
|
73
73
|
/**
|
|
74
74
|
* The text that puts a body in a page, for one way of making the page. Each way is built, parsed or run by the package's tests: the plain HTML one with a script tag from jsDelivr, an ES module, a React component,
|
package/dist/embed.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The text to put a body in a page, for each way a page is made: a script tag from a CDN, an ES module, React, Vue, Angular, Svelte, or an iframe of `embed.html`. The demo's "Put it in your page"
|
|
2
2
|
// section shows these as the reader changes a choice, and the tests build or parse every one. Pure: no DOM.
|
|
3
3
|
import { embedSnippet } from "@johnmorrisdotca/kazoku-ui/embed-panel";
|
|
4
|
-
import { BODIES, DWARF_IDS } from "./facts.js";
|
|
4
|
+
import { BODIES, DWARF_IDS, MINOR_IDS } from "./facts.js";
|
|
5
5
|
import { decodeScene } from "./portrait/model.js";
|
|
6
6
|
import { VERSION } from "./version.js";
|
|
7
7
|
/**
|
|
@@ -18,11 +18,11 @@ export const EMBED_KINDS = ["html", "module", "react", "vue", "angular", "svelte
|
|
|
18
18
|
const SITE = "https://johnmorrisdotca.github.io/wakusei-planets/";
|
|
19
19
|
const CDN = `https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@${VERSION}`;
|
|
20
20
|
const PACKAGE = "@johnmorrisdotca/wakusei-planets";
|
|
21
|
-
/** The entry point that holds a body's shaded and painted look: the body's own, `dwarfs` for the dwarf planets besides Pluto, `moons-<planet>` for a moon and `moons-dwarf` for a moon of a dwarf planet. */
|
|
21
|
+
/** The entry point that holds a body's shaded and painted look: the body's own, `dwarfs` for the dwarf planets besides Pluto, `minor` for Vesta, Pallas, Chiron, Pholus and Halley, `moons-<planet>` for a moon and `moons-dwarf` for a moon of a dwarf planet. */
|
|
22
22
|
export function entryOf(id) {
|
|
23
23
|
const parent = BODIES[id].parent;
|
|
24
24
|
if (parent === undefined)
|
|
25
|
-
return DWARF_IDS.includes(id) ? "dwarfs" : id;
|
|
25
|
+
return DWARF_IDS.includes(id) ? "dwarfs" : MINOR_IDS.includes(id) ? "minor" : id;
|
|
26
26
|
return DWARF_IDS.includes(parent) ? "moons-dwarf" : `moons-${parent}`;
|
|
27
27
|
}
|
|
28
28
|
/** A star's numbers as the attributes that carry them, in the order they are written: the same names are the iframe's address keys. */
|
package/dist/ephemeris.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { moonGeocentric } from "./theory.ts";
|
|
2
2
|
export { moonGeocentric };
|
|
3
|
-
import { type BodyId, type HostId, type MoonId } from "./facts.ts";
|
|
3
|
+
import { type BodyId, type HostId, type MinorId, type MoonId } from "./facts.ts";
|
|
4
4
|
import { type Vec3 } from "./vec.ts";
|
|
5
5
|
/** Solve Kepler's equation for the eccentric anomaly, all in radians. */
|
|
6
6
|
export declare function kepler(meanAnomaly: number, e: number): number;
|
|
7
7
|
/**
|
|
8
8
|
* A planet's or dwarf planet's position in the Sun's frame (J2000 ecliptic, astronomical units) at a time: Mercury to Neptune from the VSOP87B series, and Pluto and the other dwarf planets from tables fitted to Horizons (each within a few arc-seconds or better, see the accuracy guide; outside a table's years a dwarf planet falls back to the osculating elements of one epoch from JPL's Small-Body Database).
|
|
9
|
-
* @param planet - The planet's
|
|
9
|
+
* @param planet - The planet's, dwarf planet's or minor body's name.
|
|
10
10
|
* @param ms - The instant, in milliseconds since 1970 (UTC).
|
|
11
11
|
* @returns The position as x, y, z in au.
|
|
12
12
|
*
|
|
@@ -18,7 +18,7 @@ export declare function kepler(meanAnomaly: number, e: number): number;
|
|
|
18
18
|
* console.log(Math.hypot(x, y, z).toFixed(3));
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
export declare function heliocentric(planet: HostId, ms: number): Vec3;
|
|
21
|
+
export declare function heliocentric(planet: HostId | MinorId, ms: number): Vec3;
|
|
22
22
|
/**
|
|
23
23
|
* The theory that `heliocentric(planet, ms)` answers with, given the tables loaded now: VSOP87B for Mercury to Neptune, a fitted Chebyshev table where one covers the moment, else
|
|
24
24
|
* osculating elements (a dwarf planet) or JPL's approximate elements (Pluto outside its table). `worstArcseconds` is the fitted table's measured worst on samples held back from
|
|
@@ -35,13 +35,13 @@ export declare function heliocentric(planet: HostId, ms: number): Vec3;
|
|
|
35
35
|
* console.log(heliocentricModel("pluto", Date.UTC(2026, 0, 1)));
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
|
-
export declare function heliocentricModel(planet: HostId, ms: number): {
|
|
38
|
+
export declare function heliocentricModel(planet: HostId | MinorId, ms: number): {
|
|
39
39
|
theory: "vsop87b" | "chebyshev" | "osculating-elements" | "approximate-elements";
|
|
40
40
|
worstArcseconds: number | null;
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
-
* Mean distance from the Sun, in astronomical units: a planet's semi-major axis at J2000, or a dwarf planet's semi-major axis at the epoch of its elements.
|
|
44
|
-
* @param id - A planet or a
|
|
43
|
+
* Mean distance from the Sun, in astronomical units: a planet's semi-major axis at J2000, or a dwarf planet's or minor body's semi-major axis at the epoch of its elements.
|
|
44
|
+
* @param id - A planet, a dwarf planet or a minor body.
|
|
45
45
|
* @returns The semi-major axis in au.
|
|
46
46
|
*
|
|
47
47
|
* @example
|
|
@@ -51,7 +51,7 @@ export declare function heliocentricModel(planet: HostId, ms: number): {
|
|
|
51
51
|
* console.log(meanSunAu("earth").toFixed(3));
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
|
-
export declare function meanSunAu(id: HostId): number;
|
|
54
|
+
export declare function meanSunAu(id: HostId | MinorId): number;
|
|
55
55
|
/** The north pole of a body as a J2000 ecliptic unit vector. */
|
|
56
56
|
export declare function poleOf(id: BodyId): Vec3;
|
|
57
57
|
/** The prime meridian's direction (J2000 ecliptic unit vector) when it has turned to `w` degrees. */
|
package/dist/ephemeris.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { ORBITS } from "./data/orbits.js";
|
|
6
6
|
import { moonTheoryOf, planetSeriesOf } from "./data/theories.js";
|
|
7
7
|
import { DWARF_ELEMENTS } from "./data/dwarf.js";
|
|
8
|
+
import { MINOR_ELEMENTS } from "./data/minor.js";
|
|
8
9
|
import { tableOf } from "./data/tables.js";
|
|
9
10
|
import { PLUTO, PLUTO_SEGMENT_MS, PLUTO_START } from "./data/pluto.js";
|
|
10
11
|
import { VSOP87 } from "./data/vsop.js";
|
|
@@ -41,7 +42,8 @@ export function kepler(meanAnomaly, e) {
|
|
|
41
42
|
m -= 2 * Math.PI;
|
|
42
43
|
if (m < -Math.PI)
|
|
43
44
|
m += 2 * Math.PI;
|
|
44
|
-
|
|
45
|
+
// from the mean anomaly itself for a gentle orbit, and for a long one from a place on the same side of the orbit (Newton's method started at pi goes astray for a negative mean anomaly, which put Sedna's far side in the wrong places)
|
|
46
|
+
let E = e < 0.8 ? m : m + 0.85 * e * Math.sign(Math.sin(m) || 1);
|
|
45
47
|
for (let i = 0; i < 12; i += 1) {
|
|
46
48
|
const d = (E - e * Math.sin(E) - m) / (1 - e * Math.cos(E));
|
|
47
49
|
E -= d;
|
|
@@ -51,13 +53,34 @@ export function kepler(meanAnomaly, e) {
|
|
|
51
53
|
return E;
|
|
52
54
|
}
|
|
53
55
|
const PLUTO_TABLE = { start: PLUTO_START, segment: PLUTO_SEGMENT_MS, worst: 0.14637, segments: PLUTO };
|
|
56
|
+
/** Which segment of a table holds a moment, where it starts (milliseconds from the table's start) and how long it is; `undefined` outside the table. A table with `edges` has segments of unequal length, found by bisection. */
|
|
57
|
+
function segmentAt(table, terrestrialMs) {
|
|
58
|
+
const since = terrestrialMs - table.start;
|
|
59
|
+
const edges = table.edges;
|
|
60
|
+
if (edges === undefined) {
|
|
61
|
+
const index = Math.floor(since / table.segment);
|
|
62
|
+
return table.segments[index] === undefined ? undefined : { index, from: index * table.segment, length: table.segment };
|
|
63
|
+
}
|
|
64
|
+
if (!(since >= edges[0]) || since >= edges[edges.length - 1])
|
|
65
|
+
return undefined;
|
|
66
|
+
let lo = 0;
|
|
67
|
+
let hi = edges.length - 2;
|
|
68
|
+
while (lo < hi) {
|
|
69
|
+
const mid = (lo + hi + 1) >> 1;
|
|
70
|
+
if (edges[mid] <= since)
|
|
71
|
+
lo = mid;
|
|
72
|
+
else
|
|
73
|
+
hi = mid - 1;
|
|
74
|
+
}
|
|
75
|
+
return { index: lo, from: edges[lo], length: edges[lo + 1] - edges[lo] };
|
|
76
|
+
}
|
|
54
77
|
/** A position from a Chebyshev table, as x, y, z in au, or undefined outside the years it covers. */
|
|
55
78
|
function fittedPosition(table, terrestrialMs) {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
if (coefficients === undefined)
|
|
79
|
+
const found = segmentAt(table, terrestrialMs);
|
|
80
|
+
if (found === undefined)
|
|
59
81
|
return undefined;
|
|
60
|
-
const
|
|
82
|
+
const coefficients = table.segments[found.index];
|
|
83
|
+
const x = (2 * (terrestrialMs - table.start - found.from)) / found.length - 1;
|
|
61
84
|
const at = (axis) => {
|
|
62
85
|
let b1 = 0;
|
|
63
86
|
let b2 = 0;
|
|
@@ -72,7 +95,7 @@ function fittedPosition(table, terrestrialMs) {
|
|
|
72
95
|
}
|
|
73
96
|
/** Same table priority and TT segment coverage for positions and model information. */
|
|
74
97
|
function fittedTableAt(planet, tt) {
|
|
75
|
-
const covers = (table) =>
|
|
98
|
+
const covers = (table) => segmentAt(table, tt) !== undefined;
|
|
76
99
|
if (planet === "pluto" && covers(PLUTO_TABLE))
|
|
77
100
|
return PLUTO_TABLE;
|
|
78
101
|
const registered = tableOf(planet);
|
|
@@ -107,7 +130,7 @@ function barycentreFromSun(terrestrialMs) {
|
|
|
107
130
|
}
|
|
108
131
|
/**
|
|
109
132
|
* A planet's or dwarf planet's position in the Sun's frame (J2000 ecliptic, astronomical units) at a time: Mercury to Neptune from the VSOP87B series, and Pluto and the other dwarf planets from tables fitted to Horizons (each within a few arc-seconds or better, see the accuracy guide; outside a table's years a dwarf planet falls back to the osculating elements of one epoch from JPL's Small-Body Database).
|
|
110
|
-
* @param planet - The planet's
|
|
133
|
+
* @param planet - The planet's, dwarf planet's or minor body's name.
|
|
111
134
|
* @param ms - The instant, in milliseconds since 1970 (UTC).
|
|
112
135
|
* @returns The position as x, y, z in au.
|
|
113
136
|
*
|
|
@@ -140,9 +163,9 @@ export function heliocentric(planet, ms) {
|
|
|
140
163
|
let node;
|
|
141
164
|
let w;
|
|
142
165
|
let E;
|
|
143
|
-
const dwarf = DWARF_ELEMENTS[planet];
|
|
166
|
+
const dwarf = DWARF_ELEMENTS[planet] ?? MINOR_ELEMENTS[planet];
|
|
144
167
|
if (dwarf !== undefined) {
|
|
145
|
-
// a dwarf planet: the osculating elements of one epoch, run as a plain ellipse (good for years either side of it)
|
|
168
|
+
// a dwarf planet or a minor body: the osculating elements of one epoch, run as a plain ellipse (good for years either side of it)
|
|
146
169
|
a = dwarf.a;
|
|
147
170
|
e = dwarf.e;
|
|
148
171
|
I = dwarf.i * RAD;
|
|
@@ -195,11 +218,11 @@ export function heliocentricModel(planet, ms) {
|
|
|
195
218
|
const table = fittedTableAt(planet, tt);
|
|
196
219
|
return table !== undefined
|
|
197
220
|
? { theory: "chebyshev", worstArcseconds: table.worst }
|
|
198
|
-
: { theory: planet in DWARF_ELEMENTS ? "osculating-elements" : "approximate-elements", worstArcseconds: null };
|
|
221
|
+
: { theory: planet in DWARF_ELEMENTS || planet in MINOR_ELEMENTS ? "osculating-elements" : "approximate-elements", worstArcseconds: null };
|
|
199
222
|
}
|
|
200
223
|
/**
|
|
201
|
-
* Mean distance from the Sun, in astronomical units: a planet's semi-major axis at J2000, or a dwarf planet's semi-major axis at the epoch of its elements.
|
|
202
|
-
* @param id - A planet or a
|
|
224
|
+
* Mean distance from the Sun, in astronomical units: a planet's semi-major axis at J2000, or a dwarf planet's or minor body's semi-major axis at the epoch of its elements.
|
|
225
|
+
* @param id - A planet, a dwarf planet or a minor body.
|
|
203
226
|
* @returns The semi-major axis in au.
|
|
204
227
|
*
|
|
205
228
|
* @example
|
|
@@ -210,7 +233,7 @@ export function heliocentricModel(planet, ms) {
|
|
|
210
233
|
* ```
|
|
211
234
|
*/
|
|
212
235
|
export function meanSunAu(id) {
|
|
213
|
-
const dwarf = DWARF_ELEMENTS[id];
|
|
236
|
+
const dwarf = DWARF_ELEMENTS[id] ?? MINOR_ELEMENTS[id];
|
|
214
237
|
return dwarf !== undefined ? dwarf.a : ELEMENTS[id][0];
|
|
215
238
|
}
|
|
216
239
|
/** The north pole of a body as a J2000 ecliptic unit vector. */
|
package/dist/facts.d.ts
CHANGED
|
@@ -20,6 +20,17 @@ export declare const PLANET_IDS: readonly ["mercury", "venus", "earth", "mars",
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export declare const DWARF_IDS: readonly ["ceres", "orcus", "haumea", "quaoar", "makemake", "gonggong", "eris", "sedna"];
|
|
23
|
+
/**
|
|
24
|
+
* The minor bodies beyond the dwarf planets that the package knows by name: the asteroids Vesta and Pallas, the centaurs Chiron and Pholus and Halley's comet, nearest the Sun first by the size of their orbits (Halley's, a long ellipse, last).
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* import { MINOR_IDS } from "@johnmorrisdotca/wakusei-planets";
|
|
29
|
+
*
|
|
30
|
+
* console.log(MINOR_IDS.join(", "));
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare const MINOR_IDS: readonly ["vesta", "pallas", "chiron", "pholus", "halley"];
|
|
23
34
|
/**
|
|
24
35
|
* The moons the package draws, by planet or dwarf planet.
|
|
25
36
|
*
|
|
@@ -66,6 +77,18 @@ export type PlanetId = (typeof PLANET_IDS)[number];
|
|
|
66
77
|
* ```
|
|
67
78
|
*/
|
|
68
79
|
export type DwarfId = (typeof DWARF_IDS)[number];
|
|
80
|
+
/**
|
|
81
|
+
* The name of a minor body: `vesta`, `pallas`, `chiron`, `pholus` or `halley`.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { MINOR_IDS, type MinorId } from "@johnmorrisdotca/wakusei-planets";
|
|
86
|
+
*
|
|
87
|
+
* const id: MinorId = MINOR_IDS[4];
|
|
88
|
+
* console.log(id);
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export type MinorId = (typeof MINOR_IDS)[number];
|
|
69
92
|
/**
|
|
70
93
|
* A body a moon can go round: a planet, Pluto or another dwarf planet.
|
|
71
94
|
*
|
|
@@ -91,7 +114,7 @@ export type HostId = PlanetId | DwarfId;
|
|
|
91
114
|
*/
|
|
92
115
|
export type MoonId = (typeof MOONS_OF)[keyof typeof MOONS_OF][number];
|
|
93
116
|
/**
|
|
94
|
-
* The name of a body: `sun`, a planet, a dwarf planet or a moon.
|
|
117
|
+
* The name of a body: `sun`, a planet, a dwarf planet, a minor body or a moon.
|
|
95
118
|
*
|
|
96
119
|
* @example
|
|
97
120
|
* ```ts
|
|
@@ -101,7 +124,7 @@ export type MoonId = (typeof MOONS_OF)[keyof typeof MOONS_OF][number];
|
|
|
101
124
|
* console.log(lineSvg(id, { size: 64 }).length > 100);
|
|
102
125
|
* ```
|
|
103
126
|
*/
|
|
104
|
-
export type BodyId = "sun" | PlanetId | DwarfId | MoonId;
|
|
127
|
+
export type BodyId = "sun" | PlanetId | DwarfId | MinorId | MoonId;
|
|
105
128
|
/**
|
|
106
129
|
* How a body is drawn: `line` (an outline drawing), `realistic` and `painted` (a real surface map; `painted` is the same maps), or `illustrated` (shaded from the numbers, not a default).
|
|
107
130
|
*
|
|
@@ -176,7 +199,8 @@ export type Feature = {
|
|
|
176
199
|
*/
|
|
177
200
|
export interface BodyFacts {
|
|
178
201
|
id: BodyId;
|
|
179
|
-
|
|
202
|
+
/** What it is: a star, a planet, a dwarf planet, a moon, or one of the minor bodies: an `asteroid`, a `centaur` (between Jupiter and Neptune) or a `comet`. */
|
|
203
|
+
kind: "star" | "planet" | "dwarf-planet" | "moon" | "asteroid" | "centaur" | "comet";
|
|
180
204
|
/** The planet or dwarf planet a moon goes round. */
|
|
181
205
|
parent?: HostId;
|
|
182
206
|
name: {
|
|
@@ -224,7 +248,7 @@ export interface BodyFacts {
|
|
|
224
248
|
*/
|
|
225
249
|
export declare const BODIES: Readonly<Record<BodyId, BodyFacts>>;
|
|
226
250
|
/**
|
|
227
|
-
* Every body's name: the Sun, the planets outward, the dwarf planets, then the moons of each.
|
|
251
|
+
* Every body's name: the Sun, the planets outward, the dwarf planets, the minor bodies, then the moons of each.
|
|
228
252
|
*
|
|
229
253
|
* @example
|
|
230
254
|
* ```ts
|
package/dist/facts.js
CHANGED
|
@@ -22,6 +22,17 @@ export const PLANET_IDS = ["mercury", "venus", "earth", "mars", "jupiter", "satu
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
export const DWARF_IDS = ["ceres", "orcus", "haumea", "quaoar", "makemake", "gonggong", "eris", "sedna"];
|
|
25
|
+
/**
|
|
26
|
+
* The minor bodies beyond the dwarf planets that the package knows by name: the asteroids Vesta and Pallas, the centaurs Chiron and Pholus and Halley's comet, nearest the Sun first by the size of their orbits (Halley's, a long ellipse, last).
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { MINOR_IDS } from "@johnmorrisdotca/wakusei-planets";
|
|
31
|
+
*
|
|
32
|
+
* console.log(MINOR_IDS.join(", "));
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export const MINOR_IDS = ["vesta", "pallas", "chiron", "pholus", "halley"];
|
|
25
36
|
/**
|
|
26
37
|
* The moons the package draws, by planet or dwarf planet.
|
|
27
38
|
*
|
|
@@ -172,6 +183,17 @@ export const BODIES = {
|
|
|
172
183
|
gonggong: f("gonggong", "dwarf-planet", "Gonggong", "ゴンゴン", 615, 0, 0, 255.383, 36.831, 0, 385.7, 22.4, "#9c4f3b", { features: dots([[-50, 10, 9], [60, -25, 8], [140, 30, 7]]) }),
|
|
173
184
|
eris: f("eris", "dwarf-planet", "Eris", "エリス", 1163, 0, 78.22, 36.17, 44.51, 0, 22.805163, 378.8616, "#e8e4dc", { features: [{ kind: "band", lat: 0 }, ...dots([[-30, 30, 8], [80, -20, 9]])] }),
|
|
174
185
|
sedna: f("sedna", "dwarf-planet", "Sedna", "セドナ", 453, 0, 0, 297.062, 74.71, 0, 840.95, 10.273, "#9a3f2b", { features: dots([[-40, 20, 9], [70, -30, 8], [150, 10, 7]]) }),
|
|
186
|
+
// The minor bodies. Vesta: Park et al. 2025 (Nature Astronomy, JPL SBDB), pole and rotation from the same; Pallas: Marsset et al. 2020 (shape), Carry et al. 2010 (pole, rotation); Chiron and Pholus: JPL SBDB (diameters
|
|
187
|
+
// from occultation and thermal measurements) with the pole estimated along the orbit's; Halley: Keller et al. 1987 (the nucleus), the pole estimated along the orbit's and no spin drawn. See NOTICE.md.
|
|
188
|
+
vesta: f("vesta", "asteroid", "Vesta", "ベスタ", 261.385, 0, 27.4, 309.0611, 42.2324, 285.39, 1617.33312922, 5.3421276322, "#aaa397", {
|
|
189
|
+
axesKm: [284.62, 277.24, 226.33],
|
|
190
|
+
showLon: 301,
|
|
191
|
+
features: [{ kind: "circle", lon: 301, lat: -75, radius: 50 }, { kind: "band", lat: -10 }, { kind: "band", lat: -22 }, ...dots([[60, 25, 9], [140, 5, 7], [-100, 30, 8], [-40, -20, 6]])],
|
|
192
|
+
}),
|
|
193
|
+
pallas: f("pallas", "asteroid", "Pallas", "パラス", 256.5, 0, 83.6, 33, -3, 0, 1105.8, 7.8132214, "#85878a", { axesKm: [284, 266, 224], features: dots([[-60, 20, 12], [50, -25, 10], [130, 30, 9], [-130, -30, 8], [10, 55, 7]]) }),
|
|
194
|
+
chiron: f("chiron", "centaur", "Chiron", "ケイロン", 83, 0, 0, 258.793, 72.317, 0, 1460, 5.918, "#8d8e90", { features: dots([[-50, 20, 14], [70, -25, 12], [150, 30, 10], [-120, -35, 9]]) }),
|
|
195
|
+
pholus: f("pholus", "centaur", "Pholus", "ポルス", 95, 0, 0, 334.495, 66.246, 0, 865.73, 9.98, "#8e4b36", { features: dots([[-60, 15, 14], [40, -30, 12], [130, 25, 10], [-130, -20, 9]]) }),
|
|
196
|
+
halley: f("halley", "comet", "Halley", "ハレー彗星", 5.5, 0, 0, 41.795, -69.39, 0, 0, 0, "#44403d", { axesKm: [7.45, 4.1, 4.1], features: [...dots([[-40, 20, 16], [60, -15, 12], [130, 30, 10]]), { kind: "line", points: [[-120, -5], [-80, 8], [-30, -4], [20, 10], [80, 0]] }] }),
|
|
175
197
|
moon: f("moon", "moon", "Moon", "月", 1737.4, 0.0012, 6.68, 269.9949, 66.5392, 38.3213, 13.17635815, 655.728, "#b8b5ae", {
|
|
176
198
|
parent: "earth",
|
|
177
199
|
synchronous: true,
|
|
@@ -216,7 +238,7 @@ export const BODIES = {
|
|
|
216
238
|
dysnomia: f("dysnomia", "moon", "Dysnomia", "ディスノミア", 308, 0, 0, 36.17, 44.51, 0, 22.805163, 378.8616, "#5a5856", { parent: "eris", synchronous: true, features: dots([[-60, 20, 10], [50, -25, 9], [140, 30, 8]]) }),
|
|
217
239
|
};
|
|
218
240
|
/**
|
|
219
|
-
* Every body's name: the Sun, the planets outward, the dwarf planets, then the moons of each.
|
|
241
|
+
* Every body's name: the Sun, the planets outward, the dwarf planets, the minor bodies, then the moons of each.
|
|
220
242
|
*
|
|
221
243
|
* @example
|
|
222
244
|
* ```ts
|
|
@@ -225,7 +247,7 @@ export const BODIES = {
|
|
|
225
247
|
* console.log(BODY_IDS.length, BODY_IDS[0]);
|
|
226
248
|
* ```
|
|
227
249
|
*/
|
|
228
|
-
export const BODY_IDS = ["sun", ...PLANET_IDS, ...DWARF_IDS, ...Object.values(MOONS_OF).flat()];
|
|
250
|
+
export const BODY_IDS = ["sun", ...PLANET_IDS, ...DWARF_IDS, ...MINOR_IDS, ...Object.values(MOONS_OF).flat()];
|
|
229
251
|
/** A body's polar radius as a fraction of its equatorial radius. */
|
|
230
252
|
export const polarRatio = (facts) => 1 - facts.flattening;
|
|
231
253
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BODIES, BODY_IDS, DWARF_IDS, MOONS_OF, PLANET_IDS, ringReach, type BodyFacts, type BodyId, type DwarfId, type Feature, type HostId, type Look, type MoonId, type PlanetId, type RingBand } from "./facts.ts";
|
|
1
|
+
export { BODIES, BODY_IDS, DWARF_IDS, MINOR_IDS, MOONS_OF, PLANET_IDS, ringReach, type BodyFacts, type BodyId, type DwarfId, type Feature, type HostId, type Look, type MinorId, type MoonId, type PlanetId, type RingBand } from "./facts.ts";
|
|
2
2
|
export { apparent, heliocentric, heliocentricModel, meanSunAu, moonGeocentric, orbitPath, system, type Apparent, type MoonPlace, type Pose, type System } from "./ephemeris.ts";
|
|
3
3
|
export { JOURNEY_STOPS, journeyStop, stopPlaceAu, type JourneyStop } from "./stops.ts";
|
|
4
4
|
export { drawnTilt, portrait, type PortraitOptions } from "./pose.ts";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BODIES, BODY_IDS, DWARF_IDS, MOONS_OF, PLANET_IDS, ringReach } from "./facts.js";
|
|
1
|
+
export { BODIES, BODY_IDS, DWARF_IDS, MINOR_IDS, MOONS_OF, PLANET_IDS, ringReach } from "./facts.js";
|
|
2
2
|
export { apparent, heliocentric, heliocentricModel, meanSunAu, moonGeocentric, orbitPath, system } from "./ephemeris.js";
|
|
3
3
|
export { JOURNEY_STOPS, journeyStop, stopPlaceAu } from "./stops.js";
|
|
4
4
|
export { drawnTilt, portrait } from "./pose.js";
|