@interstellar-tools/equations 1.1.0 → 1.2.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/dist/categories/anomalies/asymptote-true-anomaly.d.ts +50 -0
- package/dist/categories/anomalies/asymptote-true-anomaly.d.ts.map +1 -0
- package/dist/categories/anomalies/asymptote-true-anomaly.js +55 -0
- package/dist/categories/anomalies/asymptote-true-anomaly.js.map +1 -0
- package/dist/categories/anomalies/hyperbolic-to-true-anomaly.d.ts +38 -0
- package/dist/categories/anomalies/hyperbolic-to-true-anomaly.d.ts.map +1 -0
- package/dist/categories/anomalies/hyperbolic-to-true-anomaly.js +49 -0
- package/dist/categories/anomalies/hyperbolic-to-true-anomaly.js.map +1 -0
- package/dist/categories/anomalies/true-to-hyperbolic-anomaly.d.ts +40 -0
- package/dist/categories/anomalies/true-to-hyperbolic-anomaly.d.ts.map +1 -0
- package/dist/categories/anomalies/true-to-hyperbolic-anomaly.js +54 -0
- package/dist/categories/anomalies/true-to-hyperbolic-anomaly.js.map +1 -0
- package/dist/categories/kepler/solve-kepler-hyperbolic.d.ts +49 -0
- package/dist/categories/kepler/solve-kepler-hyperbolic.d.ts.map +1 -0
- package/dist/categories/kepler/solve-kepler-hyperbolic.js +90 -0
- package/dist/categories/kepler/solve-kepler-hyperbolic.js.map +1 -0
- package/dist/categories/orbits/hyperbolic-eccentricity.d.ts +56 -0
- package/dist/categories/orbits/hyperbolic-eccentricity.d.ts.map +1 -0
- package/dist/categories/orbits/hyperbolic-eccentricity.js +72 -0
- package/dist/categories/orbits/hyperbolic-eccentricity.js.map +1 -0
- package/dist/categories/orbits/hyperbolic-semi-major-axis.d.ts +53 -0
- package/dist/categories/orbits/hyperbolic-semi-major-axis.d.ts.map +1 -0
- package/dist/categories/orbits/hyperbolic-semi-major-axis.js +66 -0
- package/dist/categories/orbits/hyperbolic-semi-major-axis.js.map +1 -0
- package/dist/categories/orbits/hyperbolic-time-of-flight.d.ts +64 -0
- package/dist/categories/orbits/hyperbolic-time-of-flight.d.ts.map +1 -0
- package/dist/categories/orbits/hyperbolic-time-of-flight.js +86 -0
- package/dist/categories/orbits/hyperbolic-time-of-flight.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Radians } from '@interstellar-tools/types';
|
|
2
|
+
/**
|
|
3
|
+
* Compute the **true anomaly of a hyperbola's asymptotes**: the limit a body on a hyperbola approaches but never reaches.
|
|
4
|
+
*
|
|
5
|
+
* $$
|
|
6
|
+
* \nu_\infty = \arccos\left(-\frac{1}{e}\right)
|
|
7
|
+
* $$
|
|
8
|
+
*
|
|
9
|
+
* **Units**
|
|
10
|
+
* - Input: `e` dimensionless.
|
|
11
|
+
* - Output: $ \nu_\infty $ in **radians**, in (π/2, π).
|
|
12
|
+
*
|
|
13
|
+
* ::: info Notes
|
|
14
|
+
*
|
|
15
|
+
* - The body comes in from $ -\nu_\infty $ and leaves towards $ +\nu_\infty $.
|
|
16
|
+
* - The trajectory turns through $ 2\nu_\infty - \pi = 2\arcsin(1/e) $, the turning angle of a flyby; see `gravityAssistTurningAngle`.
|
|
17
|
+
* - Just above $ e = 1 $ the asymptotes open to almost π (a near-parabola); for large $ e $ they close towards π/2 (a near-straight line).
|
|
18
|
+
*
|
|
19
|
+
* :::
|
|
20
|
+
*
|
|
21
|
+
* ::: practice Apollo 11, arriving at the Moon
|
|
22
|
+
*
|
|
23
|
+
* **134.0°**
|
|
24
|
+
*
|
|
25
|
+
* _Asymptote of the approach hyperbola, e = 1.44_
|
|
26
|
+
*
|
|
27
|
+
* Without the lunar orbit insertion burn at closest approach, the Moon's gravity would have bent Apollo 11's path through 88° and sent it back out of the Moon's sphere of influence.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* asymptoteTrueAnomaly(1.44); // ≈ 2.338 rad, 134.0°
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* :::
|
|
34
|
+
*
|
|
35
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
36
|
+
* @returns Asymptote true anomaly $ \nu_\infty $ in **radians**.
|
|
37
|
+
* @throws {TypeError} If `e` is not a finite number.
|
|
38
|
+
* @throws {RangeError} If `e <= 1`.
|
|
39
|
+
* @group Anomalies
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* asymptoteTrueAnomaly(2); // 2π/3 (120°)
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @see {@link trueToHyperbolicAnomaly}
|
|
47
|
+
* @see https://en.wikipedia.org/wiki/Hyperbolic_trajectory Hyperbolic trajectory
|
|
48
|
+
*/
|
|
49
|
+
export declare const asymptoteTrueAnomaly: (e: number) => Radians;
|
|
50
|
+
//# sourceMappingURL=asymptote-true-anomaly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asymptote-true-anomaly.d.ts","sourceRoot":"","sources":["../../../src/categories/anomalies/asymptote-true-anomaly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,oBAAoB,GAAI,GAAG,MAAM,KAAG,OAOhD,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the **true anomaly of a hyperbola's asymptotes**: the limit a body on a hyperbola approaches but never reaches.
|
|
3
|
+
*
|
|
4
|
+
* $$
|
|
5
|
+
* \nu_\infty = \arccos\left(-\frac{1}{e}\right)
|
|
6
|
+
* $$
|
|
7
|
+
*
|
|
8
|
+
* **Units**
|
|
9
|
+
* - Input: `e` dimensionless.
|
|
10
|
+
* - Output: $ \nu_\infty $ in **radians**, in (π/2, π).
|
|
11
|
+
*
|
|
12
|
+
* ::: info Notes
|
|
13
|
+
*
|
|
14
|
+
* - The body comes in from $ -\nu_\infty $ and leaves towards $ +\nu_\infty $.
|
|
15
|
+
* - The trajectory turns through $ 2\nu_\infty - \pi = 2\arcsin(1/e) $, the turning angle of a flyby; see `gravityAssistTurningAngle`.
|
|
16
|
+
* - Just above $ e = 1 $ the asymptotes open to almost π (a near-parabola); for large $ e $ they close towards π/2 (a near-straight line).
|
|
17
|
+
*
|
|
18
|
+
* :::
|
|
19
|
+
*
|
|
20
|
+
* ::: practice Apollo 11, arriving at the Moon
|
|
21
|
+
*
|
|
22
|
+
* **134.0°**
|
|
23
|
+
*
|
|
24
|
+
* _Asymptote of the approach hyperbola, e = 1.44_
|
|
25
|
+
*
|
|
26
|
+
* Without the lunar orbit insertion burn at closest approach, the Moon's gravity would have bent Apollo 11's path through 88° and sent it back out of the Moon's sphere of influence.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* asymptoteTrueAnomaly(1.44); // ≈ 2.338 rad, 134.0°
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* :::
|
|
33
|
+
*
|
|
34
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
35
|
+
* @returns Asymptote true anomaly $ \nu_\infty $ in **radians**.
|
|
36
|
+
* @throws {TypeError} If `e` is not a finite number.
|
|
37
|
+
* @throws {RangeError} If `e <= 1`.
|
|
38
|
+
* @group Anomalies
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* asymptoteTrueAnomaly(2); // 2π/3 (120°)
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @see {@link trueToHyperbolicAnomaly}
|
|
46
|
+
* @see https://en.wikipedia.org/wiki/Hyperbolic_trajectory Hyperbolic trajectory
|
|
47
|
+
*/
|
|
48
|
+
export const asymptoteTrueAnomaly = (e) => {
|
|
49
|
+
if (!Number.isFinite(e))
|
|
50
|
+
throw new TypeError(`e must be a finite number. Received: ${e}`);
|
|
51
|
+
if (e <= 1)
|
|
52
|
+
throw new RangeError(`e must be > 1. Received: ${e}`);
|
|
53
|
+
return Math.acos(-1 / e);
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=asymptote-true-anomaly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asymptote-true-anomaly.js","sourceRoot":"","sources":["../../../src/categories/anomalies/asymptote-true-anomaly.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAS,EAAW,EAAE;IACzD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrB,MAAM,IAAI,SAAS,CAAC,wCAAwC,CAAC,EAAE,CAAC,CAAC;IAEnE,IAAI,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;IAElE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAY,CAAC;AACtC,CAAC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Radians } from '@interstellar-tools/types';
|
|
2
|
+
/**
|
|
3
|
+
* Convert a **hyperbolic anomaly** $ F $ to the **true anomaly** on a hyperbola.
|
|
4
|
+
*
|
|
5
|
+
* $$
|
|
6
|
+
* \tan\frac{\nu}{2} = \sqrt{\frac{e + 1}{e - 1}}\,\tanh\frac{F}{2}
|
|
7
|
+
* $$
|
|
8
|
+
*
|
|
9
|
+
* **Units**
|
|
10
|
+
* - Inputs: `F` in **radians**, `e` dimensionless.
|
|
11
|
+
* - Output: $ \nu $ in **radians**, in $ (-\nu_\infty, \nu_\infty) $.
|
|
12
|
+
*
|
|
13
|
+
* ::: info Notes
|
|
14
|
+
*
|
|
15
|
+
* - The inverse of {@link trueToHyperbolicAnomaly}.
|
|
16
|
+
* - As $ F \to \pm\infty $, $ \nu $ approaches the asymptotes $ \pm\nu_\infty $ but never reaches them.
|
|
17
|
+
* - Returns a signed angle, negative before periapsis. Use `norm2pi` for [0, 2π).
|
|
18
|
+
*
|
|
19
|
+
* :::
|
|
20
|
+
*
|
|
21
|
+
* @param F - Hyperbolic anomaly $ F $ in **radians** (finite).
|
|
22
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
23
|
+
* @returns True anomaly $ \nu $ in **radians**, in (-π, π).
|
|
24
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
25
|
+
* @throws {RangeError} If `e <= 1`.
|
|
26
|
+
* @group Anomalies
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const nu = hyperbolicToTrueAnomaly(Math.acosh(2), 2);
|
|
31
|
+
* // nu ≈ π/2
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @see {@link trueToHyperbolicAnomaly}
|
|
35
|
+
* @see {@link solveKeplerHyperbolic}
|
|
36
|
+
*/
|
|
37
|
+
export declare const hyperbolicToTrueAnomaly: (F: number, e: number) => Radians;
|
|
38
|
+
//# sourceMappingURL=hyperbolic-to-true-anomaly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperbolic-to-true-anomaly.d.ts","sourceRoot":"","sources":["../../../src/categories/anomalies/hyperbolic-to-true-anomaly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,uBAAuB,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,OAa9D,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a **hyperbolic anomaly** $ F $ to the **true anomaly** on a hyperbola.
|
|
3
|
+
*
|
|
4
|
+
* $$
|
|
5
|
+
* \tan\frac{\nu}{2} = \sqrt{\frac{e + 1}{e - 1}}\,\tanh\frac{F}{2}
|
|
6
|
+
* $$
|
|
7
|
+
*
|
|
8
|
+
* **Units**
|
|
9
|
+
* - Inputs: `F` in **radians**, `e` dimensionless.
|
|
10
|
+
* - Output: $ \nu $ in **radians**, in $ (-\nu_\infty, \nu_\infty) $.
|
|
11
|
+
*
|
|
12
|
+
* ::: info Notes
|
|
13
|
+
*
|
|
14
|
+
* - The inverse of {@link trueToHyperbolicAnomaly}.
|
|
15
|
+
* - As $ F \to \pm\infty $, $ \nu $ approaches the asymptotes $ \pm\nu_\infty $ but never reaches them.
|
|
16
|
+
* - Returns a signed angle, negative before periapsis. Use `norm2pi` for [0, 2π).
|
|
17
|
+
*
|
|
18
|
+
* :::
|
|
19
|
+
*
|
|
20
|
+
* @param F - Hyperbolic anomaly $ F $ in **radians** (finite).
|
|
21
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
22
|
+
* @returns True anomaly $ \nu $ in **radians**, in (-π, π).
|
|
23
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
24
|
+
* @throws {RangeError} If `e <= 1`.
|
|
25
|
+
* @group Anomalies
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const nu = hyperbolicToTrueAnomaly(Math.acosh(2), 2);
|
|
30
|
+
* // nu ≈ π/2
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @see {@link trueToHyperbolicAnomaly}
|
|
34
|
+
* @see {@link solveKeplerHyperbolic}
|
|
35
|
+
*/
|
|
36
|
+
export const hyperbolicToTrueAnomaly = (F, e) => {
|
|
37
|
+
for (const [name, x] of [
|
|
38
|
+
['F', F],
|
|
39
|
+
['e', e]
|
|
40
|
+
]) {
|
|
41
|
+
if (!Number.isFinite(x))
|
|
42
|
+
throw new TypeError(`${name} must be a finite number. Received: ${x}`);
|
|
43
|
+
}
|
|
44
|
+
if (e <= 1)
|
|
45
|
+
throw new RangeError(`e must be > 1. Received: ${e}`);
|
|
46
|
+
return (2 *
|
|
47
|
+
Math.atan(Math.sqrt((e + 1) / (e - 1)) * Math.tanh(F / 2)));
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=hyperbolic-to-true-anomaly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperbolic-to-true-anomaly.js","sourceRoot":"","sources":["../../../src/categories/anomalies/hyperbolic-to-true-anomaly.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAS,EAAE,CAAS,EAAW,EAAE;IACvE,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI;QACtB,CAAC,GAAG,EAAE,CAAC,CAAC;QACR,CAAC,GAAG,EAAE,CAAC,CAAC;KACA,EAAE,CAAC;QACX,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YACrB,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,uCAAuC,CAAC,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;IAElE,OAAO,CAAC,CAAC;QACP,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAY,CAAC;AAC3E,CAAC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Radians } from '@interstellar-tools/types';
|
|
2
|
+
/**
|
|
3
|
+
* Convert a **true anomaly** on a hyperbola to the **hyperbolic anomaly** $ F $.
|
|
4
|
+
*
|
|
5
|
+
* $$
|
|
6
|
+
* \tanh\frac{F}{2} = \sqrt{\frac{e - 1}{e + 1}}\,\tan\frac{\nu}{2}
|
|
7
|
+
* $$
|
|
8
|
+
*
|
|
9
|
+
* **Units**
|
|
10
|
+
* - Inputs: `nu` in **radians**, `e` dimensionless.
|
|
11
|
+
* - Output: $ F $ in **radians** (dimensionless, unbounded).
|
|
12
|
+
*
|
|
13
|
+
* ::: info Notes
|
|
14
|
+
*
|
|
15
|
+
* - The hyperbolic counterpart of the eccentric anomaly. Feed it to $ M_h = e \sinh F - F $ to get a time from periapsis.
|
|
16
|
+
* - `nu` is wrapped to (-π, π] first, so the incoming branch can be given either as a negative angle or just below 2π, as {@link stateToElements} returns it.
|
|
17
|
+
* - Only $ |\nu| < \nu_\infty $ exists on a hyperbola; see {@link asymptoteTrueAnomaly}.
|
|
18
|
+
*
|
|
19
|
+
* :::
|
|
20
|
+
*
|
|
21
|
+
* @param nu - True anomaly $ \nu $ in **radians** (finite, inside the asymptotes).
|
|
22
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
23
|
+
* @returns Hyperbolic anomaly $ F $ in **radians**: negative before periapsis, positive after.
|
|
24
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
25
|
+
* @throws {RangeError} If `e <= 1` or `nu` is at or beyond the asymptotes.
|
|
26
|
+
* @group Anomalies
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import type { Radians } from '@interstellar-tools/types';
|
|
31
|
+
*
|
|
32
|
+
* const F = trueToHyperbolicAnomaly((Math.PI / 2) as Radians, 2);
|
|
33
|
+
* // F ≈ 1.317 (cosh F = e)
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see {@link hyperbolicToTrueAnomaly}
|
|
37
|
+
* @see https://en.wikipedia.org/wiki/Hyperbolic_trajectory#Hyperbolic_anomaly Hyperbolic anomaly
|
|
38
|
+
*/
|
|
39
|
+
export declare const trueToHyperbolicAnomaly: (nu: Radians, e: number) => number;
|
|
40
|
+
//# sourceMappingURL=true-to-hyperbolic-anomaly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"true-to-hyperbolic-anomaly.d.ts","sourceRoot":"","sources":["../../../src/categories/anomalies/true-to-hyperbolic-anomaly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,uBAAuB,GAAI,IAAI,OAAO,EAAE,GAAG,MAAM,KAAG,MAmBhE,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { asymptoteTrueAnomaly } from './asymptote-true-anomaly.js';
|
|
2
|
+
/**
|
|
3
|
+
* Convert a **true anomaly** on a hyperbola to the **hyperbolic anomaly** $ F $.
|
|
4
|
+
*
|
|
5
|
+
* $$
|
|
6
|
+
* \tanh\frac{F}{2} = \sqrt{\frac{e - 1}{e + 1}}\,\tan\frac{\nu}{2}
|
|
7
|
+
* $$
|
|
8
|
+
*
|
|
9
|
+
* **Units**
|
|
10
|
+
* - Inputs: `nu` in **radians**, `e` dimensionless.
|
|
11
|
+
* - Output: $ F $ in **radians** (dimensionless, unbounded).
|
|
12
|
+
*
|
|
13
|
+
* ::: info Notes
|
|
14
|
+
*
|
|
15
|
+
* - The hyperbolic counterpart of the eccentric anomaly. Feed it to $ M_h = e \sinh F - F $ to get a time from periapsis.
|
|
16
|
+
* - `nu` is wrapped to (-π, π] first, so the incoming branch can be given either as a negative angle or just below 2π, as {@link stateToElements} returns it.
|
|
17
|
+
* - Only $ |\nu| < \nu_\infty $ exists on a hyperbola; see {@link asymptoteTrueAnomaly}.
|
|
18
|
+
*
|
|
19
|
+
* :::
|
|
20
|
+
*
|
|
21
|
+
* @param nu - True anomaly $ \nu $ in **radians** (finite, inside the asymptotes).
|
|
22
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
23
|
+
* @returns Hyperbolic anomaly $ F $ in **radians**: negative before periapsis, positive after.
|
|
24
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
25
|
+
* @throws {RangeError} If `e <= 1` or `nu` is at or beyond the asymptotes.
|
|
26
|
+
* @group Anomalies
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import type { Radians } from '@interstellar-tools/types';
|
|
31
|
+
*
|
|
32
|
+
* const F = trueToHyperbolicAnomaly((Math.PI / 2) as Radians, 2);
|
|
33
|
+
* // F ≈ 1.317 (cosh F = e)
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @see {@link hyperbolicToTrueAnomaly}
|
|
37
|
+
* @see https://en.wikipedia.org/wiki/Hyperbolic_trajectory#Hyperbolic_anomaly Hyperbolic anomaly
|
|
38
|
+
*/
|
|
39
|
+
export const trueToHyperbolicAnomaly = (nu, e) => {
|
|
40
|
+
for (const [name, x] of [
|
|
41
|
+
['nu', nu],
|
|
42
|
+
['e', e]
|
|
43
|
+
]) {
|
|
44
|
+
if (!Number.isFinite(x))
|
|
45
|
+
throw new TypeError(`${name} must be a finite number. Received: ${x}`);
|
|
46
|
+
}
|
|
47
|
+
if (e <= 1)
|
|
48
|
+
throw new RangeError(`e must be > 1. Received: ${e}`);
|
|
49
|
+
const wrapped = Math.atan2(Math.sin(nu), Math.cos(nu));
|
|
50
|
+
if (Math.abs(wrapped) >= asymptoteTrueAnomaly(e))
|
|
51
|
+
throw new RangeError(`nu is at or beyond the asymptotes (|nu| >= acos(-1/e)). Received: nu=${nu}, e=${e}`);
|
|
52
|
+
return 2 * Math.atanh(Math.sqrt((e - 1) / (e + 1)) * Math.tan(wrapped / 2));
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=true-to-hyperbolic-anomaly.js.map
|
|
@@ -0,0 +1 @@
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
|
1
|
+
/**
|
|
2
|
+
* Solve **Kepler's equation for a hyperbola**: find the hyperbolic anomaly $ F $ from the hyperbolic mean anomaly $ M_h $.
|
|
3
|
+
*
|
|
4
|
+
* $$
|
|
5
|
+
* M_h = e \sinh F - F
|
|
6
|
+
* $$
|
|
7
|
+
*
|
|
8
|
+
* solved with Newton's method:
|
|
9
|
+
*
|
|
10
|
+
* $$
|
|
11
|
+
* F_{n+1} = F_n - \frac{e \sinh F_n - F_n - M_h}{e \cosh F_n - 1}, \qquad F_0 = \min\left(\operatorname{asinh}\frac{|M_h|}{e - 1},\ \sqrt[3]{\frac{6|M_h|}{e}}\right)
|
|
12
|
+
* $$
|
|
13
|
+
*
|
|
14
|
+
* **Units**
|
|
15
|
+
* - Inputs: `Mh` in **radians**, `e` dimensionless.
|
|
16
|
+
* - Output: $ F $ in **radians** (dimensionless, unbounded).
|
|
17
|
+
*
|
|
18
|
+
* ::: info Notes
|
|
19
|
+
*
|
|
20
|
+
* - The equation is odd in $ F $, so the solver works on $ |M_h| $ and restores the sign. Negative values are before periapsis.
|
|
21
|
+
* - $ F_0 $ is an upper bound on the root, since $ e\sinh F - F $ is at least $ (e-1)\sinh F $ and at least $ (e-1)F + eF^3/6 $. The function is increasing and convex for $ F > 0 $, so Newton's method converges monotonically from there, even close to $ e = 1 $ where the derivative $ e\cosh F - 1 $ is small near periapsis.
|
|
22
|
+
* - Unlike an ellipse, a hyperbola isn't periodic: $ M_h $ isn't reduced to one turn.
|
|
23
|
+
* - {@link solveKeplerHighEccentricity} also accepts $ e > 1 $, but this solver throws when it doesn't converge instead of returning its last estimate.
|
|
24
|
+
*
|
|
25
|
+
* :::
|
|
26
|
+
*
|
|
27
|
+
* @param Mh - Hyperbolic mean anomaly $ M_h $ in **radians** (finite).
|
|
28
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
29
|
+
* @param tolerance - Stop when a step is smaller than `tolerance * max(1, |F|)`. Defaults to `1e-14`.
|
|
30
|
+
* @param maxIter - Maximum number of Newton steps. Defaults to `50`.
|
|
31
|
+
* @returns The hyperbolic anomaly $ F $ in **radians**, with the sign of `Mh`.
|
|
32
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
33
|
+
* @throws {RangeError} If `e <= 1`, `tolerance <= 0` or `maxIter < 1`.
|
|
34
|
+
* @throws {Error} If the iteration doesn't converge within `maxIter` steps.
|
|
35
|
+
* @group Kepler Solvers
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* import type { Radians } from '@interstellar-tools/types';
|
|
40
|
+
*
|
|
41
|
+
* const F = solveKeplerHyperbolic(12.66 as Radians, 1.44);
|
|
42
|
+
* // F ≈ 3.087, and 1.44 * sinh(F) - F ≈ 12.66
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @see {@link hyperbolicTimeOfFlight}
|
|
46
|
+
* @see https://en.wikipedia.org/wiki/Hyperbolic_trajectory#Hyperbolic_anomaly Hyperbolic anomaly
|
|
47
|
+
*/
|
|
48
|
+
export declare const solveKeplerHyperbolic: (Mh: number, e: number, tolerance?: number, maxIter?: number) => number;
|
|
49
|
+
//# sourceMappingURL=solve-kepler-hyperbolic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solve-kepler-hyperbolic.d.ts","sourceRoot":"","sources":["../../../src/categories/kepler/solve-kepler-hyperbolic.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,qBAAqB,GAChC,IAAI,MAAM,EACV,GAAG,MAAM,EACT,kBAAiB,EACjB,gBAAY,KACX,MAsCF,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** sinh x - x, from its Taylor series for small x to avoid cancellation. */
|
|
2
|
+
const sinhMinusX = (x) => {
|
|
3
|
+
if (Math.abs(x) > 0.5)
|
|
4
|
+
return Math.sinh(x) - x;
|
|
5
|
+
const x2 = x * x;
|
|
6
|
+
let term = (x * x2) / 6;
|
|
7
|
+
let sum = term;
|
|
8
|
+
for (let k = 5; Math.abs(term) > 1e-17 * Math.abs(sum); k += 2) {
|
|
9
|
+
term *= x2 / ((k - 1) * k);
|
|
10
|
+
sum += term;
|
|
11
|
+
}
|
|
12
|
+
return sum;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Solve **Kepler's equation for a hyperbola**: find the hyperbolic anomaly $ F $ from the hyperbolic mean anomaly $ M_h $.
|
|
16
|
+
*
|
|
17
|
+
* $$
|
|
18
|
+
* M_h = e \sinh F - F
|
|
19
|
+
* $$
|
|
20
|
+
*
|
|
21
|
+
* solved with Newton's method:
|
|
22
|
+
*
|
|
23
|
+
* $$
|
|
24
|
+
* F_{n+1} = F_n - \frac{e \sinh F_n - F_n - M_h}{e \cosh F_n - 1}, \qquad F_0 = \min\left(\operatorname{asinh}\frac{|M_h|}{e - 1},\ \sqrt[3]{\frac{6|M_h|}{e}}\right)
|
|
25
|
+
* $$
|
|
26
|
+
*
|
|
27
|
+
* **Units**
|
|
28
|
+
* - Inputs: `Mh` in **radians**, `e` dimensionless.
|
|
29
|
+
* - Output: $ F $ in **radians** (dimensionless, unbounded).
|
|
30
|
+
*
|
|
31
|
+
* ::: info Notes
|
|
32
|
+
*
|
|
33
|
+
* - The equation is odd in $ F $, so the solver works on $ |M_h| $ and restores the sign. Negative values are before periapsis.
|
|
34
|
+
* - $ F_0 $ is an upper bound on the root, since $ e\sinh F - F $ is at least $ (e-1)\sinh F $ and at least $ (e-1)F + eF^3/6 $. The function is increasing and convex for $ F > 0 $, so Newton's method converges monotonically from there, even close to $ e = 1 $ where the derivative $ e\cosh F - 1 $ is small near periapsis.
|
|
35
|
+
* - Unlike an ellipse, a hyperbola isn't periodic: $ M_h $ isn't reduced to one turn.
|
|
36
|
+
* - {@link solveKeplerHighEccentricity} also accepts $ e > 1 $, but this solver throws when it doesn't converge instead of returning its last estimate.
|
|
37
|
+
*
|
|
38
|
+
* :::
|
|
39
|
+
*
|
|
40
|
+
* @param Mh - Hyperbolic mean anomaly $ M_h $ in **radians** (finite).
|
|
41
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
42
|
+
* @param tolerance - Stop when a step is smaller than `tolerance * max(1, |F|)`. Defaults to `1e-14`.
|
|
43
|
+
* @param maxIter - Maximum number of Newton steps. Defaults to `50`.
|
|
44
|
+
* @returns The hyperbolic anomaly $ F $ in **radians**, with the sign of `Mh`.
|
|
45
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
46
|
+
* @throws {RangeError} If `e <= 1`, `tolerance <= 0` or `maxIter < 1`.
|
|
47
|
+
* @throws {Error} If the iteration doesn't converge within `maxIter` steps.
|
|
48
|
+
* @group Kepler Solvers
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* import type { Radians } from '@interstellar-tools/types';
|
|
53
|
+
*
|
|
54
|
+
* const F = solveKeplerHyperbolic(12.66 as Radians, 1.44);
|
|
55
|
+
* // F ≈ 3.087, and 1.44 * sinh(F) - F ≈ 12.66
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @see {@link hyperbolicTimeOfFlight}
|
|
59
|
+
* @see https://en.wikipedia.org/wiki/Hyperbolic_trajectory#Hyperbolic_anomaly Hyperbolic anomaly
|
|
60
|
+
*/
|
|
61
|
+
export const solveKeplerHyperbolic = (Mh, e, tolerance = 1e-14, maxIter = 50) => {
|
|
62
|
+
for (const [name, x] of [
|
|
63
|
+
['Mh', Mh],
|
|
64
|
+
['e', e],
|
|
65
|
+
['tolerance', tolerance],
|
|
66
|
+
['maxIter', maxIter]
|
|
67
|
+
]) {
|
|
68
|
+
if (!Number.isFinite(x))
|
|
69
|
+
throw new TypeError(`${name} must be a finite number. Received: ${x}`);
|
|
70
|
+
}
|
|
71
|
+
if (e <= 1)
|
|
72
|
+
throw new RangeError(`e must be > 1. Received: ${e}`);
|
|
73
|
+
if (tolerance <= 0)
|
|
74
|
+
throw new RangeError(`tolerance must be > 0. Received: ${tolerance}`);
|
|
75
|
+
if (maxIter < 1)
|
|
76
|
+
throw new RangeError(`maxIter must be >= 1. Received: ${maxIter}`);
|
|
77
|
+
const M = Math.abs(Mh);
|
|
78
|
+
// Start above the root, where Newton's method can't overshoot
|
|
79
|
+
let F = Math.min(Math.asinh(M / (e - 1)), Math.cbrt((6 * M) / e));
|
|
80
|
+
for (let iter = 0; iter < maxIter; iter++) {
|
|
81
|
+
// e sinh F - F - M, written so nothing cancels when e ≈ 1 and F is small
|
|
82
|
+
const f = (e - 1) * F + e * sinhMinusX(F) - M;
|
|
83
|
+
const step = f / (e * Math.cosh(F) - 1);
|
|
84
|
+
F -= step;
|
|
85
|
+
if (Math.abs(step) <= tolerance * Math.max(1, Math.abs(F)))
|
|
86
|
+
return Math.sign(Mh) * F;
|
|
87
|
+
}
|
|
88
|
+
throw new Error(`solveKeplerHyperbolic did not converge in ${maxIter} steps. Received: Mh=${Mh}, e=${e}`);
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=solve-kepler-hyperbolic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solve-kepler-hyperbolic.js","sourceRoot":"","sources":["../../../src/categories/kepler/solve-kepler-hyperbolic.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,UAAU,GAAG,CAAC,CAAS,EAAU,EAAE;IACvC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG;QAAE,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAE/C,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IAEjB,IAAI,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,GAAG,GAAG,IAAI,CAAC;IAEf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,IA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,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAElE,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC;QAC1C,yEAAyE;QACzE,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAExC,CAAC,IAAI,IAAI,CAAC;QAEV,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACxD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,IAAI,KAAK,CACb,6CAA6C,OAAO,wBAAwB,EAAE,OAAO,CAAC,EAAE,CACzF,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the **eccentricity of a hyperbola** from the excess speed and the periapsis distance.
|
|
3
|
+
*
|
|
4
|
+
* $$
|
|
5
|
+
* e = 1 + \frac{r_p\, v_\infty^2}{\mu}
|
|
6
|
+
* $$
|
|
7
|
+
*
|
|
8
|
+
* Where:
|
|
9
|
+
* - $ r_p $ is the periapsis distance from the body's centre (m)
|
|
10
|
+
* - $ v_\infty $ is the hyperbolic excess speed (m/s)
|
|
11
|
+
* - $ \mu $ is the body's gravitational parameter (m³/s²)
|
|
12
|
+
*
|
|
13
|
+
* **Units**
|
|
14
|
+
* - Inputs: `vInfinity` in **m/s**, `rp` in **m**, `mu` in **m³/s²**.
|
|
15
|
+
* - Output: $ e $ dimensionless, > 1.
|
|
16
|
+
*
|
|
17
|
+
* ::: info Notes
|
|
18
|
+
*
|
|
19
|
+
* - From $ r_p = a(1 - e) $ with $ a = -\mu / v_\infty^2 $.
|
|
20
|
+
* - A slow, close pass gives $ e $ just above 1, a nearly parabolic swing; a fast, distant one gives a large $ e $ and a nearly straight path.
|
|
21
|
+
* - The trajectory turns through $ 2\arcsin(1/e) $; see `gravityAssistTurningAngle`.
|
|
22
|
+
*
|
|
23
|
+
* :::
|
|
24
|
+
*
|
|
25
|
+
* ::: practice Apollo 11, arriving at the Moon
|
|
26
|
+
*
|
|
27
|
+
* **1.44**
|
|
28
|
+
*
|
|
29
|
+
* _Approach hyperbola: 1.08 km/s excess speed, closest approach 113.9 km above the surface_
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* hyperbolicEccentricity(1080, 1_737_400 + 113_900, 4.902800118e12); // ≈ 1.440
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* :::
|
|
36
|
+
*
|
|
37
|
+
* @param vInfinity - Hyperbolic excess speed $ v_\infty $ in **m/s** (finite, > 0).
|
|
38
|
+
* @param rp - Periapsis distance $ r_p $ in **m** (finite, > 0).
|
|
39
|
+
* @param mu - Gravitational parameter $ \mu $ in **m³/s²** (finite, > 0).
|
|
40
|
+
* @returns Eccentricity $ e $ (> 1).
|
|
41
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
42
|
+
* @throws {RangeError} If `vInfinity <= 0`, `rp <= 0` or `mu <= 0`.
|
|
43
|
+
* @group Orbits
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // A Jupiter flyby: v∞ = 6 km/s, periapsis at 5 Jupiter radii
|
|
48
|
+
* const e = hyperbolicEccentricity(6000, 5 * 71_492e3, 1.26686534e17);
|
|
49
|
+
* // e ≈ 1.102
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link hyperbolicSemiMajorAxis}
|
|
53
|
+
* @see {@link asymptoteTrueAnomaly}
|
|
54
|
+
*/
|
|
55
|
+
export declare const hyperbolicEccentricity: (vInfinity: number, rp: number, mu: number) => number;
|
|
56
|
+
//# sourceMappingURL=hyperbolic-eccentricity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperbolic-eccentricity.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/hyperbolic-eccentricity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,sBAAsB,GACjC,WAAW,MAAM,EACjB,IAAI,MAAM,EACV,IAAI,MAAM,KACT,MAkBF,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the **eccentricity of a hyperbola** from the excess speed and the periapsis distance.
|
|
3
|
+
*
|
|
4
|
+
* $$
|
|
5
|
+
* e = 1 + \frac{r_p\, v_\infty^2}{\mu}
|
|
6
|
+
* $$
|
|
7
|
+
*
|
|
8
|
+
* Where:
|
|
9
|
+
* - $ r_p $ is the periapsis distance from the body's centre (m)
|
|
10
|
+
* - $ v_\infty $ is the hyperbolic excess speed (m/s)
|
|
11
|
+
* - $ \mu $ is the body's gravitational parameter (m³/s²)
|
|
12
|
+
*
|
|
13
|
+
* **Units**
|
|
14
|
+
* - Inputs: `vInfinity` in **m/s**, `rp` in **m**, `mu` in **m³/s²**.
|
|
15
|
+
* - Output: $ e $ dimensionless, > 1.
|
|
16
|
+
*
|
|
17
|
+
* ::: info Notes
|
|
18
|
+
*
|
|
19
|
+
* - From $ r_p = a(1 - e) $ with $ a = -\mu / v_\infty^2 $.
|
|
20
|
+
* - A slow, close pass gives $ e $ just above 1, a nearly parabolic swing; a fast, distant one gives a large $ e $ and a nearly straight path.
|
|
21
|
+
* - The trajectory turns through $ 2\arcsin(1/e) $; see `gravityAssistTurningAngle`.
|
|
22
|
+
*
|
|
23
|
+
* :::
|
|
24
|
+
*
|
|
25
|
+
* ::: practice Apollo 11, arriving at the Moon
|
|
26
|
+
*
|
|
27
|
+
* **1.44**
|
|
28
|
+
*
|
|
29
|
+
* _Approach hyperbola: 1.08 km/s excess speed, closest approach 113.9 km above the surface_
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* hyperbolicEccentricity(1080, 1_737_400 + 113_900, 4.902800118e12); // ≈ 1.440
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* :::
|
|
36
|
+
*
|
|
37
|
+
* @param vInfinity - Hyperbolic excess speed $ v_\infty $ in **m/s** (finite, > 0).
|
|
38
|
+
* @param rp - Periapsis distance $ r_p $ in **m** (finite, > 0).
|
|
39
|
+
* @param mu - Gravitational parameter $ \mu $ in **m³/s²** (finite, > 0).
|
|
40
|
+
* @returns Eccentricity $ e $ (> 1).
|
|
41
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
42
|
+
* @throws {RangeError} If `vInfinity <= 0`, `rp <= 0` or `mu <= 0`.
|
|
43
|
+
* @group Orbits
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // A Jupiter flyby: v∞ = 6 km/s, periapsis at 5 Jupiter radii
|
|
48
|
+
* const e = hyperbolicEccentricity(6000, 5 * 71_492e3, 1.26686534e17);
|
|
49
|
+
* // e ≈ 1.102
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @see {@link hyperbolicSemiMajorAxis}
|
|
53
|
+
* @see {@link asymptoteTrueAnomaly}
|
|
54
|
+
*/
|
|
55
|
+
export const hyperbolicEccentricity = (vInfinity, rp, mu) => {
|
|
56
|
+
for (const [name, x] of [
|
|
57
|
+
['vInfinity', vInfinity],
|
|
58
|
+
['rp', rp],
|
|
59
|
+
['mu', mu]
|
|
60
|
+
]) {
|
|
61
|
+
if (!Number.isFinite(x))
|
|
62
|
+
throw new TypeError(`${name} must be a finite number. Received: ${x}`);
|
|
63
|
+
}
|
|
64
|
+
if (vInfinity <= 0)
|
|
65
|
+
throw new RangeError(`vInfinity must be > 0. Received: ${vInfinity}`);
|
|
66
|
+
if (rp <= 0)
|
|
67
|
+
throw new RangeError(`rp must be > 0. Received: ${rp}`);
|
|
68
|
+
if (mu <= 0)
|
|
69
|
+
throw new RangeError(`mu must be > 0. Received: ${mu}`);
|
|
70
|
+
return 1 + (rp * vInfinity * vInfinity) / mu;
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=hyperbolic-eccentricity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperbolic-eccentricity.js","sourceRoot":"","sources":["../../../src/categories/orbits/hyperbolic-eccentricity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,SAAiB,EACjB,EAAU,EACV,EAAU,EACF,EAAE;IACV,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI;QACtB,CAAC,WAAW,EAAE,SAAS,CAAC;QACxB,CAAC,IAAI,EAAE,EAAE,CAAC;QACV,CAAC,IAAI,EAAE,EAAE,CAAC;KACF,EAAE,CAAC;QACX,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YACrB,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,uCAAuC,CAAC,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,SAAS,IAAI,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,oCAAoC,SAAS,EAAE,CAAC,CAAC;IAExE,IAAI,EAAE,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;IAErE,IAAI,EAAE,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;IAErE,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;AAC/C,CAAC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the **semi-major axis of a hyperbola** from the hyperbolic excess speed.
|
|
3
|
+
*
|
|
4
|
+
* $$
|
|
5
|
+
* a = -\frac{\mu}{v_\infty^2}
|
|
6
|
+
* $$
|
|
7
|
+
*
|
|
8
|
+
* Where:
|
|
9
|
+
* - $ v_\infty $ is the hyperbolic excess speed: the speed left over far from the body (m/s)
|
|
10
|
+
* - $ \mu $ is the body's gravitational parameter (m³/s²)
|
|
11
|
+
*
|
|
12
|
+
* **Units**
|
|
13
|
+
* - Inputs: `vInfinity` in **m/s**, `mu` in **m³/s²**.
|
|
14
|
+
* - Output: $ a $ in **m**, negative.
|
|
15
|
+
*
|
|
16
|
+
* ::: info Notes
|
|
17
|
+
*
|
|
18
|
+
* - Negative by convention, so that vis-viva $ v^2 = \mu(2/r - 1/a) $ holds for hyperbolas too.
|
|
19
|
+
* - $ v_\infty $ comes from a speed $ v $ at distance $ r $ by energy: $ v_\infty^2 = v^2 - 2\mu/r $, or from {@link characteristicEnergyC3} as $ \sqrt{C_3} $.
|
|
20
|
+
*
|
|
21
|
+
* :::
|
|
22
|
+
*
|
|
23
|
+
* ::: practice Apollo 11, arriving at the Moon
|
|
24
|
+
*
|
|
25
|
+
* **−4 203 km**
|
|
26
|
+
*
|
|
27
|
+
* _Approach hyperbola, with 1.08 km/s left over far from the Moon_
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* hyperbolicSemiMajorAxis(1080, 4.902800118e12); // ≈ -4 203 361 m
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* :::
|
|
34
|
+
*
|
|
35
|
+
* @param vInfinity - Hyperbolic excess speed $ v_\infty $ in **m/s** (finite, > 0).
|
|
36
|
+
* @param mu - Gravitational parameter $ \mu $ in **m³/s²** (finite, > 0).
|
|
37
|
+
* @returns Semi-major axis $ a $ in **m** (negative).
|
|
38
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
39
|
+
* @throws {RangeError} If `vInfinity <= 0` or `mu <= 0`.
|
|
40
|
+
* @group Orbits
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* // Leaving Earth for Mars with v∞ ≈ 2.95 km/s
|
|
45
|
+
* const a = hyperbolicSemiMajorAxis(2950, 3.986004418e14);
|
|
46
|
+
* // a ≈ -45 803 km
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see {@link hyperbolicEccentricity}
|
|
50
|
+
* @see {@link hyperbolicPeriapsisSpeed}
|
|
51
|
+
*/
|
|
52
|
+
export declare const hyperbolicSemiMajorAxis: (vInfinity: number, mu: number) => number;
|
|
53
|
+
//# sourceMappingURL=hyperbolic-semi-major-axis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperbolic-semi-major-axis.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/hyperbolic-semi-major-axis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,eAAO,MAAM,uBAAuB,GAClC,WAAW,MAAM,EACjB,IAAI,MAAM,KACT,MAeF,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the **semi-major axis of a hyperbola** from the hyperbolic excess speed.
|
|
3
|
+
*
|
|
4
|
+
* $$
|
|
5
|
+
* a = -\frac{\mu}{v_\infty^2}
|
|
6
|
+
* $$
|
|
7
|
+
*
|
|
8
|
+
* Where:
|
|
9
|
+
* - $ v_\infty $ is the hyperbolic excess speed: the speed left over far from the body (m/s)
|
|
10
|
+
* - $ \mu $ is the body's gravitational parameter (m³/s²)
|
|
11
|
+
*
|
|
12
|
+
* **Units**
|
|
13
|
+
* - Inputs: `vInfinity` in **m/s**, `mu` in **m³/s²**.
|
|
14
|
+
* - Output: $ a $ in **m**, negative.
|
|
15
|
+
*
|
|
16
|
+
* ::: info Notes
|
|
17
|
+
*
|
|
18
|
+
* - Negative by convention, so that vis-viva $ v^2 = \mu(2/r - 1/a) $ holds for hyperbolas too.
|
|
19
|
+
* - $ v_\infty $ comes from a speed $ v $ at distance $ r $ by energy: $ v_\infty^2 = v^2 - 2\mu/r $, or from {@link characteristicEnergyC3} as $ \sqrt{C_3} $.
|
|
20
|
+
*
|
|
21
|
+
* :::
|
|
22
|
+
*
|
|
23
|
+
* ::: practice Apollo 11, arriving at the Moon
|
|
24
|
+
*
|
|
25
|
+
* **−4 203 km**
|
|
26
|
+
*
|
|
27
|
+
* _Approach hyperbola, with 1.08 km/s left over far from the Moon_
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* hyperbolicSemiMajorAxis(1080, 4.902800118e12); // ≈ -4 203 361 m
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* :::
|
|
34
|
+
*
|
|
35
|
+
* @param vInfinity - Hyperbolic excess speed $ v_\infty $ in **m/s** (finite, > 0).
|
|
36
|
+
* @param mu - Gravitational parameter $ \mu $ in **m³/s²** (finite, > 0).
|
|
37
|
+
* @returns Semi-major axis $ a $ in **m** (negative).
|
|
38
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
39
|
+
* @throws {RangeError} If `vInfinity <= 0` or `mu <= 0`.
|
|
40
|
+
* @group Orbits
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* // Leaving Earth for Mars with v∞ ≈ 2.95 km/s
|
|
45
|
+
* const a = hyperbolicSemiMajorAxis(2950, 3.986004418e14);
|
|
46
|
+
* // a ≈ -45 803 km
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @see {@link hyperbolicEccentricity}
|
|
50
|
+
* @see {@link hyperbolicPeriapsisSpeed}
|
|
51
|
+
*/
|
|
52
|
+
export const hyperbolicSemiMajorAxis = (vInfinity, mu) => {
|
|
53
|
+
for (const [name, x] of [
|
|
54
|
+
['vInfinity', vInfinity],
|
|
55
|
+
['mu', mu]
|
|
56
|
+
]) {
|
|
57
|
+
if (!Number.isFinite(x))
|
|
58
|
+
throw new TypeError(`${name} must be a finite number. Received: ${x}`);
|
|
59
|
+
}
|
|
60
|
+
if (vInfinity <= 0)
|
|
61
|
+
throw new RangeError(`vInfinity must be > 0. Received: ${vInfinity}`);
|
|
62
|
+
if (mu <= 0)
|
|
63
|
+
throw new RangeError(`mu must be > 0. Received: ${mu}`);
|
|
64
|
+
return -mu / (vInfinity * vInfinity);
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=hyperbolic-semi-major-axis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperbolic-semi-major-axis.js","sourceRoot":"","sources":["../../../src/categories/orbits/hyperbolic-semi-major-axis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,SAAiB,EACjB,EAAU,EACF,EAAE;IACV,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI;QACtB,CAAC,WAAW,EAAE,SAAS,CAAC;QACxB,CAAC,IAAI,EAAE,EAAE,CAAC;KACF,EAAE,CAAC;QACX,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;YACrB,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,uCAAuC,CAAC,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,SAAS,IAAI,CAAC;QAChB,MAAM,IAAI,UAAU,CAAC,oCAAoC,SAAS,EAAE,CAAC,CAAC;IAExE,IAAI,EAAE,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,6BAA6B,EAAE,EAAE,CAAC,CAAC;IAErE,OAAO,CAAC,EAAE,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;AACvC,CAAC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Radians } from '@interstellar-tools/types';
|
|
2
|
+
/**
|
|
3
|
+
* Compute the **time of flight between two points on a hyperbola**, given by their true anomalies.
|
|
4
|
+
*
|
|
5
|
+
* $$
|
|
6
|
+
* t_2 - t_1 = \sqrt{\frac{-a^3}{\mu}}\,\Big[(e\sinh F_2 - F_2) - (e\sinh F_1 - F_1)\Big]
|
|
7
|
+
* $$
|
|
8
|
+
*
|
|
9
|
+
* with each hyperbolic anomaly $ F $ from {@link trueToHyperbolicAnomaly}.
|
|
10
|
+
*
|
|
11
|
+
* **Units**
|
|
12
|
+
* - Inputs: `nu1`, `nu2` in **radians**, `e` dimensionless, `a` in **m** (negative), `mu` in **m³/s²**.
|
|
13
|
+
* - Output: time in **s**, negative if `nu2` comes before `nu1`.
|
|
14
|
+
*
|
|
15
|
+
* ::: info Notes
|
|
16
|
+
*
|
|
17
|
+
* - Both points must lie inside the asymptotes. The incoming branch can be given as negative angles or just below 2π.
|
|
18
|
+
* - Crossing periapsis needs no special handling: $ F $ changes sign there.
|
|
19
|
+
* - To go from a time to a position, solve $ M_h = e\sinh F - F $ with {@link solveKeplerHyperbolic}, then use {@link hyperbolicToTrueAnomaly}.
|
|
20
|
+
*
|
|
21
|
+
* :::
|
|
22
|
+
*
|
|
23
|
+
* ::: practice Apollo 11, falling towards the Moon
|
|
24
|
+
*
|
|
25
|
+
* **13.8 h**
|
|
26
|
+
*
|
|
27
|
+
* _From the edge of the Moon's sphere of influence, 62 640 km out, to closest approach_
|
|
28
|
+
*
|
|
29
|
+
* The flight took 14 h 10 min from crossing into the sphere to lighting the engine for lunar orbit insertion. Patched conics leave out Earth's pull inside the sphere, one reason the two differ.
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* const e = 1.44; // approach hyperbola
|
|
33
|
+
* const a = -4_203_000; // m
|
|
34
|
+
* const p = a * (1 - e * e);
|
|
35
|
+
* const nuSoi = -Math.acos((p / 62_640_000 - 1) / e) as Radians; // incoming
|
|
36
|
+
* hyperbolicTimeOfFlight(nuSoi, 0 as Radians, e, a, 4.902800118e12); // ≈ 49 600 s
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* :::
|
|
40
|
+
*
|
|
41
|
+
* @param nu1 - True anomaly at the start $ \nu_1 $ in **radians** (finite, inside the asymptotes).
|
|
42
|
+
* @param nu2 - True anomaly at the end $ \nu_2 $ in **radians** (finite, inside the asymptotes).
|
|
43
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
44
|
+
* @param a - Semi-major axis $ a $ in **m** (finite, < 0).
|
|
45
|
+
* @param mu - Gravitational parameter $ \mu $ in **m³/s²** (finite, > 0).
|
|
46
|
+
* @returns Time of flight in **s** from `nu1` to `nu2`.
|
|
47
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
48
|
+
* @throws {RangeError} If `e <= 1`, `a >= 0`, `mu <= 0`, or either true anomaly is at or beyond the asymptotes.
|
|
49
|
+
* @group Orbits
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import type { Radians } from '@interstellar-tools/types';
|
|
54
|
+
*
|
|
55
|
+
* // From periapsis to 90° on a hyperbola with e = 2, a = -10 000 km, around Earth
|
|
56
|
+
* const t = hyperbolicTimeOfFlight(0 as Radians, (Math.PI / 2) as Radians, 2, -10_000e3, 3.986004418e14);
|
|
57
|
+
* // t ≈ 3 401 s
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @see {@link solveKeplerHyperbolic}
|
|
61
|
+
* @see https://en.wikipedia.org/wiki/Hyperbolic_trajectory Hyperbolic trajectory
|
|
62
|
+
*/
|
|
63
|
+
export declare const hyperbolicTimeOfFlight: (nu1: Radians, nu2: Radians, e: number, a: number, mu: number) => number;
|
|
64
|
+
//# sourceMappingURL=hyperbolic-time-of-flight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperbolic-time-of-flight.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/hyperbolic-time-of-flight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,GAAG,MAAM,EACT,GAAG,MAAM,EACT,IAAI,MAAM,KACT,MA0BF,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { trueToHyperbolicAnomaly } from '../anomalies/true-to-hyperbolic-anomaly.js';
|
|
2
|
+
/**
|
|
3
|
+
* Compute the **time of flight between two points on a hyperbola**, given by their true anomalies.
|
|
4
|
+
*
|
|
5
|
+
* $$
|
|
6
|
+
* t_2 - t_1 = \sqrt{\frac{-a^3}{\mu}}\,\Big[(e\sinh F_2 - F_2) - (e\sinh F_1 - F_1)\Big]
|
|
7
|
+
* $$
|
|
8
|
+
*
|
|
9
|
+
* with each hyperbolic anomaly $ F $ from {@link trueToHyperbolicAnomaly}.
|
|
10
|
+
*
|
|
11
|
+
* **Units**
|
|
12
|
+
* - Inputs: `nu1`, `nu2` in **radians**, `e` dimensionless, `a` in **m** (negative), `mu` in **m³/s²**.
|
|
13
|
+
* - Output: time in **s**, negative if `nu2` comes before `nu1`.
|
|
14
|
+
*
|
|
15
|
+
* ::: info Notes
|
|
16
|
+
*
|
|
17
|
+
* - Both points must lie inside the asymptotes. The incoming branch can be given as negative angles or just below 2π.
|
|
18
|
+
* - Crossing periapsis needs no special handling: $ F $ changes sign there.
|
|
19
|
+
* - To go from a time to a position, solve $ M_h = e\sinh F - F $ with {@link solveKeplerHyperbolic}, then use {@link hyperbolicToTrueAnomaly}.
|
|
20
|
+
*
|
|
21
|
+
* :::
|
|
22
|
+
*
|
|
23
|
+
* ::: practice Apollo 11, falling towards the Moon
|
|
24
|
+
*
|
|
25
|
+
* **13.8 h**
|
|
26
|
+
*
|
|
27
|
+
* _From the edge of the Moon's sphere of influence, 62 640 km out, to closest approach_
|
|
28
|
+
*
|
|
29
|
+
* The flight took 14 h 10 min from crossing into the sphere to lighting the engine for lunar orbit insertion. Patched conics leave out Earth's pull inside the sphere, one reason the two differ.
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* const e = 1.44; // approach hyperbola
|
|
33
|
+
* const a = -4_203_000; // m
|
|
34
|
+
* const p = a * (1 - e * e);
|
|
35
|
+
* const nuSoi = -Math.acos((p / 62_640_000 - 1) / e) as Radians; // incoming
|
|
36
|
+
* hyperbolicTimeOfFlight(nuSoi, 0 as Radians, e, a, 4.902800118e12); // ≈ 49 600 s
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* :::
|
|
40
|
+
*
|
|
41
|
+
* @param nu1 - True anomaly at the start $ \nu_1 $ in **radians** (finite, inside the asymptotes).
|
|
42
|
+
* @param nu2 - True anomaly at the end $ \nu_2 $ in **radians** (finite, inside the asymptotes).
|
|
43
|
+
* @param e - Eccentricity $ e $ (finite, > 1).
|
|
44
|
+
* @param a - Semi-major axis $ a $ in **m** (finite, < 0).
|
|
45
|
+
* @param mu - Gravitational parameter $ \mu $ in **m³/s²** (finite, > 0).
|
|
46
|
+
* @returns Time of flight in **s** from `nu1` to `nu2`.
|
|
47
|
+
* @throws {TypeError} If any input is not a finite number.
|
|
48
|
+
* @throws {RangeError} If `e <= 1`, `a >= 0`, `mu <= 0`, or either true anomaly is at or beyond the asymptotes.
|
|
49
|
+
* @group Orbits
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import type { Radians } from '@interstellar-tools/types';
|
|
54
|
+
*
|
|
55
|
+
* // From periapsis to 90° on a hyperbola with e = 2, a = -10 000 km, around Earth
|
|
56
|
+
* const t = hyperbolicTimeOfFlight(0 as Radians, (Math.PI / 2) as Radians, 2, -10_000e3, 3.986004418e14);
|
|
57
|
+
* // t ≈ 3 401 s
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @see {@link solveKeplerHyperbolic}
|
|
61
|
+
* @see https://en.wikipedia.org/wiki/Hyperbolic_trajectory Hyperbolic trajectory
|
|
62
|
+
*/
|
|
63
|
+
export const hyperbolicTimeOfFlight = (nu1, nu2, e, a, mu) => {
|
|
64
|
+
for (const [name, x] of [
|
|
65
|
+
['nu1', nu1],
|
|
66
|
+
['nu2', nu2],
|
|
67
|
+
['e', e],
|
|
68
|
+
['a', a],
|
|
69
|
+
['mu', mu]
|
|
70
|
+
]) {
|
|
71
|
+
if (!Number.isFinite(x))
|
|
72
|
+
throw new TypeError(`${name} must be a finite number. Received: ${x}`);
|
|
73
|
+
}
|
|
74
|
+
if (e <= 1)
|
|
75
|
+
throw new RangeError(`e must be > 1. Received: ${e}`);
|
|
76
|
+
if (a >= 0)
|
|
77
|
+
throw new RangeError(`a must be < 0 for a hyperbola. Received: ${a}`);
|
|
78
|
+
if (mu <= 0)
|
|
79
|
+
throw new RangeError(`mu must be > 0. Received: ${mu}`);
|
|
80
|
+
const meanAnomaly = (nu) => {
|
|
81
|
+
const F = trueToHyperbolicAnomaly(nu, e);
|
|
82
|
+
return e * Math.sinh(F) - F;
|
|
83
|
+
};
|
|
84
|
+
return Math.sqrt((-a * a * a) / mu) * (meanAnomaly(nu2) - meanAnomaly(nu1));
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=hyperbolic-time-of-flight.js.map
|
|
@@ -0,0 +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C,CAAC;IAEF,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;AAC9E,CAAC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -23,10 +23,14 @@ export * from './categories/helpers/rot-3.js';
|
|
|
23
23
|
export * from './categories/helpers/transpose-3.js';
|
|
24
24
|
export * from './categories/anomalies/advance-mean-anomaly.js';
|
|
25
25
|
export * from './categories/anomalies/anomaly-at.js';
|
|
26
|
+
export * from './categories/anomalies/asymptote-true-anomaly.js';
|
|
26
27
|
export * from './categories/anomalies/eccentric-to-true-anomaly.js';
|
|
28
|
+
export * from './categories/anomalies/hyperbolic-to-true-anomaly.js';
|
|
27
29
|
export * from './categories/anomalies/true-to-mean-anomaly.js';
|
|
30
|
+
export * from './categories/anomalies/true-to-hyperbolic-anomaly.js';
|
|
28
31
|
export * from './categories/kepler/solve-kepler-bisection.js';
|
|
29
32
|
export * from './categories/kepler/solve-kepler-high-eccentricity.js';
|
|
33
|
+
export * from './categories/kepler/solve-kepler-hyperbolic.js';
|
|
30
34
|
export * from './categories/kepler/solve-kepler-newton-raphson.js';
|
|
31
35
|
export * from './categories/kepler/solve-kepler.js';
|
|
32
36
|
export * from './categories/gravity/acceleration-on1-by2.js';
|
|
@@ -40,7 +44,10 @@ export * from './categories/orbits/cw-hill-derivatives.js';
|
|
|
40
44
|
export * from './categories/orbits/elements-to-state.js';
|
|
41
45
|
export * from './categories/orbits/escape-speed.js';
|
|
42
46
|
export * from './categories/orbits/flight-path-angle-from-true-anomaly.js';
|
|
47
|
+
export * from './categories/orbits/hyperbolic-eccentricity.js';
|
|
43
48
|
export * from './categories/orbits/hyperbolic-periapsis-speed.js';
|
|
49
|
+
export * from './categories/orbits/hyperbolic-semi-major-axis.js';
|
|
50
|
+
export * from './categories/orbits/hyperbolic-time-of-flight.js';
|
|
44
51
|
export * from './categories/orbits/inclination-from-launch-azimuth.js';
|
|
45
52
|
export * from './categories/orbits/j2-argument-of-perigee-rate.js';
|
|
46
53
|
export * from './categories/orbits/j2-nodal-precession-rate.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,qCAAqC,CAAC;AAEpD,cAAc,kCAAkC,CAAC;AAIjD,cAAc,8DAA8D,CAAC;AAE7E,cAAc,kEAAkE,CAAC;AAEjF,cAAc,wDAAwD,CAAC;AAEvE,cAAc,8DAA8D,CAAC;AAE7E,cAAc,qDAAqD,CAAC;AAEpE,cAAc,4DAA4D,CAAC;AAI3E,cAAc,wCAAwC,CAAC;AAEvD,cAAc,+CAA+C,CAAC;AAE9D,cAAc,+BAA+B,CAAC;AAE9C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,iDAAiD,CAAC;AAEhE,cAAc,iCAAiC,CAAC;AAEhD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,qCAAqC,CAAC;AAIpD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,sCAAsC,CAAC;AAErD,cAAc,qDAAqD,CAAC;AAEpE,cAAc,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,qCAAqC,CAAC;AAEpD,cAAc,kCAAkC,CAAC;AAIjD,cAAc,8DAA8D,CAAC;AAE7E,cAAc,kEAAkE,CAAC;AAEjF,cAAc,wDAAwD,CAAC;AAEvE,cAAc,8DAA8D,CAAC;AAE7E,cAAc,qDAAqD,CAAC;AAEpE,cAAc,4DAA4D,CAAC;AAI3E,cAAc,wCAAwC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EAAgE,CAAC;AAE/E,cAAc,kDAAkD,CAAC;AAEjE,cAAc,mDAAmD,CAAC;AAElE,cAAc,mDAAmD,CAAC;AAElE,cAAc,0CAA0C,CAAC;AAEzD,cAAc,+CAA+C,CAAC;AAE9D,cAAc,uCAAuC,CAAC;AAItD,cAAc,sCAAsC,CAAC;AAErD,cAAc,kDAAkD,CAAC;AAEjE,cAAc,yDAAyD,CAAC;AAExE,cAAc,yCAAyC,CAAC;AAExD,cAAc,6CAA6C,CAAC;AAE5D,cAAc,qDAAqD,CAAC;AAEpE,cAAc,2CAA2C,CAAC;AAE1D,cAAc,+CAA+C,CAAC;AAE9D,cAAc,iDAAiD,CAAC;AAEhE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,mDAAmD,CAAC;AAElE,cAAc,0CAA0C,CAAC;AAEzD,cAAc,6CAA6C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -27,11 +27,15 @@ export * from './categories/helpers/transpose-3.js';
|
|
|
27
27
|
// categories/anomalies
|
|
28
28
|
export * from './categories/anomalies/advance-mean-anomaly.js';
|
|
29
29
|
export * from './categories/anomalies/anomaly-at.js';
|
|
30
|
+
export * from './categories/anomalies/asymptote-true-anomaly.js';
|
|
30
31
|
export * from './categories/anomalies/eccentric-to-true-anomaly.js';
|
|
32
|
+
export * from './categories/anomalies/hyperbolic-to-true-anomaly.js';
|
|
31
33
|
export * from './categories/anomalies/true-to-mean-anomaly.js';
|
|
34
|
+
export * from './categories/anomalies/true-to-hyperbolic-anomaly.js';
|
|
32
35
|
// categories/kepler (solvers)
|
|
33
36
|
export * from './categories/kepler/solve-kepler-bisection.js';
|
|
34
37
|
export * from './categories/kepler/solve-kepler-high-eccentricity.js';
|
|
38
|
+
export * from './categories/kepler/solve-kepler-hyperbolic.js';
|
|
35
39
|
export * from './categories/kepler/solve-kepler-newton-raphson.js';
|
|
36
40
|
export * from './categories/kepler/solve-kepler.js';
|
|
37
41
|
// categories/gravity
|
|
@@ -47,7 +51,10 @@ export * from './categories/orbits/cw-hill-derivatives.js';
|
|
|
47
51
|
export * from './categories/orbits/elements-to-state.js';
|
|
48
52
|
export * from './categories/orbits/escape-speed.js';
|
|
49
53
|
export * from './categories/orbits/flight-path-angle-from-true-anomaly.js';
|
|
54
|
+
export * from './categories/orbits/hyperbolic-eccentricity.js';
|
|
50
55
|
export * from './categories/orbits/hyperbolic-periapsis-speed.js';
|
|
56
|
+
export * from './categories/orbits/hyperbolic-semi-major-axis.js';
|
|
57
|
+
export * from './categories/orbits/hyperbolic-time-of-flight.js';
|
|
51
58
|
export * from './categories/orbits/inclination-from-launch-azimuth.js';
|
|
52
59
|
export * from './categories/orbits/j2-argument-of-perigee-rate.js';
|
|
53
60
|
export * from './categories/orbits/j2-nodal-precession-rate.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mBAAmB;AACnB,cAAc,qCAAqC,CAAC;AAEpD,cAAc,kCAAkC,CAAC;AAEjD,yBAAyB;AAEzB,cAAc,8DAA8D,CAAC;AAE7E,cAAc,kEAAkE,CAAC;AAEjF,cAAc,wDAAwD,CAAC;AAEvE,cAAc,8DAA8D,CAAC;AAE7E,cAAc,qDAAqD,CAAC;AAEpE,cAAc,4DAA4D,CAAC;AAE3E,qBAAqB;AAErB,cAAc,wCAAwC,CAAC;AAEvD,cAAc,+CAA+C,CAAC;AAE9D,cAAc,+BAA+B,CAAC;AAE9C,cAAc,kCAAkC,CAAC;AAEjD,cAAc,8BAA8B,CAAC;AAE7C,cAAc,iDAAiD,CAAC;AAEhE,cAAc,iCAAiC,CAAC;AAEhD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,qCAAqC,CAAC;AAEpD,uBAAuB;AAEvB,cAAc,gDAAgD,CAAC;AAE/D,cAAc,sCAAsC,CAAC;AAErD,cAAc,qDAA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E,cAAc,iDAAiD,CAAC;AAEhE,cAAc,uCAAuC,CAAC;AAEtD,cAAc,4CAA4C,CAAC;AAE3D,cAAc,0CAA0C,CAAC;AAEzD,cAAc,qCAAqC,CAAC;AAEpD,cAAc,4DAA4D,CAAC;AAE3E,cAAc,gDAAgD,CAAC;AAE/D,cAAc,mDAAmD,CAAC;AAElE,cAAc,mDAAmD,CAAC;AAElE,cAAc,kDAAkD,CAAC;AAEjE,cAAc,wDAAwD,CAAC;AAEvE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,iDAAiD,CAAC;AAEhE,cAAc,sCAAsC,CAAC;AAErD,cAAc,uDAAuD,CAAC;AAEtE,cAAc,oCAAoC,CAAC;AAEnD,cAAc,4CAA4C,CAAC;AAE3D,cAAc,gDAAgD,CAAC;AAE/D,cAAc,gEAAgE,CAAC;AAE/E,cAAc,kDAAkD,CAAC;AAEjE,cAAc,mDAAmD,CAAC;AAElE,cAAc,mDAAmD,CAAC;AAElE,cAAc,0CAA0C,CAAC;AAEzD,cAAc,+CAA+C,CAAC;AAE9D,cAAc,uCAAuC,CAAC;AAEtD,wBAAwB;AAExB,cAAc,sCAAsC,CAAC;AAErD,cAAc,kDAAkD,CAAC;AAEjE,cAAc,yDAAyD,CAAC;AAExE,cAAc,yCAAyC,CAAC;AAExD,cAAc,6CAA6C,CAAC;AAE5D,cAAc,qDAAqD,CAAC;AAEpE,cAAc,2CAA2C,CAAC;AAE1D,cAAc,+CAA+C,CAAC;AAE9D,cAAc,iDAAiD,CAAC;AAEhE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,mDAAmD,CAAC;AAElE,cAAc,0CAA0C,CAAC;AAEzD,cAAc,6CAA6C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interstellar-tools/equations",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.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",
|