@johnmorrisdotca/wakusei-planets 0.34.0 → 0.36.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 +27 -0
- package/NOTICE.md +64 -0
- package/README.md +21 -3
- package/dist/approaches.d.ts +276 -0
- package/dist/approaches.js +255 -0
- package/dist/asteroids.d.ts +397 -0
- package/dist/asteroids.js +338 -0
- package/dist/comets.d.ts +316 -0
- package/dist/comets.js +404 -0
- package/dist/craft/bepicolombo.d.ts +1 -0
- package/dist/craft/bepicolombo.js +923 -0
- package/dist/craft/europaclipper.d.ts +1 -0
- package/dist/craft/europaclipper.js +342 -0
- package/dist/craft/hayabusa2.d.ts +1 -0
- package/dist/craft/hayabusa2.js +73 -0
- package/dist/craft/juice.d.ts +1 -0
- package/dist/craft/juice.js +40 -0
- package/dist/craft/lucy.d.ts +1 -0
- package/dist/craft/lucy.js +42 -0
- package/dist/craft/osirisapex.d.ts +1 -0
- package/dist/craft/osirisapex.js +69 -0
- package/dist/craft/psyche.d.ts +1 -0
- package/dist/craft/psyche.js +30 -0
- package/dist/craft/solarorbiter.d.ts +1 -0
- package/dist/craft/solarorbiter.js +94 -0
- package/dist/data/approaches.d.ts +17 -0
- package/dist/data/approaches.js +4192 -0
- package/dist/data/asteroids.d.ts +3 -0
- package/dist/data/asteroids.js +107 -0
- package/dist/data/comets.d.ts +2 -0
- package/dist/data/comets.js +36 -0
- package/dist/data/orbiters.d.ts +368 -0
- package/dist/data/orbiters.js +370 -0
- package/dist/data/places-67p.d.ts +27 -0
- package/dist/data/places-67p.js +2 -0
- package/dist/data/places-ariel.d.ts +602 -0
- package/dist/data/places-ariel.js +27 -0
- package/dist/data/places-bennu.d.ts +25 -0
- package/dist/data/places-bennu.js +2 -0
- package/dist/data/places-callisto.d.ts +3547 -0
- package/dist/data/places-callisto.js +155 -0
- package/dist/data/places-ceres.d.ts +3436 -0
- package/dist/data/places-ceres.js +150 -0
- package/dist/data/places-charon.d.ts +349 -0
- package/dist/data/places-charon.js +16 -0
- package/dist/data/places-dimorphos.d.ts +23 -0
- package/dist/data/places-dimorphos.js +2 -0
- package/dist/data/places-dione.d.ts +2258 -0
- package/dist/data/places-dione.js +99 -0
- package/dist/data/places-enceladus.d.ts +2009 -0
- package/dist/data/places-enceladus.js +88 -0
- package/dist/data/places-eros.d.ts +26 -0
- package/dist/data/places-eros.js +2 -0
- package/dist/data/places-europa.d.ts +2977 -0
- package/dist/data/places-europa.js +130 -0
- package/dist/data/places-ganymede.d.ts +4518 -0
- package/dist/data/places-ganymede.js +197 -0
- package/dist/data/places-iapetus.d.ts +1616 -0
- package/dist/data/places-iapetus.js +71 -0
- package/dist/data/places-io.d.ts +6012 -0
- package/dist/data/places-io.js +262 -0
- package/dist/data/places-jupiter.d.ts +46 -0
- package/dist/data/places-jupiter.js +3 -0
- package/dist/data/places-mars.d.ts +20701 -0
- package/dist/data/places-mars.js +942 -0
- package/dist/data/places-mercury.d.ts +9256 -0
- package/dist/data/places-mercury.js +403 -0
- package/dist/data/places-mimas.d.ts +968 -0
- package/dist/data/places-mimas.js +43 -0
- package/dist/data/places-miranda.d.ts +419 -0
- package/dist/data/places-miranda.js +19 -0
- package/dist/data/places-moon.d.ts +18849 -0
- package/dist/data/places-moon.js +861 -0
- package/dist/data/places-oberon.d.ts +235 -0
- package/dist/data/places-oberon.js +11 -0
- package/dist/data/places-pluto.d.ts +1687 -0
- package/dist/data/places-pluto.js +74 -0
- package/dist/data/places-rhea.d.ts +3317 -0
- package/dist/data/places-rhea.js +145 -0
- package/dist/data/places-ryugu.d.ts +87 -0
- package/dist/data/places-ryugu.js +5 -0
- package/dist/data/places-saturn.d.ts +25 -0
- package/dist/data/places-saturn.js +2 -0
- package/dist/data/places-tempel-1.d.ts +25 -0
- package/dist/data/places-tempel-1.js +2 -0
- package/dist/data/places-tethys.d.ts +1222 -0
- package/dist/data/places-tethys.js +54 -0
- package/dist/data/places-titan.d.ts +7031 -0
- package/dist/data/places-titan.js +306 -0
- package/dist/data/places-titania.d.ts +418 -0
- package/dist/data/places-titania.js +19 -0
- package/dist/data/places-triton.d.ts +1457 -0
- package/dist/data/places-triton.js +64 -0
- package/dist/data/places-umbriel.d.ts +303 -0
- package/dist/data/places-umbriel.js +14 -0
- package/dist/data/places-venus.d.ts +9290 -0
- package/dist/data/places-venus.js +405 -0
- package/dist/data/places-vesta.d.ts +2444 -0
- package/dist/data/places-vesta.js +107 -0
- package/dist/data/roadster.d.ts +8 -0
- package/dist/data/roadster.js +686 -0
- package/dist/element.js +17 -3
- package/dist/orbiter-facts.d.ts +480 -0
- package/dist/orbiter-facts.js +189 -0
- package/dist/orbiters.d.ts +256 -0
- package/dist/orbiters.js +275 -0
- package/dist/places/67p.d.ts +13 -0
- package/dist/places/67p.js +14 -0
- package/dist/places/ariel.d.ts +13 -0
- package/dist/places/ariel.js +14 -0
- package/dist/places/bennu.d.ts +13 -0
- package/dist/places/bennu.js +14 -0
- package/dist/places/callisto.d.ts +13 -0
- package/dist/places/callisto.js +14 -0
- package/dist/places/ceres.d.ts +13 -0
- package/dist/places/ceres.js +14 -0
- package/dist/places/charon.d.ts +13 -0
- package/dist/places/charon.js +14 -0
- package/dist/places/dimorphos.d.ts +13 -0
- package/dist/places/dimorphos.js +14 -0
- package/dist/places/dione.d.ts +13 -0
- package/dist/places/dione.js +14 -0
- package/dist/places/enceladus.d.ts +13 -0
- package/dist/places/enceladus.js +14 -0
- package/dist/places/eros.d.ts +13 -0
- package/dist/places/eros.js +14 -0
- package/dist/places/europa.d.ts +13 -0
- package/dist/places/europa.js +14 -0
- package/dist/places/ganymede.d.ts +13 -0
- package/dist/places/ganymede.js +14 -0
- package/dist/places/iapetus.d.ts +13 -0
- package/dist/places/iapetus.js +14 -0
- package/dist/places/io.d.ts +13 -0
- package/dist/places/io.js +14 -0
- package/dist/places/jupiter.d.ts +13 -0
- package/dist/places/jupiter.js +14 -0
- package/dist/places/mars.d.ts +12 -0
- package/dist/places/mars.js +13 -0
- package/dist/places/mercury.d.ts +13 -0
- package/dist/places/mercury.js +14 -0
- package/dist/places/mimas.d.ts +13 -0
- package/dist/places/mimas.js +14 -0
- package/dist/places/miranda.d.ts +13 -0
- package/dist/places/miranda.js +14 -0
- package/dist/places/moon.d.ts +12 -0
- package/dist/places/moon.js +13 -0
- package/dist/places/oberon.d.ts +13 -0
- package/dist/places/oberon.js +14 -0
- package/dist/places/pluto.d.ts +13 -0
- package/dist/places/pluto.js +14 -0
- package/dist/places/rhea.d.ts +13 -0
- package/dist/places/rhea.js +14 -0
- package/dist/places/ryugu.d.ts +13 -0
- package/dist/places/ryugu.js +14 -0
- package/dist/places/saturn.d.ts +13 -0
- package/dist/places/saturn.js +14 -0
- package/dist/places/tempel-1.d.ts +13 -0
- package/dist/places/tempel-1.js +14 -0
- package/dist/places/tethys.d.ts +13 -0
- package/dist/places/tethys.js +14 -0
- package/dist/places/titan.d.ts +13 -0
- package/dist/places/titan.js +14 -0
- package/dist/places/titania.d.ts +13 -0
- package/dist/places/titania.js +14 -0
- package/dist/places/triton.d.ts +13 -0
- package/dist/places/triton.js +14 -0
- package/dist/places/umbriel.d.ts +13 -0
- package/dist/places/umbriel.js +14 -0
- package/dist/places/venus.d.ts +13 -0
- package/dist/places/venus.js +14 -0
- package/dist/places/vesta.d.ts +13 -0
- package/dist/places/vesta.js +14 -0
- package/dist/places.d.ts +354 -0
- package/dist/places.js +357 -0
- package/dist/plan/element.d.ts +52 -0
- package/dist/plan/element.js +258 -0
- package/dist/plan/index.d.ts +2 -0
- package/dist/plan/index.js +2 -0
- package/dist/plan/layout.d.ts +230 -0
- package/dist/plan/layout.js +229 -0
- package/dist/plan/svg.d.ts +125 -0
- package/dist/plan/svg.js +185 -0
- package/dist/roadster.d.ts +415 -0
- package/dist/roadster.js +496 -0
- package/dist/scene/body.js +10 -9
- package/dist/scene/painter.d.ts +1 -1
- package/dist/scene/painter.js +23 -7
- package/dist/scene/textures.d.ts +2 -2
- package/dist/space/beside.d.ts +4 -1
- package/dist/space/beside.js +47 -6
- package/dist/space/covered.d.ts +102 -0
- package/dist/space/covered.js +98 -0
- package/dist/space/element.d.ts +101 -5
- package/dist/space/element.js +474 -30
- package/dist/space/frame.d.ts +14 -0
- package/dist/space/frame.js +16 -0
- package/dist/space/index.d.ts +4 -1
- package/dist/space/index.js +4 -1
- package/dist/space/regions.d.ts +111 -0
- package/dist/space/regions.js +84 -0
- package/dist/space/scale.d.ts +2 -1
- package/dist/space/scale.js +13 -2
- package/dist/space/scene.d.ts +109 -8
- package/dist/space/scene.js +313 -37
- package/dist/space/travel.d.ts +256 -0
- package/dist/space/travel.js +597 -0
- package/dist/spacecraft-facts.d.ts +4 -4
- package/dist/spacecraft-facts.js +158 -3
- package/dist/spacecraft.d.ts +69 -2
- package/dist/spacecraft.js +45 -2
- package/dist/textures/mimas-1024.webp +0 -0
- package/dist/textures/mimas-512.webp +0 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +208 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// The places on Vesta: a single list. See `/places` for the record's shape and the lookups.
|
|
2
|
+
import { PLACES_VESTA as DATA } from "../data/places-vesta.js";
|
|
3
|
+
/**
|
|
4
|
+
* Every place on Vesta the package knows: the sites first, by date, then the named features by size (a feature's `diameterKm` is 0 where the Gazetteer gives no size). A place's `kind` says what it is
|
|
5
|
+
* (`placesOfKind` from `/places` picks by it); `famous` marks the ones a page can suggest.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { PLACES_VESTA } from "@johnmorrisdotca/wakusei-planets/places/vesta";
|
|
10
|
+
*
|
|
11
|
+
* console.log(PLACES_VESTA.length, "places;", PLACES_VESTA.filter((place) => place.famous).map((place) => place.name.en).slice(0, 3).join(", "));
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export const PLACES_VESTA = DATA;
|
package/dist/places.d.ts
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
import { type BodyId } from "./facts.ts";
|
|
2
|
+
import { type When } from "./when.ts";
|
|
3
|
+
export type { When } from "./when.ts";
|
|
4
|
+
/**
|
|
5
|
+
* What a place is: a `crewed` landing (an Apollo lunar module), a `landing` (a lander that worked after touchdown), a `rover` that drove there, a `crash` (a craft that hit the surface and was lost, by accident or at the end of its mission), an
|
|
6
|
+
* `impact` (a craft sent to hit it on purpose), an `entry` (a probe or orbiter lost in the atmosphere of Venus, Jupiter or Saturn: no surface was reached or none is there), a `planned` landing (announced, not flown) or a named `feature` of the surface.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import type { PlaceKind } from "@johnmorrisdotca/wakusei-planets/places";
|
|
11
|
+
*
|
|
12
|
+
* const kinds: PlaceKind[] = ["crewed", "landing", "rover", "crash", "impact", "entry", "planned", "feature"];
|
|
13
|
+
* console.log(kinds.length);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export type PlaceKind = "crewed" | "landing" | "rover" | "crash" | "impact" | "entry" | "planned" | "feature";
|
|
17
|
+
/**
|
|
18
|
+
* One place on a body. Latitude and longitude are degrees, east positive, from -180 to 180 on every body: the Moon's in the mean Earth/polar axis frame, the others' in the IAU frame the Gazetteer or the source uses (Venus, Mars, Mercury and the moons 0 to 360 east,
|
|
19
|
+
* converted; a source's west longitude is negated). Every feature is planetocentric (the Gazetteer's shapefiles are "in east longitude, planetocentric latitude"). On Mars every place is planetocentric: a lander's `source.latitude` says whether its source is planetocentric,
|
|
20
|
+
* was a planetographic latitude `converted`, or does not state it (`not stated`, GCAT's own rows and most of the other bodies' sites).
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { PLACES_MOON } from "@johnmorrisdotca/wakusei-planets/places/moon";
|
|
25
|
+
* import type { Place } from "@johnmorrisdotca/wakusei-planets/places";
|
|
26
|
+
*
|
|
27
|
+
* const eagle: Place = PLACES_MOON.find((place) => place.id === "moon/apollo-11-lunar-module")!;
|
|
28
|
+
* console.log(eagle.name.en, eagle.lat.toFixed(2), eagle.lon.toFixed(2), eagle.date);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export interface Place {
|
|
32
|
+
/** `<body>/<slug>`, unique on the body. */
|
|
33
|
+
id: string;
|
|
34
|
+
kind: PlaceKind;
|
|
35
|
+
/** The name in English and Japanese (a feature's Japanese name is its IAU name, which is Latin). */
|
|
36
|
+
name: {
|
|
37
|
+
en: string;
|
|
38
|
+
ja: string;
|
|
39
|
+
};
|
|
40
|
+
lat: number;
|
|
41
|
+
lon: number;
|
|
42
|
+
/** When it got there (ISO, UTC, to the minute where the source gives one; a month alone where only that is known), for a site. */
|
|
43
|
+
date?: string;
|
|
44
|
+
/** For a site: the craft, who ran it, its country code as the catalogue gives it, and how it ended up (`soft`, `hard`, `impact`, `crewed`, or `entry`: lost in an atmosphere). */
|
|
45
|
+
mission?: string;
|
|
46
|
+
operator?: string;
|
|
47
|
+
country?: string;
|
|
48
|
+
outcome?: "crewed" | "soft" | "hard" | "impact" | "entry";
|
|
49
|
+
/** True where the source gives the position to a degree or less, or says it is an estimate: the real place can be tens of kilometres from the point. */
|
|
50
|
+
approximate?: true;
|
|
51
|
+
/** Where the catalogue's own position differs from the one used by more than 0.05 degrees: `[lat, lon]`, kept so a page can show both. */
|
|
52
|
+
gcatPosition?: readonly [number, number];
|
|
53
|
+
/** The landing site's own name, where it has one (`Statio Tranquillitatis`, `Octavia E. Butler Landing`). */
|
|
54
|
+
site?: string;
|
|
55
|
+
/** A word from the catalogue about the object. */
|
|
56
|
+
note?: string;
|
|
57
|
+
/** When the craft stopped working on the surface, where known. */
|
|
58
|
+
until?: string;
|
|
59
|
+
/** The catalogue's own name for the object, for looking it up there. */
|
|
60
|
+
gcatName?: string;
|
|
61
|
+
/** True on the places a page can suggest first: the ones a reader has heard of (the Apollo sites, Tycho, Olympus Mons, Maxwell Montes, Sputnik Planitia, Occator). A modest list. */
|
|
62
|
+
famous?: true;
|
|
63
|
+
/** For a feature on a body beyond the Moon and Mars: where the Gazetteer says the name comes from (in English). */
|
|
64
|
+
origin?: string;
|
|
65
|
+
/** For a feature: the IAU type and a plain word for it, the size in kilometres (0 where the Gazetteer gives none), and the date the name was approved. */
|
|
66
|
+
feature?: {
|
|
67
|
+
type: string;
|
|
68
|
+
typeWord: {
|
|
69
|
+
en: string;
|
|
70
|
+
ja: string;
|
|
71
|
+
};
|
|
72
|
+
diameterKm: number;
|
|
73
|
+
approved: string;
|
|
74
|
+
};
|
|
75
|
+
/** For a planned landing: the announced date, its state, and the date the announcement was read. */
|
|
76
|
+
planned?: {
|
|
77
|
+
date: string;
|
|
78
|
+
status: "announced" | "slipped" | "cancelled";
|
|
79
|
+
read: string;
|
|
80
|
+
};
|
|
81
|
+
/** Where the record comes from, and the date that source's file was read. */
|
|
82
|
+
source: {
|
|
83
|
+
id: "iau-gazetteer" | "gcat-landercat" | "nssdca" | "pds-ode" | "nasa-mars24" | "agency" | "nasa-ntrs" | "pds-atmospheres" | "paper";
|
|
84
|
+
read: string;
|
|
85
|
+
latitude?: "planetocentric" | "converted" | "not stated";
|
|
86
|
+
/** The page or paper a position was typed from, where it is not one of the tables above. */
|
|
87
|
+
url?: string;
|
|
88
|
+
/** The coordinate frame, where the source's is not the body's IAU one. */
|
|
89
|
+
frame?: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The credit a page that shows places owes each source, one row for every `source.id` the tables use: the line to print, the licence or terms it rests on and the address. The lander catalogue's is a condition of its licence (CC BY 4.0: "data from GCAT (J. McDowell,
|
|
94
|
+
* planet4589.org/space/gcat)"); the others are US government works, credited as their owners ask, and the papers' coordinates are facts (each record's `source.url` names the paper).
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* import { PLACES_CREDITS } from "@johnmorrisdotca/wakusei-planets/places";
|
|
99
|
+
*
|
|
100
|
+
* console.log(PLACES_CREDITS.map((credit) => credit.line).join("; "));
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare const PLACES_CREDITS: readonly {
|
|
104
|
+
id: Place["source"]["id"];
|
|
105
|
+
line: string;
|
|
106
|
+
licence: string;
|
|
107
|
+
url: string;
|
|
108
|
+
}[];
|
|
109
|
+
/**
|
|
110
|
+
* The bodies that have places, in the order a picker shows them: the Moon and Mars (landings, rovers and named features), Mercury, Venus, the moons of Jupiter, Saturn, Uranus and Neptune that have mapped names, Pluto and Charon, Ceres and Vesta
|
|
111
|
+
* (named features), then the bodies with only sites (Eros, Ryugu, Bennu, Dimorphos, comets Tempel 1 and 67P, Jupiter and Saturn themselves). Each has its own entry point `/places/<body>`.
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* import { PLACE_BODIES } from "@johnmorrisdotca/wakusei-planets/places";
|
|
116
|
+
*
|
|
117
|
+
* console.log(PLACE_BODIES.join(", "));
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export declare const PLACE_BODIES: readonly ["moon", "mars", "mercury", "venus", "io", "europa", "ganymede", "callisto", "titan", "enceladus", "mimas", "tethys", "dione", "rhea", "iapetus", "miranda", "ariel", "umbriel", "titania", "oberon", "triton", "pluto", "charon", "ceres", "vesta", "eros", "ryugu", "bennu", "dimorphos", "tempel-1", "67p", "jupiter", "saturn"];
|
|
121
|
+
/**
|
|
122
|
+
* A body with places.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* import type { PlaceBody } from "@johnmorrisdotca/wakusei-planets/places";
|
|
127
|
+
*
|
|
128
|
+
* const body: PlaceBody = "mars";
|
|
129
|
+
* console.log(body);
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
export type PlaceBody = (typeof PLACE_BODIES)[number];
|
|
133
|
+
/**
|
|
134
|
+
* The places of one kind, or of several, from a body's list, in the list's order (sites by date, then features by size).
|
|
135
|
+
*
|
|
136
|
+
* @param places - A body's list (`PLACES_MOON`, `PLACES_MARS`).
|
|
137
|
+
* @param kinds - The kinds wanted.
|
|
138
|
+
* @returns Those places.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* import { PLACES_MARS } from "@johnmorrisdotca/wakusei-planets/places/mars";
|
|
143
|
+
* import { placesOfKind } from "@johnmorrisdotca/wakusei-planets/places";
|
|
144
|
+
*
|
|
145
|
+
* console.log(placesOfKind(PLACES_MARS, "rover").map((place) => place.name.en).join(", "));
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export declare function placesOfKind(places: readonly Place[], ...kinds: readonly PlaceKind[]): Place[];
|
|
149
|
+
/**
|
|
150
|
+
* A place by its id, or by its name in English or Japanese in any case, or `undefined`.
|
|
151
|
+
*
|
|
152
|
+
* @param places - A body's list.
|
|
153
|
+
* @param text - `moon/apollo-11-lunar-module`, `Apollo 11 lunar module`, `Mare Imbrium`, `嫦娥4号`.
|
|
154
|
+
* @returns The place, or `undefined` when none matches.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* import { PLACES_MOON } from "@johnmorrisdotca/wakusei-planets/places/moon";
|
|
159
|
+
* import { findPlace } from "@johnmorrisdotca/wakusei-planets/places";
|
|
160
|
+
*
|
|
161
|
+
* console.log(findPlace(PLACES_MOON, "mare imbrium")?.feature?.diameterKm, findPlace(PLACES_MOON, "nowhere"));
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export declare function findPlace(places: readonly Place[], text: string): Place | undefined;
|
|
165
|
+
/**
|
|
166
|
+
* The places within a distance of a point on the body, nearest first.
|
|
167
|
+
*
|
|
168
|
+
* @param places - A body's list.
|
|
169
|
+
* @param lat - Planetocentric latitude in degrees.
|
|
170
|
+
* @param lon - East longitude in degrees.
|
|
171
|
+
* @param withinDeg - How far, as an angle at the body's centre, in degrees.
|
|
172
|
+
* @returns The places with their distance in degrees.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { PLACES_MOON } from "@johnmorrisdotca/wakusei-planets/places/moon";
|
|
177
|
+
* import { placesNear } from "@johnmorrisdotca/wakusei-planets/places";
|
|
178
|
+
*
|
|
179
|
+
* console.log(placesNear(PLACES_MOON, 0.67, 23.47, 3).map((near) => `${near.place.name.en} ${near.degrees.toFixed(2)}`).slice(0, 3).join("; "));
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
export declare function placesNear(places: readonly Place[], lat: number, lon: number, withinDeg: number): {
|
|
183
|
+
place: Place;
|
|
184
|
+
degrees: number;
|
|
185
|
+
}[];
|
|
186
|
+
/**
|
|
187
|
+
* A body's places, loaded when asked for: the table of `/places/<body>` arrives as a chunk of its own the first time, so a page that never asks for one does not carry it.
|
|
188
|
+
*
|
|
189
|
+
* @param body - One of `PLACE_BODIES`: `moon`, `mars`, `venus`, `titan`, `pluto`, `67p` and the rest.
|
|
190
|
+
* @returns The list: the sites first, by date, then the named features by size. An unknown body is a rejected `RangeError`.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```ts
|
|
194
|
+
* import { loadPlaces } from "@johnmorrisdotca/wakusei-planets/places";
|
|
195
|
+
*
|
|
196
|
+
* const mars = await loadPlaces("mars");
|
|
197
|
+
* console.log(mars.length, "places on Mars");
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
export declare function loadPlaces(body: PlaceBody): Promise<readonly Place[]>;
|
|
201
|
+
/**
|
|
202
|
+
* The places of a body by kind, from its list (loaded on the first call): `listPlaces("moon", "crewed", "landing")`. With no kind it is every place.
|
|
203
|
+
*
|
|
204
|
+
* @param body - One of `PLACE_BODIES`.
|
|
205
|
+
* @param kinds - The kinds wanted; none for all.
|
|
206
|
+
* @returns The places in the list's order.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```ts
|
|
210
|
+
* import { listPlaces } from "@johnmorrisdotca/wakusei-planets/places";
|
|
211
|
+
*
|
|
212
|
+
* const rovers = await listPlaces("mars", "rover");
|
|
213
|
+
* console.log(rovers.map((place) => place.name.en).join(", "));
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
export declare function listPlaces(body: PlaceBody, ...kinds: readonly PlaceKind[]): Promise<Place[]>;
|
|
217
|
+
/**
|
|
218
|
+
* The place nearest to a point on the body, by great-circle distance, or `undefined` for an empty list. Give kinds to look only among those (`"feature"` for the named surface, the others for the visited places).
|
|
219
|
+
*
|
|
220
|
+
* @param places - A body's list.
|
|
221
|
+
* @param lat - Planetocentric latitude in degrees.
|
|
222
|
+
* @param lon - East longitude in degrees.
|
|
223
|
+
* @param kinds - The kinds to look among; none for all.
|
|
224
|
+
* @returns The place and its distance in degrees at the body's centre, or `undefined` when no place of those kinds is in the list.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* import { PLACES_MOON } from "@johnmorrisdotca/wakusei-planets/places/moon";
|
|
229
|
+
* import { nearestPlace } from "@johnmorrisdotca/wakusei-planets/places";
|
|
230
|
+
*
|
|
231
|
+
* const near = nearestPlace(PLACES_MOON, 20, 30.7, "crewed", "landing", "rover");
|
|
232
|
+
* console.log(near?.place.name.en, near?.degrees.toFixed(2));
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
export declare function nearestPlace(places: readonly Place[], lat: number, lon: number, ...kinds: readonly PlaceKind[]): {
|
|
236
|
+
place: Place;
|
|
237
|
+
degrees: number;
|
|
238
|
+
} | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* 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`.
|
|
241
|
+
*
|
|
242
|
+
* @param body - A body of `PLACE_BODIES` that has a radius in `BODIES`.
|
|
243
|
+
* @param a - A place, or a latitude and east longitude.
|
|
244
|
+
* @param b - The other.
|
|
245
|
+
* @returns Kilometres.
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```ts
|
|
249
|
+
* import { PLACES_MOON } from "@johnmorrisdotca/wakusei-planets/places/moon";
|
|
250
|
+
* import { findPlace, placeDistanceKm } from "@johnmorrisdotca/wakusei-planets/places";
|
|
251
|
+
*
|
|
252
|
+
* const a = findPlace(PLACES_MOON, "Apollo 11 lunar module")!;
|
|
253
|
+
* const b = findPlace(PLACES_MOON, "Apollo 17 lunar module")!;
|
|
254
|
+
* console.log(Math.round(placeDistanceKm("moon", a, b)), "km between Tranquility Base and Taurus-Littrow");
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
export declare function placeDistanceKm(body: PlaceBody, a: Place | {
|
|
258
|
+
lat: number;
|
|
259
|
+
lon: number;
|
|
260
|
+
}, b: Place | {
|
|
261
|
+
lat: number;
|
|
262
|
+
lon: number;
|
|
263
|
+
}): number;
|
|
264
|
+
/**
|
|
265
|
+
* The great-circle angle between two points on a sphere, in degrees.
|
|
266
|
+
*
|
|
267
|
+
* @param lat1 - The first point's latitude, degrees.
|
|
268
|
+
* @param lon1 - Its longitude.
|
|
269
|
+
* @param lat2 - The second point's latitude.
|
|
270
|
+
* @param lon2 - Its longitude.
|
|
271
|
+
* @returns The angle at the centre, 0 to 180.
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* ```ts
|
|
275
|
+
* import { angleBetween } from "@johnmorrisdotca/wakusei-planets/places";
|
|
276
|
+
*
|
|
277
|
+
* console.log(angleBetween(0, 0, 0, 90), angleBetween(90, 0, -90, 0));
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
export declare function angleBetween(lat1: number, lon1: number, lat2: number, lon2: number): number;
|
|
281
|
+
/**
|
|
282
|
+
* The sub-solar point of a body at a moment: the latitude and east longitude where the Sun is overhead, from the package's own ephemeris and the body's IAU pole and prime meridian.
|
|
283
|
+
*
|
|
284
|
+
* @param id - `moon`, `mars` or any body the package has a pole and a Sun direction for.
|
|
285
|
+
* @param when - A `Date` or milliseconds since 1970 (UTC).
|
|
286
|
+
* @returns The point, in degrees.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```ts
|
|
290
|
+
* import { subSolarPoint } from "@johnmorrisdotca/wakusei-planets/places";
|
|
291
|
+
*
|
|
292
|
+
* const sun = subSolarPoint("mars", Date.UTC(2026, 10, 11, 12));
|
|
293
|
+
* console.log(sun.lat.toFixed(1), sun.lon.toFixed(1));
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
export declare function subSolarPoint(id: BodyId, when: When): {
|
|
297
|
+
lat: number;
|
|
298
|
+
lon: number;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* The terminator at a moment: points round the great circle 90 degrees from the sub-solar point, in degrees, for a line on a map or a globe. The first point is at the pole-most place of the circle
|
|
302
|
+
* and they go east from there.
|
|
303
|
+
*
|
|
304
|
+
* @param id - The body.
|
|
305
|
+
* @param when - A `Date` or milliseconds since 1970 (UTC).
|
|
306
|
+
* @param points - How many points (the first is repeated at the end).
|
|
307
|
+
* @returns The points.
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```ts
|
|
311
|
+
* import { terminator } from "@johnmorrisdotca/wakusei-planets/places";
|
|
312
|
+
*
|
|
313
|
+
* const line = terminator("moon", Date.UTC(2026, 10, 11), 8);
|
|
314
|
+
* console.log(line.length, line.map((p) => p.lat.toFixed(0)).join(" "));
|
|
315
|
+
* ```
|
|
316
|
+
*/
|
|
317
|
+
export declare function terminator(id: BodyId, when: When, points?: number): {
|
|
318
|
+
lat: number;
|
|
319
|
+
lon: number;
|
|
320
|
+
}[];
|
|
321
|
+
/**
|
|
322
|
+
* The local solar time at a place at a moment, in hours from 0 to 24: 12 where the Sun is on the meridian (the sub-solar longitude), an hour later for every 15 degrees east of it, as on the Earth.
|
|
323
|
+
*
|
|
324
|
+
* @param id - The body.
|
|
325
|
+
* @param lon - The place's east longitude, degrees.
|
|
326
|
+
* @param when - A `Date` or milliseconds since 1970 (UTC).
|
|
327
|
+
* @returns Hours, 0 to 24, of the body's own solar day.
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* ```ts
|
|
331
|
+
* import { localSolarTime, subSolarPoint } from "@johnmorrisdotca/wakusei-planets/places";
|
|
332
|
+
*
|
|
333
|
+
* const when = Date.UTC(2026, 10, 11, 12);
|
|
334
|
+
* console.log(localSolarTime("moon", subSolarPoint("moon", when).lon, when).toFixed(1), "o'clock under the Sun");
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
export declare function localSolarTime(id: BodyId, lon: number, when: When): number;
|
|
338
|
+
/**
|
|
339
|
+
* Whether the Sun is up at a place at a moment (its centre above the horizon of a smooth sphere).
|
|
340
|
+
*
|
|
341
|
+
* @param id - The body.
|
|
342
|
+
* @param lat - The place's latitude.
|
|
343
|
+
* @param lon - Its east longitude.
|
|
344
|
+
* @param when - A `Date` or milliseconds since 1970 (UTC).
|
|
345
|
+
* @returns True in daylight.
|
|
346
|
+
*
|
|
347
|
+
* @example
|
|
348
|
+
* ```ts
|
|
349
|
+
* import { isDaylight } from "@johnmorrisdotca/wakusei-planets/places";
|
|
350
|
+
*
|
|
351
|
+
* console.log(isDaylight("mars", 18.44, 77.45, Date.UTC(2026, 10, 11, 12)));
|
|
352
|
+
* ```
|
|
353
|
+
*/
|
|
354
|
+
export declare function isDaylight(id: BodyId, lat: number, lon: number, when: When): boolean;
|