@elite-dangerous-almanac/core 0.2.1 → 0.2.2
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/README.md +3 -2
- package/THIRD_PARTY_NOTICES.md +24 -2
- package/dist/astro/body-orbit.d.ts +174 -0
- package/dist/astro/body-orbit.js +1 -0
- package/dist/astro/body-orbit.js.map +1 -0
- package/dist/astro/body-physics.d.ts +228 -0
- package/dist/astro/body-physics.js +1 -0
- package/dist/astro/body-physics.js.map +1 -0
- package/dist/astro/body-rings.d.ts +223 -0
- package/dist/astro/body-rings.js +1 -0
- package/dist/astro/body-rings.js.map +1 -0
- package/dist/astro/codex-region-lookup.js +1 -1
- package/dist/astro/codex-region-lookup.js.map +1 -1
- package/dist/astro/index.d.ts +38 -1
- package/dist/astro/index.js +1 -1
- package/dist/astro/nebulae.d.ts +4 -4
- package/dist/astro/procedural-system.js +1 -1
- package/dist/astro/star-physics.d.ts +255 -0
- package/dist/astro/star-physics.js +1 -0
- package/dist/astro/star-physics.js.map +1 -0
- package/dist/body-scan-CEUYjCfH.d.ts +416 -0
- package/dist/{chunk-HUYYGTRM.js → chunk-3LZXB2MC.js} +1 -1
- package/dist/chunk-3RTUSDQF.js +1 -0
- package/dist/chunk-3RTUSDQF.js.map +1 -0
- package/dist/chunk-4OTQBHQL.js +1 -0
- package/dist/chunk-4OTQBHQL.js.map +1 -0
- package/dist/{chunk-MRTTQYT5.js → chunk-7EWZGDWY.js} +1 -1
- package/dist/{chunk-TBZJIQ5P.js → chunk-7TVFV3VO.js} +1 -1
- package/dist/chunk-7TVFV3VO.js.map +1 -0
- package/dist/chunk-7ZERP4TB.js +1 -0
- package/dist/{chunk-APEG4ZER.js.map → chunk-7ZERP4TB.js.map} +1 -1
- package/dist/chunk-B5VTFOK4.js +1 -0
- package/dist/chunk-B5VTFOK4.js.map +1 -0
- package/dist/chunk-DAQ3PJ4R.js +1 -0
- package/dist/chunk-DAQ3PJ4R.js.map +1 -0
- package/dist/chunk-GBTCWNO6.js +1 -0
- package/dist/chunk-GBTCWNO6.js.map +1 -0
- package/dist/chunk-NEXDA73Y.js +1 -0
- package/dist/chunk-NEXDA73Y.js.map +1 -0
- package/dist/chunk-P2MUFVJC.js +1 -0
- package/dist/chunk-P2MUFVJC.js.map +1 -0
- package/dist/{chunk-AAE4KZ2V.js → chunk-SS6XK336.js} +1 -1
- package/dist/{chunk-AAE4KZ2V.js.map → chunk-SS6XK336.js.map} +1 -1
- package/dist/chunk-TMXKC6JL.js +1 -0
- package/dist/chunk-TMXKC6JL.js.map +1 -0
- package/dist/chunk-ZZ376WHL.js +1 -0
- package/dist/chunk-ZZ376WHL.js.map +1 -0
- package/dist/commodities/commodities.d.ts +1 -1
- package/dist/equipment/index.js +1 -1
- package/dist/equipment/upgrade-costs.js +1 -1
- package/dist/equipment/upgrade-costs.js.map +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/materials/index.js +1 -1
- package/dist/materials/materials.d.ts +1 -1
- package/dist/materials/micro-resources-all.js +1 -1
- package/dist/materials/micro-resources.d.ts +1 -1
- package/dist/materials/micro-resources.js +1 -1
- package/dist/ships/build-metrics.d.ts +21 -232
- package/dist/ships/build-metrics.js +1 -1
- package/dist/ships/distributor.d.ts +1 -1
- package/dist/ships/heat.d.ts +1 -1
- package/dist/ships/index.d.ts +2 -2
- package/dist/ships/index.js +1 -1
- package/dist/ships/loadout-calculations.d.ts +2 -2
- package/dist/ships/mobility-capacitor.d.ts +1 -1
- package/dist/ships/modules-all.js +1 -1
- package/dist/ships/modules.d.ts +1 -1
- package/dist/ships/modules.js +1 -1
- package/dist/ships/pre-engineered-stats.d.ts +7 -5
- package/dist/ships/pre-engineered-stats.js +1 -1
- package/dist/ships/shield-capacitor.d.ts +1 -1
- package/dist/ships/shields.d.ts +1 -1
- package/dist/ships/ship-loadout.d.ts +71 -16
- package/dist/ships/ship-loadout.js +1 -1
- package/package.json +18 -3
- package/dist/chunk-6S36AVA4.js +0 -1
- package/dist/chunk-6S36AVA4.js.map +0 -1
- package/dist/chunk-APEG4ZER.js +0 -1
- package/dist/chunk-GVNTKCVF.js +0 -1
- package/dist/chunk-GVNTKCVF.js.map +0 -1
- package/dist/chunk-JET673E5.js +0 -1
- package/dist/chunk-JET673E5.js.map +0 -1
- package/dist/chunk-SG6YLUQ4.js +0 -1
- package/dist/chunk-SG6YLUQ4.js.map +0 -1
- package/dist/chunk-TBZJIQ5P.js.map +0 -1
- /package/dist/{chunk-HUYYGTRM.js.map → chunk-3LZXB2MC.js.map} +0 -0
- /package/dist/{chunk-MRTTQYT5.js.map → chunk-7EWZGDWY.js.map} +0 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { c as BodyRing, b as BodyProperties } from '../body-scan-CEUYjCfH.js';
|
|
2
|
+
import { RocheLimits } from './body-physics.js';
|
|
3
|
+
import './system-address-input.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Rings and belts: how fast they turn, how thinly their mass is spread, whether the game
|
|
7
|
+
* draws them at all, and where the material could have survived forming.
|
|
8
|
+
*
|
|
9
|
+
* Every function takes a {@link BodyRing} — one entry of a scan's
|
|
10
|
+
* {@link BodyProperties.Rings | Rings} array — and, where the maths needs the body the
|
|
11
|
+
* ring goes round, that body as a second argument. Radii are metres, as the journal
|
|
12
|
+
* writes them. Both types are exported from `../astro`.
|
|
13
|
+
*
|
|
14
|
+
* **Elite Dangerous rings are not Keplerian.** In a real ring every particle keeps its own
|
|
15
|
+
* orbit, so the inner edge outruns the outer one. The game instead turns the whole ring as
|
|
16
|
+
* one rigid sheet: a single period for all of it, which makes the *outer* edge the faster
|
|
17
|
+
* one. {@link ringDynamics} models that, and the note on it explains where its one fitted
|
|
18
|
+
* constant comes from.
|
|
19
|
+
*
|
|
20
|
+
* **`MassMT` is not an SI megatonne.** See {@link ringSurfaceDensity} before converting a
|
|
21
|
+
* ring's mass to kilograms.
|
|
22
|
+
*
|
|
23
|
+
* The maths is ported from the Canonn Research Group's
|
|
24
|
+
* [canonn-signals](https://github.com/canonn-science/canonn-signals), whose ring model is
|
|
25
|
+
* their own observational research; see
|
|
26
|
+
* [ATTRIBUTIONS.md](https://github.com/DarkSession/Elite-Dangerous-Almanac/blob/main/ATTRIBUTIONS.md).
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { ringParticleDensity } from '@elite-dangerous-almanac/core/astro/body-rings';
|
|
31
|
+
*
|
|
32
|
+
* ringParticleDensity('eRingClass_Icy'); // -> 1000
|
|
33
|
+
* ringParticleDensity('eRingClass_MetalRich'); // -> 4500
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @packageDocumentation
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Fraction of a ring's width at which its single rotation period is taken —
|
|
41
|
+
* {@link ringDynamics} explains where the figure comes from.
|
|
42
|
+
*/
|
|
43
|
+
declare const RING_NOMINAL_RADIUS_FRACTION: number;
|
|
44
|
+
/**
|
|
45
|
+
* Surface density, in Mt/km², at or above which the game draws a ring — see
|
|
46
|
+
* {@link isInvisibleRing}.
|
|
47
|
+
*/
|
|
48
|
+
declare const VISIBLE_RING_MIN_SURFACE_DENSITY = 0.1;
|
|
49
|
+
/**
|
|
50
|
+
* Width, in metres, below which a ring is drawn whatever its density — see
|
|
51
|
+
* {@link isInvisibleRing}.
|
|
52
|
+
*/
|
|
53
|
+
declare const VISIBLE_RING_MAX_WIDTH = 1000000000;
|
|
54
|
+
/** How fast a ring turns, and how fast each of its edges is therefore moving. */
|
|
55
|
+
interface RingDynamics {
|
|
56
|
+
/** The single period the whole ring turns in, in seconds. */
|
|
57
|
+
readonly orbitalPeriod: number;
|
|
58
|
+
/** The radius that period is taken at, in metres — see {@link ringDynamics}. */
|
|
59
|
+
readonly nominalRadius: number;
|
|
60
|
+
/** Speed of the inner edge, in m/s. The slower one, because the ring turns rigidly. */
|
|
61
|
+
readonly innerVelocity: number;
|
|
62
|
+
/** Speed of the outer edge, in m/s. */
|
|
63
|
+
readonly outerVelocity: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The density assumed for the particles making up a ring of a given class, in kg/m³.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* A scan reports what a ring is made of but never how dense its particles are, and the
|
|
70
|
+
* Roche limit that says where the material could have survived needs one. These are the
|
|
71
|
+
* standing assumptions the Canonn tooling uses: water ice, silicate rock, and iron-nickel
|
|
72
|
+
* metal.
|
|
73
|
+
*
|
|
74
|
+
* @param ringClass - A ring's {@link BodyRing.RingClass | RingClass} token. Matched
|
|
75
|
+
* case-insensitively on the material in the name, so both of the game's metallic
|
|
76
|
+
* spellings — `"eRingClass_MetalRich"` and the misspelt `"eRingClass_Metalic"` — resolve.
|
|
77
|
+
* @returns The assumed particle density in kg/m³: 4500 metallic, 3000 rocky, 1000 icy.
|
|
78
|
+
* An unrecognised class falls back to the icy figure, which is the game's commonest ring
|
|
79
|
+
* and its least dense — so a Roche limit computed from it is the conservative one.
|
|
80
|
+
* @throws {TypeError} If `ringClass` is not a string. This returns a density rather than
|
|
81
|
+
* reporting whether a class is known, so there is no miss for a nullish one to be.
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* import { ringParticleDensity } from '@elite-dangerous-almanac/core/astro/body-rings';
|
|
85
|
+
*
|
|
86
|
+
* ringParticleDensity('eRingClass_Rocky'); // -> 3000
|
|
87
|
+
* ringParticleDensity('eRingClass_Metalic'); // -> 4500
|
|
88
|
+
* ringParticleDensity('eRingClass_Something_New'); // -> 1000
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
declare function ringParticleDensity(ringClass: string): number;
|
|
92
|
+
/**
|
|
93
|
+
* How thinly a ring's mass is spread over the annulus it occupies, in **megatonnes per
|
|
94
|
+
* square kilometre**.
|
|
95
|
+
*
|
|
96
|
+
* @remarks
|
|
97
|
+
* `MassMT / π(r_outer² − r_inner²)`, with the radii converted to kilometres.
|
|
98
|
+
*
|
|
99
|
+
* **The unit is the journal's, deliberately.** Frontier's `MassMT` is not the SI megatonne
|
|
100
|
+
* of 10⁹ kg: the Canonn physics that calibrated the threshold below treats it as 10¹² kg,
|
|
101
|
+
* a teragram, because that is what makes ring densities and Roche limits agree with what
|
|
102
|
+
* the game shows. That is an interpretation of an undocumented field rather than a
|
|
103
|
+
* published fact, so this reports the ratio in the units the scan supplied and leaves the
|
|
104
|
+
* conversion to a caller who wants one.
|
|
105
|
+
*
|
|
106
|
+
* @param ring - The ring. Needs {@link BodyRing.MassMT | MassMT},
|
|
107
|
+
* {@link BodyRing.InnerRad | InnerRad} and {@link BodyRing.OuterRad | OuterRad}.
|
|
108
|
+
* @returns Surface density in Mt/km², or `null` when a radius is missing or the outer
|
|
109
|
+
* radius does not exceed the inner one, leaving no area to spread the mass over.
|
|
110
|
+
* @throws {TypeError} If `ring` is not an object.
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* import { ringSurfaceDensity } from '@elite-dangerous-almanac/core/astro/body-rings';
|
|
114
|
+
*
|
|
115
|
+
* // 1e13 Mt spread between 1e8 m and 2e8 m: an annulus of 3π × 10⁴ km².
|
|
116
|
+
* const ring = { Name: 'A Ring', RingClass: 'eRingClass_Icy', MassMT: 1e13, InnerRad: 1e8, OuterRad: 2e8 };
|
|
117
|
+
* ringSurfaceDensity(ring); // -> 106.1…
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
declare function ringSurfaceDensity(ring: BodyRing): number | null;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the game leaves a ring undrawn — present in the scan, invisible in the sky.
|
|
123
|
+
*
|
|
124
|
+
* @remarks
|
|
125
|
+
* A ring both very wide and very diffuse has nothing to catch the light, and the game
|
|
126
|
+
* renders nothing where the scan says a ring is. The test is Canonn's, and it is an
|
|
127
|
+
* observational heuristic rather than a rule read out of the game: wider than
|
|
128
|
+
* {@link VISIBLE_RING_MAX_WIDTH} **and** thinner than
|
|
129
|
+
* {@link VISIBLE_RING_MIN_SURFACE_DENSITY}. Either one alone still draws.
|
|
130
|
+
*
|
|
131
|
+
* @param ring - The ring. Needs the fields {@link ringSurfaceDensity} needs.
|
|
132
|
+
* @returns `true` when the ring meets both conditions. A ring whose density cannot be
|
|
133
|
+
* computed is reported as visible, because there is no evidence it is not.
|
|
134
|
+
* @throws {TypeError} If `ring` is not an object.
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* import { isInvisibleRing } from '@elite-dangerous-almanac/core/astro/body-rings';
|
|
138
|
+
*
|
|
139
|
+
* // Two million km wide and next to no mass in it.
|
|
140
|
+
* const faint = { Name: 'A Ring', RingClass: 'eRingClass_Icy', MassMT: 1e6, InnerRad: 1e9, OuterRad: 3e9 };
|
|
141
|
+
* isInvisibleRing(faint); // -> true
|
|
142
|
+
*
|
|
143
|
+
* // The same mass packed into a narrow ring is drawn.
|
|
144
|
+
* const narrow = { Name: 'A Ring', RingClass: 'eRingClass_Icy', MassMT: 1e6, InnerRad: 1e9, OuterRad: 1.1e9 };
|
|
145
|
+
* isInvisibleRing(narrow); // -> false
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
declare function isInvisibleRing(ring: BodyRing): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* The period a ring turns in and the speed of each of its edges.
|
|
151
|
+
*
|
|
152
|
+
* @remarks
|
|
153
|
+
* **The game turns a ring as one rigid sheet.** A real ring shears — every particle on its
|
|
154
|
+
* own Kepler orbit, the inner edge fastest. Elite Dangerous gives the whole ring a single
|
|
155
|
+
* period instead, so the outer edge is the fast one, which is the opposite of the physical
|
|
156
|
+
* answer and the reason this cannot be computed edge by edge.
|
|
157
|
+
*
|
|
158
|
+
* That single period is recovered by applying Kepler's third law at a *nominal radius*
|
|
159
|
+
* some way across the ring:
|
|
160
|
+
*
|
|
161
|
+
* ```text
|
|
162
|
+
* nominal = inner + (outer − inner) × 3/8
|
|
163
|
+
* T = 2π √(nominal³ / GM)
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* The `3/8` is a fitted constant, not a derivation — the Canonn Research Group arrived at
|
|
167
|
+
* it from in-game measurements, having also weighed `1/e` (≈ 0.368) and `1/φ²` (≈ 0.382),
|
|
168
|
+
* which it sits between. Two things bound how exact the result can be: the journal writes
|
|
169
|
+
* ring radii to four significant figures, and the fit is still being refined against new
|
|
170
|
+
* observations. Treat the figures as close, not exact.
|
|
171
|
+
*
|
|
172
|
+
* @param ring - The ring. Needs {@link BodyRing.InnerRad | InnerRad} and
|
|
173
|
+
* {@link BodyRing.OuterRad | OuterRad}, in metres.
|
|
174
|
+
* @param primary - The body the ring goes round. Needs a mass — see `bodyMass` in
|
|
175
|
+
* `./body-physics`.
|
|
176
|
+
* @returns The period in seconds, the nominal radius in metres and both edge speeds in
|
|
177
|
+
* m/s, or `null` when a radius or the primary's mass is missing, or the outer radius does
|
|
178
|
+
* not exceed the inner one.
|
|
179
|
+
* @throws {TypeError} If either argument is not an object.
|
|
180
|
+
* @example
|
|
181
|
+
* ```ts
|
|
182
|
+
* import { ringDynamics } from '@elite-dangerous-almanac/core/astro/body-rings';
|
|
183
|
+
*
|
|
184
|
+
* const ring = { Name: 'A Ring', RingClass: 'eRingClass_Icy', MassMT: 1e13, InnerRad: 1e8, OuterRad: 2e8 };
|
|
185
|
+
* const dynamics = ringDynamics(ring, { MassEM: 300 });
|
|
186
|
+
*
|
|
187
|
+
* dynamics?.orbitalPeriod; // -> 29296.1…
|
|
188
|
+
*
|
|
189
|
+
* // The outer edge outruns the inner one: rigid rotation, not Keplerian shear.
|
|
190
|
+
* (dynamics?.outerVelocity ?? 0) > (dynamics?.innerVelocity ?? 0); // -> true
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
declare function ringDynamics(ring: BodyRing, primary: BodyProperties): RingDynamics | null;
|
|
194
|
+
/**
|
|
195
|
+
* Roche limits around a body for material of the kind its ring is made of.
|
|
196
|
+
*
|
|
197
|
+
* @remarks
|
|
198
|
+
* Ring material inside the Roche limit could never have accreted into a moon, which is the
|
|
199
|
+
* usual account of why the ring is there at all. A ring sitting outside it wants a
|
|
200
|
+
* different explanation.
|
|
201
|
+
*
|
|
202
|
+
* The particle density is assumed from the ring's class ({@link ringParticleDensity})
|
|
203
|
+
* rather than measured, so the limits move with that assumption; the fluid limit is the
|
|
204
|
+
* one to compare a diffuse ring against.
|
|
205
|
+
*
|
|
206
|
+
* @param ring - The ring. Needs {@link BodyRing.RingClass | RingClass}.
|
|
207
|
+
* @param primary - The body it goes round. Needs a mass and a
|
|
208
|
+
* {@link BodyProperties.Radius | Radius}.
|
|
209
|
+
* @returns Both limits in metres from the primary's centre, or `null` when the primary's
|
|
210
|
+
* density cannot be computed.
|
|
211
|
+
* @throws {TypeError} If either argument is not an object, or the ring carries no
|
|
212
|
+
* `RingClass` string.
|
|
213
|
+
* @example
|
|
214
|
+
* ```ts
|
|
215
|
+
* import { ringRocheLimits } from '@elite-dangerous-almanac/core/astro/body-rings';
|
|
216
|
+
*
|
|
217
|
+
* const ring = { Name: 'A Ring', RingClass: 'eRingClass_Icy', MassMT: 1e13, InnerRad: 1e8, OuterRad: 2e8 };
|
|
218
|
+
* ringRocheLimits(ring, { MassEM: 1, Radius: 6_371_000 })?.fluid; // -> 27642167.3…
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
declare function ringRocheLimits(ring: BodyRing, primary: BodyProperties): RocheLimits | null;
|
|
222
|
+
|
|
223
|
+
export { RING_NOMINAL_RADIUS_FRACTION, type RingDynamics, VISIBLE_RING_MAX_WIDTH, VISIBLE_RING_MIN_SURFACE_DENSITY, isInvisibleRing, ringDynamics, ringParticleDensity, ringRocheLimits, ringSurfaceDensity };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{RING_NOMINAL_RADIUS_FRACTION,VISIBLE_RING_MAX_WIDTH,VISIBLE_RING_MIN_SURFACE_DENSITY,isInvisibleRing,ringDynamics,ringParticleDensity,ringRocheLimits,ringSurfaceDensity}from"../chunk-NEXDA73Y.js"; //# sourceMappingURL=body-rings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"O"}
|