@interstellar-tools/equations 0.61.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/LICENSE +21 -0
- package/dist/categories/orbits/circular-speed.d.ts +14 -0
- package/dist/categories/orbits/circular-speed.d.ts.map +1 -1
- package/dist/categories/orbits/circular-speed.js +14 -0
- package/dist/categories/orbits/circular-speed.js.map +1 -1
- package/dist/categories/orbits/cw-hill-derivatives.d.ts +1 -1
- package/dist/categories/orbits/cw-hill-derivatives.js +1 -1
- package/dist/categories/orbits/escape-speed.d.ts +16 -0
- package/dist/categories/orbits/escape-speed.d.ts.map +1 -1
- package/dist/categories/orbits/escape-speed.js +16 -0
- package/dist/categories/orbits/escape-speed.js.map +1 -1
- package/dist/categories/orbits/hyperbolic-periapsis-speed.d.ts +4 -4
- package/dist/categories/orbits/hyperbolic-periapsis-speed.js +10 -10
- package/dist/categories/orbits/kepler-period.d.ts +15 -0
- package/dist/categories/orbits/kepler-period.d.ts.map +1 -1
- package/dist/categories/orbits/kepler-period.js +15 -0
- package/dist/categories/orbits/kepler-period.js.map +1 -1
- package/dist/categories/orbits/mean-motion.d.ts +20 -5
- package/dist/categories/orbits/mean-motion.d.ts.map +1 -1
- package/dist/categories/orbits/mean-motion.js +24 -9
- package/dist/categories/orbits/mean-motion.js.map +1 -1
- package/dist/categories/orbits/peri-apoapsis-radii.d.ts +17 -0
- package/dist/categories/orbits/peri-apoapsis-radii.d.ts.map +1 -1
- package/dist/categories/orbits/peri-apoapsis-radii.js +17 -0
- package/dist/categories/orbits/peri-apoapsis-radii.js.map +1 -1
- package/dist/categories/orbits/specific-mechanical-energy.d.ts +20 -0
- package/dist/categories/orbits/specific-mechanical-energy.d.ts.map +1 -1
- package/dist/categories/orbits/specific-mechanical-energy.js +20 -0
- package/dist/categories/orbits/specific-mechanical-energy.js.map +1 -1
- package/dist/categories/orbits/sphere-of-influence-radius.d.ts +17 -0
- package/dist/categories/orbits/sphere-of-influence-radius.d.ts.map +1 -1
- package/dist/categories/orbits/sphere-of-influence-radius.js +17 -0
- package/dist/categories/orbits/sphere-of-influence-radius.js.map +1 -1
- package/dist/categories/orbits/vis-viva-speed.d.ts +19 -0
- package/dist/categories/orbits/vis-viva-speed.d.ts.map +1 -1
- package/dist/categories/orbits/vis-viva-speed.js +19 -0
- package/dist/categories/orbits/vis-viva-speed.js.map +1 -1
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Alexander Vassbotn Røyne-Helgesen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -21,6 +21,20 @@
|
|
|
21
21
|
*
|
|
22
22
|
* :::
|
|
23
23
|
*
|
|
24
|
+
* ::: practice The International Space Station
|
|
25
|
+
*
|
|
26
|
+
* **7.66 km/s**
|
|
27
|
+
*
|
|
28
|
+
* _Circular speed at 420 km altitude_
|
|
29
|
+
*
|
|
30
|
+
* That's about 27 600 km/h, fast enough to circle Earth every 93 minutes.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* circularSpeed(6.371e6 + 420e3, 3.986004418e14); // ≈ 7661 m/s
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* :::
|
|
37
|
+
*
|
|
24
38
|
* @param {number} r Orbital radius ($ r $) (m), must be finite and **> 0**.
|
|
25
39
|
* @param {number} mu Gravitational parameter ($ \mu $) (m³/s²), must be finite and **≥ 0**.
|
|
26
40
|
* @returns {number} Circular speed ($ v_c $) (m/s).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circular-speed.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/circular-speed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"circular-speed.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/circular-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,MAAM,EAAE,IAAI,MAAM,KAAG,MAUrD,CAAC"}
|
|
@@ -21,6 +21,20 @@
|
|
|
21
21
|
*
|
|
22
22
|
* :::
|
|
23
23
|
*
|
|
24
|
+
* ::: practice The International Space Station
|
|
25
|
+
*
|
|
26
|
+
* **7.66 km/s**
|
|
27
|
+
*
|
|
28
|
+
* _Circular speed at 420 km altitude_
|
|
29
|
+
*
|
|
30
|
+
* That's about 27 600 km/h, fast enough to circle Earth every 93 minutes.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* circularSpeed(6.371e6 + 420e3, 3.986004418e14); // ≈ 7661 m/s
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* :::
|
|
37
|
+
*
|
|
24
38
|
* @param {number} r Orbital radius ($ r $) (m), must be finite and **> 0**.
|
|
25
39
|
* @param {number} mu Gravitational parameter ($ \mu $) (m³/s²), must be finite and **≥ 0**.
|
|
26
40
|
* @returns {number} Circular speed ($ v_c $) (m/s).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circular-speed.js","sourceRoot":"","sources":["../../../src/categories/orbits/circular-speed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"circular-speed.js","sourceRoot":"","sources":["../../../src/categories/orbits/circular-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAS,EAAE,EAAU,EAAU,EAAE;IAC7D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC3B,CAAC,CAAC"}
|
|
@@ -56,7 +56,7 @@ import { CwState, CwStateDerivative } from '@interstellar-tools/types';
|
|
|
56
56
|
*
|
|
57
57
|
* const mu = 398600.4418; // km³/s²
|
|
58
58
|
* const a = 7000; // km
|
|
59
|
-
* const n = meanMotion(
|
|
59
|
+
* const n = meanMotion(a, mu); // rad/s
|
|
60
60
|
*
|
|
61
61
|
* const s: CwState = [100, 0, 0, 0, 0.01, 0];
|
|
62
62
|
* const ds = cwHillDerivatives(s, n);
|
|
@@ -22,6 +22,22 @@
|
|
|
22
22
|
*
|
|
23
23
|
* :::
|
|
24
24
|
*
|
|
25
|
+
* ::: practice Leaving Earth
|
|
26
|
+
*
|
|
27
|
+
* **11.19 km/s**
|
|
28
|
+
*
|
|
29
|
+
* _Escape speed at Earth's surface_
|
|
30
|
+
*
|
|
31
|
+
* That's √2 times the 7.91 km/s it takes to orbit just above the surface, which
|
|
32
|
+
* is why a rocket for the Moon or Mars is so much bigger than one for low Earth
|
|
33
|
+
* orbit.
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* escapeSpeed(6.371e6, 3.986004418e14); // ≈ 11 186 m/s
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* :::
|
|
40
|
+
*
|
|
25
41
|
* @param {number} r Radius ($ r $) (m), distance from the central body’s center (must be finite and **> 0**).
|
|
26
42
|
* @param {number} mu Gravitational parameter ($ \mu $) (m³/s²), must be finite and **≥ 0**.
|
|
27
43
|
* @returns {number} Escape speed ($ v_{\text{esc}} $) (m/s).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escape-speed.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/escape-speed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"escape-speed.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/escape-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,EAAE,IAAI,MAAM,KAAG,MAUnD,CAAC"}
|
|
@@ -22,6 +22,22 @@
|
|
|
22
22
|
*
|
|
23
23
|
* :::
|
|
24
24
|
*
|
|
25
|
+
* ::: practice Leaving Earth
|
|
26
|
+
*
|
|
27
|
+
* **11.19 km/s**
|
|
28
|
+
*
|
|
29
|
+
* _Escape speed at Earth's surface_
|
|
30
|
+
*
|
|
31
|
+
* That's √2 times the 7.91 km/s it takes to orbit just above the surface, which
|
|
32
|
+
* is why a rocket for the Moon or Mars is so much bigger than one for low Earth
|
|
33
|
+
* orbit.
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* escapeSpeed(6.371e6, 3.986004418e14); // ≈ 11 186 m/s
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* :::
|
|
40
|
+
*
|
|
25
41
|
* @param {number} r Radius ($ r $) (m), distance from the central body’s center (must be finite and **> 0**).
|
|
26
42
|
* @param {number} mu Gravitational parameter ($ \mu $) (m³/s²), must be finite and **≥ 0**.
|
|
27
43
|
* @returns {number} Escape speed ($ v_{\text{esc}} $) (m/s).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escape-speed.js","sourceRoot":"","sources":["../../../src/categories/orbits/escape-speed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"escape-speed.js","sourceRoot":"","sources":["../../../src/categories/orbits/escape-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAS,EAAE,EAAU,EAAU,EAAE;IAC3D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC"}
|
|
@@ -16,19 +16,19 @@
|
|
|
16
16
|
* - If $ \mu $ is in km³/s², then $r_p$ must be in km and speeds are in km/s.
|
|
17
17
|
*
|
|
18
18
|
* @param vInfinity Hyperbolic excess speed $ v_{\infty} $ (must be finite, >= 0).
|
|
19
|
-
* @param mu Standard gravitational parameter $ \mu $ (must be finite, > 0).
|
|
20
19
|
* @param rp Periapsis radius $ r_p $ from the central body's center (must be finite, > 0).
|
|
20
|
+
* @param mu Standard gravitational parameter $ \mu $ (must be finite, > 0).
|
|
21
21
|
* @returns Periapsis speed $ v_p $ in the same speed units as `vInfinity`.
|
|
22
22
|
* @throws {TypeError} If any input is not finite.
|
|
23
|
-
* @throws {RangeError} If `vInfinity < 0`, `
|
|
23
|
+
* @throws {RangeError} If `vInfinity < 0`, `rp <= 0`, or `mu <= 0`.
|
|
24
24
|
* @group Orbits
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```ts
|
|
28
28
|
* // Earth example (km-based):
|
|
29
29
|
* // mu = 398600.4418 km³/s², rp ~ 6678 km (LEO-ish), v∞ = 3.2 km/s
|
|
30
|
-
* const vp = hyperbolicPeriapsisSpeed(3.2, 398600.4418
|
|
30
|
+
* const vp = hyperbolicPeriapsisSpeed(3.2, 6678, 398600.4418);
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
|
-
export declare const hyperbolicPeriapsisSpeed: (vInfinity: number,
|
|
33
|
+
export declare const hyperbolicPeriapsisSpeed: (vInfinity: number, rp: number, mu: number) => number;
|
|
34
34
|
//# sourceMappingURL=hyperbolic-periapsis-speed.d.ts.map
|
|
@@ -17,40 +17,40 @@
|
|
|
17
17
|
* - If $ \mu $ is in km³/s², then $r_p$ must be in km and speeds are in km/s.
|
|
18
18
|
*
|
|
19
19
|
* @param vInfinity Hyperbolic excess speed $ v_{\infty} $ (must be finite, >= 0).
|
|
20
|
-
* @param mu Standard gravitational parameter $ \mu $ (must be finite, > 0).
|
|
21
20
|
* @param rp Periapsis radius $ r_p $ from the central body's center (must be finite, > 0).
|
|
21
|
+
* @param mu Standard gravitational parameter $ \mu $ (must be finite, > 0).
|
|
22
22
|
* @returns Periapsis speed $ v_p $ in the same speed units as `vInfinity`.
|
|
23
23
|
* @throws {TypeError} If any input is not finite.
|
|
24
|
-
* @throws {RangeError} If `vInfinity < 0`, `
|
|
24
|
+
* @throws {RangeError} If `vInfinity < 0`, `rp <= 0`, or `mu <= 0`.
|
|
25
25
|
* @group Orbits
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```ts
|
|
29
29
|
* // Earth example (km-based):
|
|
30
30
|
* // mu = 398600.4418 km³/s², rp ~ 6678 km (LEO-ish), v∞ = 3.2 km/s
|
|
31
|
-
* const vp = hyperbolicPeriapsisSpeed(3.2, 398600.4418
|
|
31
|
+
* const vp = hyperbolicPeriapsisSpeed(3.2, 6678, 398600.4418);
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
/* node:coverage enable */
|
|
35
|
-
export const hyperbolicPeriapsisSpeed = (vInfinity,
|
|
35
|
+
export const hyperbolicPeriapsisSpeed = (vInfinity, rp, mu) => {
|
|
36
36
|
if (!Number.isFinite(vInfinity)) {
|
|
37
37
|
throw new TypeError(`vInfinity must be a finite number. Received: ${vInfinity}`);
|
|
38
38
|
}
|
|
39
|
-
if (!Number.isFinite(mu)) {
|
|
40
|
-
throw new TypeError(`mu must be a finite number. Received: ${mu}`);
|
|
41
|
-
}
|
|
42
39
|
if (!Number.isFinite(rp)) {
|
|
43
40
|
throw new TypeError(`rp must be a finite number. Received: ${rp}`);
|
|
44
41
|
}
|
|
42
|
+
if (!Number.isFinite(mu)) {
|
|
43
|
+
throw new TypeError(`mu must be a finite number. Received: ${mu}`);
|
|
44
|
+
}
|
|
45
45
|
if (vInfinity < 0) {
|
|
46
46
|
throw new RangeError(`vInfinity must be >= 0. Received: ${vInfinity}`);
|
|
47
47
|
}
|
|
48
|
-
if (mu <= 0) {
|
|
49
|
-
throw new RangeError(`mu must be > 0. Received: ${mu}`);
|
|
50
|
-
}
|
|
51
48
|
if (rp <= 0) {
|
|
52
49
|
throw new RangeError(`rp must be > 0. Received: ${rp}`);
|
|
53
50
|
}
|
|
51
|
+
if (mu <= 0) {
|
|
52
|
+
throw new RangeError(`mu must be > 0. Received: ${mu}`);
|
|
53
|
+
}
|
|
54
54
|
const term = vInfinity * vInfinity + (2 * mu) / rp;
|
|
55
55
|
// With valid ranges above, term should be positive, but guard anyway.
|
|
56
56
|
if (term < 0) {
|
|
@@ -18,6 +18,21 @@
|
|
|
18
18
|
*
|
|
19
19
|
* :::
|
|
20
20
|
*
|
|
21
|
+
* ::: practice Geostationary orbit
|
|
22
|
+
*
|
|
23
|
+
* **23.93 h**
|
|
24
|
+
*
|
|
25
|
+
* _Orbital period 42 164 km from Earth's centre_
|
|
26
|
+
*
|
|
27
|
+
* That's one sidereal day, the time Earth takes to turn once relative to the
|
|
28
|
+
* stars, so a satellite there stays over the same spot on the equator.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* keplerPeriod(42164e3, 3.986004418e14); // ≈ 86 164 s
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* :::
|
|
35
|
+
*
|
|
21
36
|
* @param {number} a Semi-major axis (m), must be finite and **> 0**.
|
|
22
37
|
* @param {number} mu Gravitational parameter (m³/s²), must be finite and **> 0**.
|
|
23
38
|
* @returns {number} Orbital period ($ T $) (s).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kepler-period.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/kepler-period.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kepler-period.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/kepler-period.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,IAAI,MAAM,KAAG,MAYpD,CAAC"}
|
|
@@ -18,6 +18,21 @@
|
|
|
18
18
|
*
|
|
19
19
|
* :::
|
|
20
20
|
*
|
|
21
|
+
* ::: practice Geostationary orbit
|
|
22
|
+
*
|
|
23
|
+
* **23.93 h**
|
|
24
|
+
*
|
|
25
|
+
* _Orbital period 42 164 km from Earth's centre_
|
|
26
|
+
*
|
|
27
|
+
* That's one sidereal day, the time Earth takes to turn once relative to the
|
|
28
|
+
* stars, so a satellite there stays over the same spot on the equator.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* keplerPeriod(42164e3, 3.986004418e14); // ≈ 86 164 s
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* :::
|
|
35
|
+
*
|
|
21
36
|
* @param {number} a Semi-major axis (m), must be finite and **> 0**.
|
|
22
37
|
* @param {number} mu Gravitational parameter (m³/s²), must be finite and **> 0**.
|
|
23
38
|
* @returns {number} Orbital period ($ T $) (s).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kepler-period.js","sourceRoot":"","sources":["../../../src/categories/orbits/kepler-period.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kepler-period.js","sourceRoot":"","sources":["../../../src/categories/orbits/kepler-period.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,EAAU,EAAU,EAAE;IAC5D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM;IAE5B,OAAO,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;AAC1C,CAAC,CAAC"}
|
|
@@ -18,11 +18,26 @@
|
|
|
18
18
|
* Common usage: reference rate for relative motion models (e.g., Clohessy–Wiltshire / Hill),
|
|
19
19
|
* orbital period estimates, and circular-orbit dynamics.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* ::: practice The ISS, orbit by orbit
|
|
22
|
+
*
|
|
23
|
+
* **15.51 orbits/day**
|
|
24
|
+
*
|
|
25
|
+
* _Mean motion at 420 km altitude_
|
|
26
|
+
*
|
|
27
|
+
* The function returns 0.001128 rad/s. Multiply by 86 400 s and divide by 2π for
|
|
28
|
+
* orbits per day, the unit used in a satellite's two-line elements (TLEs).
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* meanMotion(6.371e6 + 420e3, 3.986004418e14); // ≈ 0.001128 rad/s
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* :::
|
|
35
|
+
*
|
|
22
36
|
* @param a - Semi-major axis $ a $ (finite, > 0).
|
|
37
|
+
* @param mu - Standard gravitational parameter $ \mu $ (finite, > 0).
|
|
23
38
|
* @returns Mean motion $ n $ in **rad/s**.
|
|
24
|
-
* @throws {TypeError} If `
|
|
25
|
-
* @throws {RangeError} If `
|
|
39
|
+
* @throws {TypeError} If `a` or `mu` is not a finite number.
|
|
40
|
+
* @throws {RangeError} If `a <= 0` or `mu <= 0`.
|
|
26
41
|
* @group Orbits
|
|
27
42
|
*
|
|
28
43
|
* @example
|
|
@@ -30,8 +45,8 @@
|
|
|
30
45
|
* // Earth example (km-based):
|
|
31
46
|
* const mu = 398600.4418; // km³/s²
|
|
32
47
|
* const a = 7000; // km
|
|
33
|
-
* const n = meanMotion(
|
|
48
|
+
* const n = meanMotion(a, mu); // rad/s
|
|
34
49
|
* ```
|
|
35
50
|
*/
|
|
36
|
-
export declare const meanMotion: (
|
|
51
|
+
export declare const meanMotion: (a: number, mu: number) => number;
|
|
37
52
|
//# sourceMappingURL=mean-motion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mean-motion.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/mean-motion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mean-motion.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/mean-motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,MAAM,EAAE,IAAI,MAAM,KAAG,MAYlD,CAAC"}
|
|
@@ -18,11 +18,26 @@
|
|
|
18
18
|
* Common usage: reference rate for relative motion models (e.g., Clohessy–Wiltshire / Hill),
|
|
19
19
|
* orbital period estimates, and circular-orbit dynamics.
|
|
20
20
|
*
|
|
21
|
-
*
|
|
21
|
+
* ::: practice The ISS, orbit by orbit
|
|
22
|
+
*
|
|
23
|
+
* **15.51 orbits/day**
|
|
24
|
+
*
|
|
25
|
+
* _Mean motion at 420 km altitude_
|
|
26
|
+
*
|
|
27
|
+
* The function returns 0.001128 rad/s. Multiply by 86 400 s and divide by 2π for
|
|
28
|
+
* orbits per day, the unit used in a satellite's two-line elements (TLEs).
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* meanMotion(6.371e6 + 420e3, 3.986004418e14); // ≈ 0.001128 rad/s
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* :::
|
|
35
|
+
*
|
|
22
36
|
* @param a - Semi-major axis $ a $ (finite, > 0).
|
|
37
|
+
* @param mu - Standard gravitational parameter $ \mu $ (finite, > 0).
|
|
23
38
|
* @returns Mean motion $ n $ in **rad/s**.
|
|
24
|
-
* @throws {TypeError} If `
|
|
25
|
-
* @throws {RangeError} If `
|
|
39
|
+
* @throws {TypeError} If `a` or `mu` is not a finite number.
|
|
40
|
+
* @throws {RangeError} If `a <= 0` or `mu <= 0`.
|
|
26
41
|
* @group Orbits
|
|
27
42
|
*
|
|
28
43
|
* @example
|
|
@@ -30,18 +45,18 @@
|
|
|
30
45
|
* // Earth example (km-based):
|
|
31
46
|
* const mu = 398600.4418; // km³/s²
|
|
32
47
|
* const a = 7000; // km
|
|
33
|
-
* const n = meanMotion(
|
|
48
|
+
* const n = meanMotion(a, mu); // rad/s
|
|
34
49
|
* ```
|
|
35
50
|
*/
|
|
36
|
-
export const meanMotion = (
|
|
37
|
-
if (!Number.isFinite(mu))
|
|
38
|
-
throw new TypeError(`mu must be finite. Received: ${mu}`);
|
|
51
|
+
export const meanMotion = (a, mu) => {
|
|
39
52
|
if (!Number.isFinite(a))
|
|
40
53
|
throw new TypeError(`a must be finite. Received: ${a}`);
|
|
41
|
-
if (mu
|
|
42
|
-
throw new
|
|
54
|
+
if (!Number.isFinite(mu))
|
|
55
|
+
throw new TypeError(`mu must be finite. Received: ${mu}`);
|
|
43
56
|
if (a <= 0)
|
|
44
57
|
throw new RangeError(`a must be > 0. Received: ${a}`);
|
|
58
|
+
if (mu <= 0)
|
|
59
|
+
throw new RangeError(`mu must be > 0. Received: ${mu}`);
|
|
45
60
|
return Math.sqrt(mu / (a * a * a));
|
|
46
61
|
};
|
|
47
62
|
//# sourceMappingURL=mean-motion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mean-motion.js","sourceRoot":"","sources":["../../../src/categories/orbits/mean-motion.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mean-motion.js","sourceRoot":"","sources":["../../../src/categories/orbits/mean-motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAS,EAAE,EAAU,EAAU,EAAE;IAC1D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrB,MAAM,IAAI,SAAS,CAAC,+BAA+B,CAAC,EAAE,CAAC,CAAC;IAE1D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,SAAS,CAAC,gCAAgC,EAAE,EAAE,CAAC,CAAC;IAE5D,IAAI,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;IAElE,IAAI,EAAE,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;IAErE,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC,CAAC"}
|
|
@@ -17,6 +17,23 @@ import { PeriApoRadiiType } from '@interstellar-tools/types';
|
|
|
17
17
|
* - Inputs: ($ a $) in **meters (m)**, ($ e $) dimensionless.
|
|
18
18
|
* - Output: ($ r_p, r_a $) in **meters (m)**.
|
|
19
19
|
*
|
|
20
|
+
* ::: practice Molniya orbit
|
|
21
|
+
*
|
|
22
|
+
* **545 km / 39 913 km**
|
|
23
|
+
*
|
|
24
|
+
* _Altitude at perigee and apogee_
|
|
25
|
+
*
|
|
26
|
+
* With e = 0.74, a Molniya satellite races through perigee and spends most of its
|
|
27
|
+
* 12 hour orbit slowly crossing apogee, high above the northern latitudes it
|
|
28
|
+
* serves.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* periApoapsisRadii(26600e3, 0.74);
|
|
32
|
+
* // rp = 6 916 km, ra = 46 284 km from Earth's centre
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* :::
|
|
36
|
+
*
|
|
20
37
|
* @param {number} a Semi-major axis ($ a $) (m). Must be finite and **≠ 0**.
|
|
21
38
|
* @param {number} e Eccentricity ($ e $) (dimensionless). Must be finite and **≥ 0**.
|
|
22
39
|
* @returns {{ rp: number; ra: number | null }} Object with periapsis `rp` and apoapsis `ra` (or `null` if undefined for hyperbolic).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peri-apoapsis-radii.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/peri-apoapsis-radii.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D
|
|
1
|
+
{"version":3,"file":"peri-apoapsis-radii.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/peri-apoapsis-radii.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,gBAsDxD,CAAC"}
|
|
@@ -17,6 +17,23 @@
|
|
|
17
17
|
* - Inputs: ($ a $) in **meters (m)**, ($ e $) dimensionless.
|
|
18
18
|
* - Output: ($ r_p, r_a $) in **meters (m)**.
|
|
19
19
|
*
|
|
20
|
+
* ::: practice Molniya orbit
|
|
21
|
+
*
|
|
22
|
+
* **545 km / 39 913 km**
|
|
23
|
+
*
|
|
24
|
+
* _Altitude at perigee and apogee_
|
|
25
|
+
*
|
|
26
|
+
* With e = 0.74, a Molniya satellite races through perigee and spends most of its
|
|
27
|
+
* 12 hour orbit slowly crossing apogee, high above the northern latitudes it
|
|
28
|
+
* serves.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* periApoapsisRadii(26600e3, 0.74);
|
|
32
|
+
* // rp = 6 916 km, ra = 46 284 km from Earth's centre
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* :::
|
|
36
|
+
*
|
|
20
37
|
* @param {number} a Semi-major axis ($ a $) (m). Must be finite and **≠ 0**.
|
|
21
38
|
* @param {number} e Eccentricity ($ e $) (dimensionless). Must be finite and **≥ 0**.
|
|
22
39
|
* @returns {{ rp: number; ra: number | null }} Object with periapsis `rp` and apoapsis `ra` (or `null` if undefined for hyperbolic).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peri-apoapsis-radii.js","sourceRoot":"","sources":["../../../src/categories/orbits/peri-apoapsis-radii.ts"],"names":[],"mappings":"AAEA,2BAA2B;AAC3B
|
|
1
|
+
{"version":3,"file":"peri-apoapsis-radii.js","sourceRoot":"","sources":["../../../src/categories/orbits/peri-apoapsis-radii.ts"],"names":[],"mappings":"AAEA,2BAA2B;AAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAS,EAAE,CAAS,EAAoB,EAAE;IAC1E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,CAAC;IAED,sBAAsB;IACtB,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACV,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CACb,0GAA0G,CAC3G,CAAC;YACJ,CAAC;YAED,MAAM,IAAI,KAAK,CACb,mEAAmE,CACpE,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAEvB,4CAA4C;QAC5C,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;QAC1E,CAAC;QAED,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;IACpB,CAAC;IAED,aAAa;IACb,6CAA6C;IAC7C,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,iBAAiB;IAEzC,IAAI,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QACd,4BAA4B;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAE1C,IAAI,EAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YACd,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;QAC7B,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC,CAAC"}
|
|
@@ -25,6 +25,26 @@
|
|
|
25
25
|
*
|
|
26
26
|
* :::
|
|
27
27
|
*
|
|
28
|
+
* ::: practice Energy of the ISS orbit
|
|
29
|
+
*
|
|
30
|
+
* **-29.35 MJ/kg**
|
|
31
|
+
*
|
|
32
|
+
* _Specific orbital energy at 420 km altitude_
|
|
33
|
+
*
|
|
34
|
+
* Negative means the orbit is bound. Escaping Earth from there takes 29.35 MJ
|
|
35
|
+
* more for every kilogram, which brings the energy up to zero.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* const mu = 3.986004418e14;
|
|
39
|
+
* const r = 6.371e6 + 420e3;
|
|
40
|
+
*
|
|
41
|
+
* const v = circularSpeed(r, mu);
|
|
42
|
+
*
|
|
43
|
+
* specificMechanicalEnergy(v, r, mu); // ≈ -2.935e7 J/kg
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* :::
|
|
47
|
+
*
|
|
28
48
|
* @param {number} v Speed magnitude ($ v $) (m/s).
|
|
29
49
|
* @param {number} r Radius ($ r=\|\mathbf r\| $) from the central body (m).
|
|
30
50
|
* @param {number} mu Gravitational parameter ($ \mu $) (m³/s²).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specific-mechanical-energy.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/specific-mechanical-energy.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"specific-mechanical-energy.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/specific-mechanical-energy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,eAAO,MAAM,wBAAwB,GACnC,GAAG,MAAM,EACT,GAAG,MAAM,EACT,IAAI,MAAM,KACT,MAWF,CAAC"}
|
|
@@ -25,6 +25,26 @@
|
|
|
25
25
|
*
|
|
26
26
|
* :::
|
|
27
27
|
*
|
|
28
|
+
* ::: practice Energy of the ISS orbit
|
|
29
|
+
*
|
|
30
|
+
* **-29.35 MJ/kg**
|
|
31
|
+
*
|
|
32
|
+
* _Specific orbital energy at 420 km altitude_
|
|
33
|
+
*
|
|
34
|
+
* Negative means the orbit is bound. Escaping Earth from there takes 29.35 MJ
|
|
35
|
+
* more for every kilogram, which brings the energy up to zero.
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* const mu = 3.986004418e14;
|
|
39
|
+
* const r = 6.371e6 + 420e3;
|
|
40
|
+
*
|
|
41
|
+
* const v = circularSpeed(r, mu);
|
|
42
|
+
*
|
|
43
|
+
* specificMechanicalEnergy(v, r, mu); // ≈ -2.935e7 J/kg
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* :::
|
|
47
|
+
*
|
|
28
48
|
* @param {number} v Speed magnitude ($ v $) (m/s).
|
|
29
49
|
* @param {number} r Radius ($ r=\|\mathbf r\| $) from the central body (m).
|
|
30
50
|
* @param {number} mu Gravitational parameter ($ \mu $) (m³/s²).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specific-mechanical-energy.js","sourceRoot":"","sources":["../../../src/categories/orbits/specific-mechanical-energy.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"specific-mechanical-energy.js","sourceRoot":"","sources":["../../../src/categories/orbits/specific-mechanical-energy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,CAAS,EACT,CAAS,EACT,EAAU,EACF,EAAE;IACV,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAEpE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAE9D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IAEvE,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAC9B,CAAC,CAAC"}
|
|
@@ -14,6 +14,23 @@
|
|
|
14
14
|
* Units:
|
|
15
15
|
* - Output `rSOI` has the same distance unit as `a` (since the mass ratio is dimensionless).
|
|
16
16
|
*
|
|
17
|
+
* ::: practice Earth's sphere of influence
|
|
18
|
+
*
|
|
19
|
+
* **925 000 km**
|
|
20
|
+
*
|
|
21
|
+
* _Where Earth's gravity outweighs the Sun's_
|
|
22
|
+
*
|
|
23
|
+
* The Moon, at 384 400 km, is well inside it. Beyond this distance, a
|
|
24
|
+
* spacecraft's path is best described as an orbit around the Sun.
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* const au = 1.495978707e11; // m
|
|
28
|
+
*
|
|
29
|
+
* sphereOfInfluenceRadius(au, 5.972e24, 1.989e30); // ≈ 9.245e8 m
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* :::
|
|
33
|
+
*
|
|
17
34
|
* @param {number} a Semi-major axis `a` of the secondary around the primary (finite, > 0).
|
|
18
35
|
* @param {number} m Mass of the secondary body `m` (finite, > 0).
|
|
19
36
|
* @param {number} M Mass of the primary body `M` (finite, > 0).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sphere-of-influence-radius.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/sphere-of-influence-radius.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sphere-of-influence-radius.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/sphere-of-influence-radius.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,eAAO,MAAM,uBAAuB,GAClC,GAAG,MAAM,EACT,GAAG,MAAM,EACT,GAAG,MAAM,KACR,MA0BF,CAAC"}
|
|
@@ -14,6 +14,23 @@
|
|
|
14
14
|
* Units:
|
|
15
15
|
* - Output `rSOI` has the same distance unit as `a` (since the mass ratio is dimensionless).
|
|
16
16
|
*
|
|
17
|
+
* ::: practice Earth's sphere of influence
|
|
18
|
+
*
|
|
19
|
+
* **925 000 km**
|
|
20
|
+
*
|
|
21
|
+
* _Where Earth's gravity outweighs the Sun's_
|
|
22
|
+
*
|
|
23
|
+
* The Moon, at 384 400 km, is well inside it. Beyond this distance, a
|
|
24
|
+
* spacecraft's path is best described as an orbit around the Sun.
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* const au = 1.495978707e11; // m
|
|
28
|
+
*
|
|
29
|
+
* sphereOfInfluenceRadius(au, 5.972e24, 1.989e30); // ≈ 9.245e8 m
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* :::
|
|
33
|
+
*
|
|
17
34
|
* @param {number} a Semi-major axis `a` of the secondary around the primary (finite, > 0).
|
|
18
35
|
* @param {number} m Mass of the secondary body `m` (finite, > 0).
|
|
19
36
|
* @param {number} M Mass of the primary body `M` (finite, > 0).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sphere-of-influence-radius.js","sourceRoot":"","sources":["../../../src/categories/orbits/sphere-of-influence-radius.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sphere-of-influence-radius.js","sourceRoot":"","sources":["../../../src/categories/orbits/sphere-of-influence-radius.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,CAAS,EACT,CAAS,EACT,CAAS,EACD,EAAE;IACV,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACX,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC"}
|
|
@@ -22,6 +22,25 @@
|
|
|
22
22
|
*
|
|
23
23
|
* :::
|
|
24
24
|
*
|
|
25
|
+
* ::: practice Departing for Mars
|
|
26
|
+
*
|
|
27
|
+
* **32.73 km/s**
|
|
28
|
+
*
|
|
29
|
+
* _Speed at the start of a Hohmann transfer to Mars_
|
|
30
|
+
*
|
|
31
|
+
* Earth moves around the Sun at 29.78 km/s, so a spacecraft leaving on the
|
|
32
|
+
* transfer orbit needs 2.95 km/s on top of Earth's own speed.
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* const au = 1.495978707e11; // m
|
|
36
|
+
* const muSun = 1.32712440018e20; // m³/s²
|
|
37
|
+
* const a = ((1 + 1.524) / 2) * au; // transfer orbit
|
|
38
|
+
*
|
|
39
|
+
* visVivaSpeed(au, a, muSun); // ≈ 32 731 m/s
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* :::
|
|
43
|
+
*
|
|
25
44
|
* @param {number} r Radius ($ r $) (m), distance to the attracting body.
|
|
26
45
|
* @param {number} a Semi-major axis ($ a $) (m). Use `Infinity` for parabolic, negative for hyperbolic.
|
|
27
46
|
* @param {number} mu Gravitational parameter ($ \mu $) (m³/s²).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vis-viva-speed.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/vis-viva-speed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vis-viva-speed.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/vis-viva-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,IAAI,MAAM,KAAG,MAsC/D,CAAC"}
|
|
@@ -22,6 +22,25 @@
|
|
|
22
22
|
*
|
|
23
23
|
* :::
|
|
24
24
|
*
|
|
25
|
+
* ::: practice Departing for Mars
|
|
26
|
+
*
|
|
27
|
+
* **32.73 km/s**
|
|
28
|
+
*
|
|
29
|
+
* _Speed at the start of a Hohmann transfer to Mars_
|
|
30
|
+
*
|
|
31
|
+
* Earth moves around the Sun at 29.78 km/s, so a spacecraft leaving on the
|
|
32
|
+
* transfer orbit needs 2.95 km/s on top of Earth's own speed.
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* const au = 1.495978707e11; // m
|
|
36
|
+
* const muSun = 1.32712440018e20; // m³/s²
|
|
37
|
+
* const a = ((1 + 1.524) / 2) * au; // transfer orbit
|
|
38
|
+
*
|
|
39
|
+
* visVivaSpeed(au, a, muSun); // ≈ 32 731 m/s
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* :::
|
|
43
|
+
*
|
|
25
44
|
* @param {number} r Radius ($ r $) (m), distance to the attracting body.
|
|
26
45
|
* @param {number} a Semi-major axis ($ a $) (m). Use `Infinity` for parabolic, negative for hyperbolic.
|
|
27
46
|
* @param {number} mu Gravitational parameter ($ \mu $) (m³/s²).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vis-viva-speed.js","sourceRoot":"","sources":["../../../src/categories/orbits/vis-viva-speed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vis-viva-speed.js","sourceRoot":"","sources":["../../../src/categories/orbits/vis-viva-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAS,EAAE,CAAS,EAAE,EAAU,EAAU,EAAE;IACvE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACxB,iEAAiE;QACjE,IAAI,CAAC,KAAK,QAAQ,EAAE,CAAC;YACnB,kBAAkB;YAClB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACjC,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,gDAAgD;IACpE,MAAM,QAAQ,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAErC,oEAAoE;IACpE,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAEvC,IAAI,QAAQ,GAAG,CAAC,GAAG;YAAE,OAAO,CAAC,CAAC,CAAC,yBAAyB;QAExD,MAAM,IAAI,KAAK,CACb,uCAAuC,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAC9D,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interstellar-tools/equations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.0",
|
|
4
4
|
"description": "Curated, well-tested orbital mechanics and dynamics formulas (e.g., Newtonian gravity, vis-viva, Kepler's 3rd law, escape/circular speeds, specific energy, specific angular momentum, peri/apoapsis radii).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"interstellar",
|