@johnmorrisdotca/wakusei-planets 0.60.0 → 0.62.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 +20 -0
- package/NOTICE.md +9 -0
- package/README.md +18 -3
- package/dist/belts/filter.d.ts +128 -0
- package/dist/belts/filter.js +117 -0
- package/dist/belts/index.d.ts +2 -0
- package/dist/belts/index.js +1 -0
- package/dist/bodies/earth.js +22 -1
- package/dist/data/places-moon.d.ts +12 -9
- package/dist/data/places-moon.js +3 -3
- package/dist/element.d.ts +1 -1
- package/dist/flat/system-define.d.ts +3 -0
- package/dist/flat/system-define.js +6 -0
- package/dist/flat/system-element.d.ts +133 -0
- package/dist/flat/system-element.js +1435 -0
- package/dist/flat/system-words.d.ts +28 -0
- package/dist/flat/system-words.js +102 -0
- package/dist/flat/system.d.ts +440 -0
- package/dist/flat/system.js +521 -0
- package/dist/landing-sites.js +6 -6
- package/dist/space/travel.js +36 -5
- package/dist/surface/drive.d.ts +8 -4
- package/dist/surface/drive.js +18 -19
- package/dist/surface/dust.d.ts +2 -1
- package/dist/surface/dust.js +3 -2
- package/dist/surface/element.d.ts +41 -4
- package/dist/surface/element.js +173 -25
- package/dist/surface/flat.d.ts +34 -0
- package/dist/surface/flat.js +63 -0
- package/dist/surface/glsl.d.ts +6 -3
- package/dist/surface/glsl.js +35 -2
- package/dist/surface/height.d.ts +1 -1
- package/dist/surface/index.d.ts +4 -2
- package/dist/surface/index.js +4 -2
- package/dist/surface/land.d.ts +7 -5
- package/dist/surface/land.js +10 -8
- package/dist/surface/model.d.ts +54 -0
- package/dist/surface/model.js +147 -0
- package/dist/surface/rig.d.ts +125 -0
- package/dist/surface/rig.js +107 -0
- package/dist/surface/scene.d.ts +9 -2
- package/dist/surface/scene.js +63 -5
- package/dist/surface/site.d.ts +32 -3
- package/dist/surface/site.js +99 -2
- package/dist/surface/sky.d.ts +92 -1
- package/dist/surface/sky.js +78 -4
- package/package.json +26 -2
package/dist/surface/site.js
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
3
|
-
*
|
|
2
|
+
* The Moon's surface gravity, m/s2.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { MOON_GRAVITY } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
7
|
+
*
|
|
8
|
+
* console.log(`${MOON_GRAVITY} m/s2, a sixth of the Earth's`);
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export const MOON_GRAVITY = 1.62;
|
|
12
|
+
/**
|
|
13
|
+
* Mars's surface gravity, m/s2 (NASA's fact sheet gives 3.73 as the mean and 3.69 at the equator; 3.71 is the figure the standing view uses).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { MARS_GRAVITY, MOON_GRAVITY } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
18
|
+
*
|
|
19
|
+
* console.log(`Mars pulls ${(MARS_GRAVITY / MOON_GRAVITY).toFixed(1)} times as hard as the Moon`);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export const MARS_GRAVITY = 3.71;
|
|
23
|
+
/**
|
|
24
|
+
* The sites a person can stand at. Apollo 17 is the one with measured heights: it stands in Taurus-Littrow, a valley a few kilometres wide between mountains 2 kilometres high; it is first looked at toward the South Massif,
|
|
25
|
+
* at the moment of the landing, with the Sun 13 degrees up and the Earth above the mountain. Perseverance (Jezero), Curiosity (Gale), Apollo 15, Apollo 16, Chang'e 3 and Chang'e 4 have the real Sun, sky and gravity of
|
|
26
|
+
* their place and time and a flat stand-in for the ground (`ground: "flat"`) until a height model is added.
|
|
4
27
|
*
|
|
5
28
|
* @example
|
|
6
29
|
* ```ts
|
|
@@ -13,6 +36,8 @@ export const SURFACE_SITES = [
|
|
|
13
36
|
{
|
|
14
37
|
id: "apollo-17",
|
|
15
38
|
body: "moon",
|
|
39
|
+
ground: "measured",
|
|
40
|
+
gravity: MOON_GRAVITY,
|
|
16
41
|
name: { en: "Apollo 17, Taurus-Littrow", ja: "アポロ17号、タウルス・リットロー" },
|
|
17
42
|
lat: 20.1911,
|
|
18
43
|
lon: 30.7723,
|
|
@@ -20,6 +45,78 @@ export const SURFACE_SITES = [
|
|
|
20
45
|
time: Date.UTC(1972, 11, 11, 19, 54),
|
|
21
46
|
look: { azimuth: 232, pitch: 13, fov: 74 },
|
|
22
47
|
},
|
|
48
|
+
{
|
|
49
|
+
id: "perseverance",
|
|
50
|
+
body: "mars",
|
|
51
|
+
ground: "flat",
|
|
52
|
+
gravity: MARS_GRAVITY,
|
|
53
|
+
name: { en: "Perseverance, Jezero", ja: "パーシビアランス、ジェゼロ・クレーター" },
|
|
54
|
+
lat: 18.4446,
|
|
55
|
+
lon: 77.4508,
|
|
56
|
+
place: "mars/perseverance",
|
|
57
|
+
time: Date.UTC(2021, 1, 18, 20, 43),
|
|
58
|
+
look: { azimuth: 90, pitch: 4, fov: 74 },
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: "curiosity",
|
|
62
|
+
body: "mars",
|
|
63
|
+
ground: "flat",
|
|
64
|
+
gravity: MARS_GRAVITY,
|
|
65
|
+
name: { en: "Curiosity, Gale", ja: "キュリオシティ、ゲール・クレーター" },
|
|
66
|
+
lat: -4.5895,
|
|
67
|
+
lon: 137.4417,
|
|
68
|
+
place: "mars/curiosity",
|
|
69
|
+
time: Date.UTC(2012, 7, 6, 5, 17),
|
|
70
|
+
look: { azimuth: 90, pitch: 4, fov: 74 },
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "apollo-15",
|
|
74
|
+
body: "moon",
|
|
75
|
+
ground: "flat",
|
|
76
|
+
gravity: MOON_GRAVITY,
|
|
77
|
+
name: { en: "Apollo 15, Hadley-Apennine", ja: "アポロ15号、ハドレー谷とアペニン山脈" },
|
|
78
|
+
lat: 26.1324,
|
|
79
|
+
lon: 3.6333,
|
|
80
|
+
place: "moon/apollo-15-lunar-module",
|
|
81
|
+
time: Date.UTC(1971, 6, 30, 22, 16),
|
|
82
|
+
look: { azimuth: 90, pitch: 4, fov: 74 },
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "apollo-16",
|
|
86
|
+
body: "moon",
|
|
87
|
+
ground: "flat",
|
|
88
|
+
gravity: MOON_GRAVITY,
|
|
89
|
+
name: { en: "Apollo 16, Descartes", ja: "アポロ16号、デカルト高地" },
|
|
90
|
+
lat: -8.9734,
|
|
91
|
+
lon: 15.5011,
|
|
92
|
+
place: "moon/apollo-16-lunar-module",
|
|
93
|
+
time: Date.UTC(1972, 3, 21, 2, 23),
|
|
94
|
+
look: { azimuth: 90, pitch: 4, fov: 74 },
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
id: "chang-e-3",
|
|
98
|
+
body: "moon",
|
|
99
|
+
ground: "flat",
|
|
100
|
+
gravity: MOON_GRAVITY,
|
|
101
|
+
name: { en: "Chang'e 3 and Yutu, Mare Imbrium", ja: "嫦娥3号と玉兎号、雨の海" },
|
|
102
|
+
lat: 44.1214,
|
|
103
|
+
lon: -19.5117,
|
|
104
|
+
place: "moon/chang-e-3",
|
|
105
|
+
time: Date.UTC(2013, 11, 14, 13, 11),
|
|
106
|
+
look: { azimuth: 90, pitch: 4, fov: 74 },
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: "chang-e-4",
|
|
110
|
+
body: "moon",
|
|
111
|
+
ground: "flat",
|
|
112
|
+
gravity: MOON_GRAVITY,
|
|
113
|
+
name: { en: "Chang'e 4 and Yutu-2, Von Kármán", ja: "嫦娥4号と玉兎2号、フォン・カルマン・クレーター" },
|
|
114
|
+
lat: -45.4561,
|
|
115
|
+
lon: 177.5885,
|
|
116
|
+
place: "moon/chang-e-4",
|
|
117
|
+
time: Date.UTC(2019, 0, 3, 2, 26),
|
|
118
|
+
look: { azimuth: 90, pitch: 4, fov: 74 },
|
|
119
|
+
},
|
|
23
120
|
];
|
|
24
121
|
/**
|
|
25
122
|
* A site by name, or `undefined`.
|
package/dist/surface/sky.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export interface MoonSky {
|
|
|
44
44
|
* @param lat - Latitude in degrees, positive north.
|
|
45
45
|
* @param lon - Longitude in degrees, positive east.
|
|
46
46
|
* @param time - Milliseconds since 1970.
|
|
47
|
+
* @param body - `moon` (the default) or `mars`; on Mars `[0, 0, 1]` is toward the Earth too, the frame being the viewer's.
|
|
47
48
|
* @returns The axes, and `toLocal`, which turns a vector of that frame into east, north and up.
|
|
48
49
|
*
|
|
49
50
|
* @example
|
|
@@ -54,7 +55,7 @@ export interface MoonSky {
|
|
|
54
55
|
* console.log(frame.toLocal([0, 0, 1]).map((n) => n.toFixed(2)).join(", "));
|
|
55
56
|
* ```
|
|
56
57
|
*/
|
|
57
|
-
export declare function localFrame(lat: number, lon: number, time: number): {
|
|
58
|
+
export declare function localFrame(lat: number, lon: number, time: number, body?: "moon" | "mars"): {
|
|
58
59
|
east: Vec3;
|
|
59
60
|
north: Vec3;
|
|
60
61
|
up: Vec3;
|
|
@@ -79,3 +80,93 @@ export declare function localFrame(lat: number, lon: number, time: number): {
|
|
|
79
80
|
* ```
|
|
80
81
|
*/
|
|
81
82
|
export declare function moonSky(lat: number, lon: number, time: number): MoonSky;
|
|
83
|
+
/**
|
|
84
|
+
* A colour as red, green and blue, 0 to 1, in linear light.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* import { marsAir, type Rgb } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
89
|
+
*
|
|
90
|
+
* const zenith: Rgb = marsAir(40).zenith;
|
|
91
|
+
* console.log(zenith.map((c) => c.toFixed(2)).join(", "));
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export type Rgb = readonly [number, number, number];
|
|
95
|
+
/**
|
|
96
|
+
* The air over a site, for a body that has some (Mars): the colours of the sky and the light the ground gets from it. All are stylised from a few facts, not measured: NASA says the Martian sky is hazy and
|
|
97
|
+
* reddish-tan by day from suspended dust; the pale blue round the Sun when it is low, and the long twilight, are chosen here, not taken from a measurement.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* import { marsAir } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
102
|
+
*
|
|
103
|
+
* const noon = marsAir(60);
|
|
104
|
+
* const dusk = marsAir(2);
|
|
105
|
+
* console.log(noon.glowSize > dusk.glowSize, marsAir(-30).daylight);
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export interface SkyAir {
|
|
109
|
+
/** 0 (night) to 1 (full day): the share of day the sky shows. */
|
|
110
|
+
daylight: number;
|
|
111
|
+
/** The sky at the horizon, at the zenith and round the Sun, already scaled by the daylight. */
|
|
112
|
+
horizon: Rgb;
|
|
113
|
+
zenith: Rgb;
|
|
114
|
+
glow: Rgb;
|
|
115
|
+
/** The glow's width as the sine of its half angle. */
|
|
116
|
+
glowSize: number;
|
|
117
|
+
/** The share of a lit slope's light the shade gets from the sky (the ground's `uEarthshine`); 0.05 on the Moon. */
|
|
118
|
+
ambient: number;
|
|
119
|
+
/** The ground's colour over its grey. */
|
|
120
|
+
tint: Rgb;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* The sky colours of Mars for a height of the Sun: butterscotch by day, a blue glow round a low Sun, black at night, with a twilight that lasts until the Sun is about 12 degrees down (dust holds the light).
|
|
124
|
+
*
|
|
125
|
+
* @param sunAltitude - The Sun's height over the horizon in degrees.
|
|
126
|
+
* @returns The colours and the light the sky gives the ground.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* import { marsAir } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
131
|
+
*
|
|
132
|
+
* const air = marsAir(25);
|
|
133
|
+
* console.log(air.daylight.toFixed(2), air.zenith.map((c) => c.toFixed(2)).join(" "));
|
|
134
|
+
* ```
|
|
135
|
+
*/
|
|
136
|
+
export declare function marsAir(sunAltitude: number): SkyAir;
|
|
137
|
+
/**
|
|
138
|
+
* What a standing view's sky holds: the Moon's (the Sun and the Earth, no air) or Mars's (the Sun, the Earth as a point, and the air).
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* import { standSky, type StandSky } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
143
|
+
*
|
|
144
|
+
* const sky: StandSky = standSky("mars", 18.4446, 77.4508, Date.UTC(2021, 1, 18, 20, 43));
|
|
145
|
+
* console.log(sky.body, sky.air !== null, `${sky.sunDiameter.toFixed(2)} degrees`);
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export interface StandSky extends MoonSky {
|
|
149
|
+
body: "moon" | "mars";
|
|
150
|
+
/** The air, or `null` where there is none (the Moon: a black sky). */
|
|
151
|
+
air: SkyAir | null;
|
|
152
|
+
/** Whether the Earth is drawn as a disc (the Moon's sky has it 1.9 degrees across; from Mars it is a point). */
|
|
153
|
+
earthDisc: boolean;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The sky at a point on the Moon or Mars at a moment, from the package's own ephemeris. On Mars the Sun's disc is its size from Mars's own distance (about 0.35 degrees, 0.533 over its distance in astronomical units).
|
|
157
|
+
*
|
|
158
|
+
* @param body - `moon` or `mars`.
|
|
159
|
+
* @param lat - Latitude in degrees, positive north.
|
|
160
|
+
* @param lon - Longitude in degrees, positive east.
|
|
161
|
+
* @param time - Milliseconds since 1970.
|
|
162
|
+
* @returns The Sun, the Earth, and the air.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```ts
|
|
166
|
+
* import { standSky } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
167
|
+
*
|
|
168
|
+
* const sky = standSky("mars", -4.5895, 137.4417, Date.UTC(2012, 7, 6, 5, 17));
|
|
169
|
+
* console.log(`the Sun is ${sky.sun.altitude.toFixed(0)} degrees up and ${sky.sunDiameter.toFixed(2)} degrees across`);
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
export declare function standSky(body: "moon" | "mars", lat: number, lon: number, time: number): StandSky;
|
package/dist/surface/sky.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// The sky as a person standing on the Moon sees it: where the Sun and the Earth are, and how much of the Earth is lit. Pure: no DOM, no clock; the date is an argument.
|
|
2
|
-
import { apparent } from "../ephemeris.js";
|
|
2
|
+
import { apparent, heliocentric } from "../ephemeris.js";
|
|
3
3
|
import { surfacePoint } from "../pose.js";
|
|
4
|
-
import { cross, dot, unit, DEG } from "../vec.js";
|
|
4
|
+
import { cross, dot, length, unit, DEG } from "../vec.js";
|
|
5
5
|
const direction = (enu) => ({
|
|
6
6
|
enu,
|
|
7
7
|
azimuth: (Math.atan2(enu[0], enu[1]) * DEG + 360) % 360,
|
|
@@ -13,6 +13,7 @@ const direction = (enu) => ({
|
|
|
13
13
|
* @param lat - Latitude in degrees, positive north.
|
|
14
14
|
* @param lon - Longitude in degrees, positive east.
|
|
15
15
|
* @param time - Milliseconds since 1970.
|
|
16
|
+
* @param body - `moon` (the default) or `mars`; on Mars `[0, 0, 1]` is toward the Earth too, the frame being the viewer's.
|
|
16
17
|
* @returns The axes, and `toLocal`, which turns a vector of that frame into east, north and up.
|
|
17
18
|
*
|
|
18
19
|
* @example
|
|
@@ -23,8 +24,8 @@ const direction = (enu) => ({
|
|
|
23
24
|
* console.log(frame.toLocal([0, 0, 1]).map((n) => n.toFixed(2)).join(", "));
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
|
-
export function localFrame(lat, lon, time) {
|
|
27
|
-
const moon = apparent(
|
|
27
|
+
export function localFrame(lat, lon, time, body = "moon") {
|
|
28
|
+
const moon = apparent(body, time);
|
|
28
29
|
const up = surfacePoint(moon, lon, lat);
|
|
29
30
|
const east = unit(cross(moon.pole, up));
|
|
30
31
|
const north = cross(up, east);
|
|
@@ -58,3 +59,76 @@ export function moonSky(lat, lon, time) {
|
|
|
58
59
|
earthIllumination: (1 - dot(sun, earth)) / 2,
|
|
59
60
|
};
|
|
60
61
|
}
|
|
62
|
+
const smooth = (a, b, x) => {
|
|
63
|
+
const t = Math.min(1, Math.max(0, (x - a) / (b - a)));
|
|
64
|
+
return t * t * (3 - 2 * t);
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The sky colours of Mars for a height of the Sun: butterscotch by day, a blue glow round a low Sun, black at night, with a twilight that lasts until the Sun is about 12 degrees down (dust holds the light).
|
|
68
|
+
*
|
|
69
|
+
* @param sunAltitude - The Sun's height over the horizon in degrees.
|
|
70
|
+
* @returns The colours and the light the sky gives the ground.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* import { marsAir } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
75
|
+
*
|
|
76
|
+
* const air = marsAir(25);
|
|
77
|
+
* console.log(air.daylight.toFixed(2), air.zenith.map((c) => c.toFixed(2)).join(" "));
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export function marsAir(sunAltitude) {
|
|
81
|
+
const day = smooth(-12, 8, sunAltitude);
|
|
82
|
+
const low = 1 - smooth(2, 28, sunAltitude); // 1 with the Sun at the horizon: the blue glow
|
|
83
|
+
const horizon = [0.62, 0.40, 0.26];
|
|
84
|
+
const zenith = [0.30, 0.17, 0.10];
|
|
85
|
+
const tan = [0.75, 0.50, 0.34];
|
|
86
|
+
const blue = [0.16, 0.32, 0.62];
|
|
87
|
+
const mix = (a, b, t) => [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t, a[2] + (b[2] - a[2]) * t];
|
|
88
|
+
const k = (c) => [c[0] * day, c[1] * day, c[2] * day];
|
|
89
|
+
return {
|
|
90
|
+
daylight: day,
|
|
91
|
+
horizon: k(horizon),
|
|
92
|
+
zenith: k(zenith),
|
|
93
|
+
glow: k(mix(tan, blue, low)),
|
|
94
|
+
glowSize: 0.12 + 0.2 * (1 - low),
|
|
95
|
+
ambient: 0.05 + 0.22 * day,
|
|
96
|
+
tint: [1.0, 0.72, 0.5],
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The sky at a point on the Moon or Mars at a moment, from the package's own ephemeris. On Mars the Sun's disc is its size from Mars's own distance (about 0.35 degrees, 0.533 over its distance in astronomical units).
|
|
101
|
+
*
|
|
102
|
+
* @param body - `moon` or `mars`.
|
|
103
|
+
* @param lat - Latitude in degrees, positive north.
|
|
104
|
+
* @param lon - Longitude in degrees, positive east.
|
|
105
|
+
* @param time - Milliseconds since 1970.
|
|
106
|
+
* @returns The Sun, the Earth, and the air.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* import { standSky } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
111
|
+
*
|
|
112
|
+
* const sky = standSky("mars", -4.5895, 137.4417, Date.UTC(2012, 7, 6, 5, 17));
|
|
113
|
+
* console.log(`the Sun is ${sky.sun.altitude.toFixed(0)} degrees up and ${sky.sunDiameter.toFixed(2)} degrees across`);
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export function standSky(body, lat, lon, time) {
|
|
117
|
+
if (body === "moon")
|
|
118
|
+
return { ...moonSky(lat, lon, time), body, air: null, earthDisc: true };
|
|
119
|
+
const frame = localFrame(lat, lon, time, "mars");
|
|
120
|
+
const sun = frame.toLocal(unit(frame.light));
|
|
121
|
+
const earth = frame.toLocal([0, 0, 1]);
|
|
122
|
+
const sunAu = length(heliocentric("mars", time));
|
|
123
|
+
const sunDirection = direction(sun);
|
|
124
|
+
return {
|
|
125
|
+
body,
|
|
126
|
+
sun: sunDirection,
|
|
127
|
+
sunDiameter: 0.533 / sunAu,
|
|
128
|
+
earth: direction(earth),
|
|
129
|
+
earthDiameter: 0.003,
|
|
130
|
+
earthIllumination: (1 - dot(sun, earth)) / 2,
|
|
131
|
+
air: marsAir(sunDirection.altitude),
|
|
132
|
+
earthDisc: false,
|
|
133
|
+
};
|
|
134
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/wakusei-planets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.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",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"neptune",
|
|
20
20
|
"pluto",
|
|
21
21
|
"dwarf-planets",
|
|
22
|
+
"asteroids",
|
|
23
|
+
"comets",
|
|
24
|
+
"stars",
|
|
22
25
|
"astronomy",
|
|
23
26
|
"ephemeris",
|
|
24
27
|
"heliocentric",
|
|
@@ -93,6 +96,7 @@
|
|
|
93
96
|
"./dist/space/element.js",
|
|
94
97
|
"./dist/plan/element.js",
|
|
95
98
|
"./dist/flat/define.js",
|
|
99
|
+
"./dist/flat/system-define.js",
|
|
96
100
|
"./dist/surface/element.js",
|
|
97
101
|
"./dist/surface/land.js",
|
|
98
102
|
"./dist/earth-places.js",
|
|
@@ -105,6 +109,7 @@
|
|
|
105
109
|
"./src/space/element.ts",
|
|
106
110
|
"./src/plan/element.ts",
|
|
107
111
|
"./src/flat/define.ts",
|
|
112
|
+
"./src/flat/system-define.ts",
|
|
108
113
|
"./src/surface/element.ts",
|
|
109
114
|
"./src/surface/land.ts",
|
|
110
115
|
"./src/earth-places.ts",
|
|
@@ -166,6 +171,16 @@
|
|
|
166
171
|
"import": "./dist/flat/define.js",
|
|
167
172
|
"default": "./dist/flat/define.js"
|
|
168
173
|
},
|
|
174
|
+
"./flat/system": {
|
|
175
|
+
"types": "./dist/flat/system.d.ts",
|
|
176
|
+
"import": "./dist/flat/system.js",
|
|
177
|
+
"default": "./dist/flat/system.js"
|
|
178
|
+
},
|
|
179
|
+
"./flat/system/define": {
|
|
180
|
+
"types": "./dist/flat/system-define.d.ts",
|
|
181
|
+
"import": "./dist/flat/system-define.js",
|
|
182
|
+
"default": "./dist/flat/system-define.js"
|
|
183
|
+
},
|
|
169
184
|
"./surface": {
|
|
170
185
|
"types": "./dist/surface/index.d.ts",
|
|
171
186
|
"import": "./dist/surface/index.js",
|
|
@@ -176,6 +191,11 @@
|
|
|
176
191
|
"import": "./dist/surface/element.js",
|
|
177
192
|
"default": "./dist/surface/element.js"
|
|
178
193
|
},
|
|
194
|
+
"./surface/model": {
|
|
195
|
+
"types": "./dist/surface/model.d.ts",
|
|
196
|
+
"import": "./dist/surface/model.js",
|
|
197
|
+
"default": "./dist/surface/model.js"
|
|
198
|
+
},
|
|
179
199
|
"./surface/land": {
|
|
180
200
|
"types": "./dist/surface/land.d.ts",
|
|
181
201
|
"import": "./dist/surface/land.js",
|
|
@@ -620,8 +640,12 @@
|
|
|
620
640
|
"lint": "eslint .",
|
|
621
641
|
"typecheck": "tsc -p tsconfig.check.json && tsc -p tsconfig.tools.json && tsc -p tsconfig.demo.json",
|
|
622
642
|
"test": "node --test test/*.test.ts",
|
|
643
|
+
"test:coverage": "node --test --experimental-test-coverage --test-coverage-include='src/**' --test-coverage-lines=96 --test-coverage-branches=93 --test-coverage-functions=95 test/*.test.ts",
|
|
644
|
+
"size:budget": "node scripts/check-size.mjs",
|
|
645
|
+
"size:budget:update": "node scripts/check-size.mjs --write",
|
|
646
|
+
"api:update": "node scripts/api-surface.mjs --write",
|
|
623
647
|
"test:package": "pnpm build && node scripts/check-package.ts",
|
|
624
|
-
"check": "pnpm lint && pnpm typecheck && pnpm test && pnpm build && node scripts/check-package.ts",
|
|
648
|
+
"check": "pnpm lint && pnpm typecheck && pnpm test:coverage && pnpm build && node scripts/check-package.ts && pnpm size:budget",
|
|
625
649
|
"prepublishOnly": "pnpm check",
|
|
626
650
|
"tiles": ".cache/venv/bin/python -I scripts/make-body-tiles.py build",
|
|
627
651
|
"tiles:moon": ".cache/venv/bin/python -I scripts/make-body-tiles.py sharp --bodies moon",
|