@interstellar-tools/equations 1.4.0 → 1.5.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.
@@ -0,0 +1,77 @@
1
+ import type { GeodeticCoordinatesInterface } from '@interstellar-tools/types';
2
+ /**
3
+ * Convert a **body-fixed Cartesian** position (ECEF for Earth) to **geodetic coordinates**: latitude, longitude and height.
4
+ *
5
+ * There's no closed form for the latitude. This uses Bowring's iteration on the parametric latitude $ \beta $:
6
+ *
7
+ * $$
8
+ * \tan\varphi = \frac{z + e'^2 b \sin^3\beta}{p - e^2 a \cos^3\beta},
9
+ * \qquad
10
+ * \tan\beta = \frac{b}{a}\tan\varphi
11
+ * $$
12
+ *
13
+ * and then
14
+ *
15
+ * $$
16
+ * \lambda = \operatorname{atan2}(y, x), \qquad
17
+ * h = p\cos\varphi + z\sin\varphi - a\sqrt{1 - e^2\sin^2\varphi}
18
+ * $$
19
+ *
20
+ * Where:
21
+ * - $ p = \sqrt{x^2 + y^2} $ is the distance from the rotation axis (m)
22
+ * - $ a $ is the equatorial radius, $ b = a\sqrt{1 - e^2} $ the polar radius (m)
23
+ * - $ e^2 $ is the first eccentricity squared, $ e'^2 = e^2 / (1 - e^2) $ the second
24
+ *
25
+ * **Units**
26
+ * - Inputs: `x`, `y`, `z` and `a` in **m**, `eSquared` dimensionless.
27
+ * - Output: `phi` and `lambda` in **radians**, `h` in **m**.
28
+ *
29
+ * ::: info Notes
30
+ *
31
+ * - Starting from $ \tan\beta = a z / (b p) $, two iterations reach sub-millimetre accuracy for points near Earth's surface; the loop runs until $ \beta $ stops changing, to at most 10 iterations.
32
+ * - The height formula is stable everywhere, the poles included. On the rotation axis, `phi` is ±π/2 and `lambda` is 0.
33
+ * - For a point on the surface, `phi` equals {@link planetographicLatitudeOblate}; this one also handles points above and below it.
34
+ * - {@link geodeticToBodyFixed} goes the other way.
35
+ *
36
+ * :::
37
+ *
38
+ * ::: practice Apollo 11, in Earth orbit
39
+ *
40
+ * **32.672° N, 191.1 km up**
41
+ *
42
+ * _At orbit insertion: 6 563.0 km from Earth's centre, at 32.502° N geocentric_
43
+ *
44
+ * Seen from Earth's centre, the insertion point was at 32.502°, the latitude that fixes the orbit's inclination. On a map it was 0.170° further north, the latitude the flight evaluation report gives.
45
+ *
46
+ * ```ts
47
+ * const lat = toRad(32.502);
48
+ * const r = 6_563_041;
49
+ * bodyFixedToGeodetic(r * Math.cos(lat), 0, r * Math.sin(lat), 6_378_137, 0.00669437999014);
50
+ * // phi ≈ 32.672°, h ≈ 191.1 km
51
+ * ```
52
+ *
53
+ * :::
54
+ *
55
+ * @param x - Body-fixed $ x $ in **m** (finite), through the prime meridian.
56
+ * @param y - Body-fixed $ y $ in **m** (finite), through 90° east.
57
+ * @param z - Body-fixed $ z $ in **m** (finite), along the rotation axis.
58
+ * @param a - Equatorial radius $ a $ in **m** (finite, > 0).
59
+ * @param eSquared - First eccentricity squared $ e^2 $ (finite, in [0, 1)).
60
+ * @returns The geodetic latitude, longitude and height.
61
+ * @throws {TypeError} If any input is not a finite number.
62
+ * @throws {RangeError} If `a <= 0`, `eSquared` is outside [0, 1), or the point is at the centre.
63
+ * @group Cartography
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * // 1 km above the North Pole on WGS84
68
+ * const { phi, h } = bodyFixedToGeodetic(0, 0, 6_357_752.314, 6_378_137, 0.00669437999014);
69
+ * // phi = π/2, h ≈ 1 000 m
70
+ * ```
71
+ *
72
+ * @see {@link geodeticToBodyFixed}
73
+ * @see {@link planetographicLatitudeOblate}
74
+ * @see https://en.wikipedia.org/wiki/Geographic_coordinate_conversion Geographic coordinate conversion
75
+ */
76
+ export declare const bodyFixedToGeodetic: (x: number, y: number, z: number, a: number, eSquared: number) => GeodeticCoordinatesInterface;
77
+ //# sourceMappingURL=body-fixed-to-geodetic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body-fixed-to-geodetic.d.ts","sourceRoot":"","sources":["../../../src/categories/cartography/body-fixed-to-geodetic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAE7B,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,GAAG,MAAM,EACT,GAAG,MAAM,EACT,GAAG,MAAM,EACT,GAAG,MAAM,EACT,UAAU,MAAM,KACf,4BAiDF,CAAC"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Convert a **body-fixed Cartesian** position (ECEF for Earth) to **geodetic coordinates**: latitude, longitude and height.
3
+ *
4
+ * There's no closed form for the latitude. This uses Bowring's iteration on the parametric latitude $ \beta $:
5
+ *
6
+ * $$
7
+ * \tan\varphi = \frac{z + e'^2 b \sin^3\beta}{p - e^2 a \cos^3\beta},
8
+ * \qquad
9
+ * \tan\beta = \frac{b}{a}\tan\varphi
10
+ * $$
11
+ *
12
+ * and then
13
+ *
14
+ * $$
15
+ * \lambda = \operatorname{atan2}(y, x), \qquad
16
+ * h = p\cos\varphi + z\sin\varphi - a\sqrt{1 - e^2\sin^2\varphi}
17
+ * $$
18
+ *
19
+ * Where:
20
+ * - $ p = \sqrt{x^2 + y^2} $ is the distance from the rotation axis (m)
21
+ * - $ a $ is the equatorial radius, $ b = a\sqrt{1 - e^2} $ the polar radius (m)
22
+ * - $ e^2 $ is the first eccentricity squared, $ e'^2 = e^2 / (1 - e^2) $ the second
23
+ *
24
+ * **Units**
25
+ * - Inputs: `x`, `y`, `z` and `a` in **m**, `eSquared` dimensionless.
26
+ * - Output: `phi` and `lambda` in **radians**, `h` in **m**.
27
+ *
28
+ * ::: info Notes
29
+ *
30
+ * - Starting from $ \tan\beta = a z / (b p) $, two iterations reach sub-millimetre accuracy for points near Earth's surface; the loop runs until $ \beta $ stops changing, to at most 10 iterations.
31
+ * - The height formula is stable everywhere, the poles included. On the rotation axis, `phi` is ±π/2 and `lambda` is 0.
32
+ * - For a point on the surface, `phi` equals {@link planetographicLatitudeOblate}; this one also handles points above and below it.
33
+ * - {@link geodeticToBodyFixed} goes the other way.
34
+ *
35
+ * :::
36
+ *
37
+ * ::: practice Apollo 11, in Earth orbit
38
+ *
39
+ * **32.672° N, 191.1 km up**
40
+ *
41
+ * _At orbit insertion: 6 563.0 km from Earth's centre, at 32.502° N geocentric_
42
+ *
43
+ * Seen from Earth's centre, the insertion point was at 32.502°, the latitude that fixes the orbit's inclination. On a map it was 0.170° further north, the latitude the flight evaluation report gives.
44
+ *
45
+ * ```ts
46
+ * const lat = toRad(32.502);
47
+ * const r = 6_563_041;
48
+ * bodyFixedToGeodetic(r * Math.cos(lat), 0, r * Math.sin(lat), 6_378_137, 0.00669437999014);
49
+ * // phi ≈ 32.672°, h ≈ 191.1 km
50
+ * ```
51
+ *
52
+ * :::
53
+ *
54
+ * @param x - Body-fixed $ x $ in **m** (finite), through the prime meridian.
55
+ * @param y - Body-fixed $ y $ in **m** (finite), through 90° east.
56
+ * @param z - Body-fixed $ z $ in **m** (finite), along the rotation axis.
57
+ * @param a - Equatorial radius $ a $ in **m** (finite, > 0).
58
+ * @param eSquared - First eccentricity squared $ e^2 $ (finite, in [0, 1)).
59
+ * @returns The geodetic latitude, longitude and height.
60
+ * @throws {TypeError} If any input is not a finite number.
61
+ * @throws {RangeError} If `a <= 0`, `eSquared` is outside [0, 1), or the point is at the centre.
62
+ * @group Cartography
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * // 1 km above the North Pole on WGS84
67
+ * const { phi, h } = bodyFixedToGeodetic(0, 0, 6_357_752.314, 6_378_137, 0.00669437999014);
68
+ * // phi = π/2, h ≈ 1 000 m
69
+ * ```
70
+ *
71
+ * @see {@link geodeticToBodyFixed}
72
+ * @see {@link planetographicLatitudeOblate}
73
+ * @see https://en.wikipedia.org/wiki/Geographic_coordinate_conversion Geographic coordinate conversion
74
+ */
75
+ export const bodyFixedToGeodetic = (x, y, z, a, eSquared) => {
76
+ for (const [name, v] of [
77
+ ['x', x],
78
+ ['y', y],
79
+ ['z', z],
80
+ ['a', a],
81
+ ['eSquared', eSquared]
82
+ ]) {
83
+ if (!Number.isFinite(v))
84
+ throw new TypeError(`${name} must be a finite number. Received: ${v}`);
85
+ }
86
+ if (a <= 0)
87
+ throw new RangeError(`a must be > 0. Received: ${a}`);
88
+ if (eSquared < 0 || eSquared >= 1)
89
+ throw new RangeError(`eSquared must be in [0, 1). Received: ${eSquared}`);
90
+ const p = Math.hypot(x, y);
91
+ if (p === 0 && z === 0)
92
+ throw new RangeError('The point must not be at the centre of the body.');
93
+ const lambda = (p === 0 ? 0 : Math.atan2(y, x));
94
+ const b = a * Math.sqrt(1 - eSquared);
95
+ const ePrimeSquared = eSquared / (1 - eSquared);
96
+ let beta = Math.atan2(a * z, b * p);
97
+ let phi = 0;
98
+ for (let k = 0; k < 10; k++) {
99
+ phi = Math.atan2(z + ePrimeSquared * b * Math.sin(beta) ** 3, p - eSquared * a * Math.cos(beta) ** 3);
100
+ const next = Math.atan2(b * Math.sin(phi), a * Math.cos(phi));
101
+ if (Math.abs(next - beta) < 1e-15)
102
+ break;
103
+ beta = next;
104
+ }
105
+ const sinPhi = Math.sin(phi);
106
+ const h = p * Math.cos(phi) +
107
+ z * sinPhi -
108
+ a * Math.sqrt(1 - eSquared * sinPhi * sinPhi);
109
+ return { phi: phi, lambda, h };
110
+ };
111
+ //# sourceMappingURL=body-fixed-to-geodetic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body-fixed-to-geodetic.js","sourceRoot":"","sources":["../../../src/categories/cartography/body-fixed-to-geodetic.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,CAAS,EACT,CAAS,EACT,CAAS,EACT,CAAS,EACT,QAA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AAI,GAAG,GAAG,CAAC,CAAC;IAEZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,GAAG,GAAG,IAAI,CAAC,KAAK,CACd,CAAC,GAAG,aAAa,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAC3C,CAAC,GAAG,QAAQ,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CACvC,CAAC;QAEF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAE9D,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,KAAK;YAAE,MAAM;QAEzC,IAAI,GAAG,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,CAAC,GACL,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QACjB,CAAC,GAAG,MAAM;QACV,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;IAEhD,OAAO,EAAE,GAAG,EAAE,GAAc,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;AAC5C,CAAC,CAAC"}
@@ -0,0 +1,73 @@
1
+ import type { Radians, Vector3DTupleType } from '@interstellar-tools/types';
2
+ /**
3
+ * Convert **geodetic coordinates** (latitude, longitude, height) to a **body-fixed Cartesian** position, ECEF for Earth.
4
+ *
5
+ * $$
6
+ * \begin{aligned}
7
+ * x &= (N + h)\cos\varphi\cos\lambda \\
8
+ * y &= (N + h)\cos\varphi\sin\lambda \\
9
+ * z &= \big(N(1 - e^2) + h\big)\sin\varphi
10
+ * \end{aligned}
11
+ * \qquad
12
+ * N = \frac{a}{\sqrt{1 - e^2\sin^2\varphi}}
13
+ * $$
14
+ *
15
+ * Where:
16
+ * - $ \varphi $ is the geodetic latitude and $ \lambda $ the longitude (rad)
17
+ * - $ h $ is the height above the ellipsoid, along its normal (m)
18
+ * - $ a $ is the equatorial radius (m) and $ e^2 $ the first eccentricity squared
19
+ * - $ N $ is the prime vertical radius of curvature (m)
20
+ *
21
+ * **Units**
22
+ * - Inputs: `phi` and `lambda` in **radians**, `h` and `a` in **m**, `eSquared` dimensionless.
23
+ * - Output: `[x, y, z]` in **m**, with $ z $ along the rotation axis and $ x $ through the prime meridian.
24
+ *
25
+ * ::: info Notes
26
+ *
27
+ * - Geodetic latitude is the angle of the ellipsoid's normal, the latitude on maps. The geocentric latitude, the angle seen from the centre, is `atan2(z, hypot(x, y))` of the result, and is smaller everywhere but the equator and the poles.
28
+ * - WGS84: $ a = 6\,378\,137 $ m, $ e^2 = 0.00669437999014 $. Get $ e^2 $ from the radii with {@link eccentricitySquaredOblateSpheroid}.
29
+ * - {@link bodyFixedToGeodetic} goes the other way.
30
+ *
31
+ * :::
32
+ *
33
+ * ::: practice Apollo 11, on Pad 39A
34
+ *
35
+ * **6 373.3 km**
36
+ *
37
+ * _From Earth's centre, at 28.608° N geodetic, 80.604° W on the WGS84 ellipsoid_
38
+ *
39
+ * The geocentric latitude is 28.447°, 0.161° less than on the map. That's the latitude the launch-site formulas such as `surfaceRotationSpeed` need.
40
+ *
41
+ * ```ts
42
+ * const [x, y, z] = geodeticToBodyFixed(toRad(28.608422), toRad(-80.604133), 0, 6_378_137, 0.00669437999014);
43
+ * Math.hypot(x, y, z); // ≈ 6 373 266 m
44
+ * toDeg(Math.atan2(z, Math.hypot(x, y))); // ≈ 28.447°
45
+ * ```
46
+ *
47
+ * :::
48
+ *
49
+ * @param phi - Geodetic latitude $ \varphi $ in **radians** (finite, in [-π/2, π/2]).
50
+ * @param lambda - Longitude $ \lambda $ in **radians**, east positive (finite).
51
+ * @param h - Height $ h $ above the ellipsoid in **m** (finite; negative below it).
52
+ * @param a - Equatorial radius $ a $ in **m** (finite, > 0).
53
+ * @param eSquared - First eccentricity squared $ e^2 $ (finite, in [0, 1)).
54
+ * @returns Body-fixed position `[x, y, z]` in **m**.
55
+ * @throws {TypeError} If any input is not a finite number.
56
+ * @throws {RangeError} If `phi` is outside [-π/2, π/2], `a <= 0`, or `eSquared` is outside [0, 1).
57
+ * @group Cartography
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * import type { Radians } from '@interstellar-tools/types';
62
+ *
63
+ * // On the equator at the prime meridian, 100 m up
64
+ * geodeticToBodyFixed(0 as Radians, 0 as Radians, 100, 6_378_137, 0.00669437999014);
65
+ * // [6 378 237, 0, 0]
66
+ * ```
67
+ *
68
+ * @see {@link bodyFixedToGeodetic}
69
+ * @see {@link eccentricitySquaredOblateSpheroid}
70
+ * @see https://en.wikipedia.org/wiki/Geographic_coordinate_conversion Geographic coordinate conversion
71
+ */
72
+ export declare const geodeticToBodyFixed: (phi: Radians, lambda: Radians, h: number, a: number, eSquared: number) => Vector3DTupleType;
73
+ //# sourceMappingURL=geodetic-to-body-fixed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geodetic-to-body-fixed.d.ts","sourceRoot":"","sources":["../../../src/categories/cartography/geodetic-to-body-fixed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,KAAK,OAAO,EACZ,QAAQ,OAAO,EACf,GAAG,MAAM,EACT,GAAG,MAAM,EACT,UAAU,MAAM,KACf,iBA6BF,CAAC"}
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Convert **geodetic coordinates** (latitude, longitude, height) to a **body-fixed Cartesian** position, ECEF for Earth.
3
+ *
4
+ * $$
5
+ * \begin{aligned}
6
+ * x &= (N + h)\cos\varphi\cos\lambda \\
7
+ * y &= (N + h)\cos\varphi\sin\lambda \\
8
+ * z &= \big(N(1 - e^2) + h\big)\sin\varphi
9
+ * \end{aligned}
10
+ * \qquad
11
+ * N = \frac{a}{\sqrt{1 - e^2\sin^2\varphi}}
12
+ * $$
13
+ *
14
+ * Where:
15
+ * - $ \varphi $ is the geodetic latitude and $ \lambda $ the longitude (rad)
16
+ * - $ h $ is the height above the ellipsoid, along its normal (m)
17
+ * - $ a $ is the equatorial radius (m) and $ e^2 $ the first eccentricity squared
18
+ * - $ N $ is the prime vertical radius of curvature (m)
19
+ *
20
+ * **Units**
21
+ * - Inputs: `phi` and `lambda` in **radians**, `h` and `a` in **m**, `eSquared` dimensionless.
22
+ * - Output: `[x, y, z]` in **m**, with $ z $ along the rotation axis and $ x $ through the prime meridian.
23
+ *
24
+ * ::: info Notes
25
+ *
26
+ * - Geodetic latitude is the angle of the ellipsoid's normal, the latitude on maps. The geocentric latitude, the angle seen from the centre, is `atan2(z, hypot(x, y))` of the result, and is smaller everywhere but the equator and the poles.
27
+ * - WGS84: $ a = 6\,378\,137 $ m, $ e^2 = 0.00669437999014 $. Get $ e^2 $ from the radii with {@link eccentricitySquaredOblateSpheroid}.
28
+ * - {@link bodyFixedToGeodetic} goes the other way.
29
+ *
30
+ * :::
31
+ *
32
+ * ::: practice Apollo 11, on Pad 39A
33
+ *
34
+ * **6 373.3 km**
35
+ *
36
+ * _From Earth's centre, at 28.608° N geodetic, 80.604° W on the WGS84 ellipsoid_
37
+ *
38
+ * The geocentric latitude is 28.447°, 0.161° less than on the map. That's the latitude the launch-site formulas such as `surfaceRotationSpeed` need.
39
+ *
40
+ * ```ts
41
+ * const [x, y, z] = geodeticToBodyFixed(toRad(28.608422), toRad(-80.604133), 0, 6_378_137, 0.00669437999014);
42
+ * Math.hypot(x, y, z); // ≈ 6 373 266 m
43
+ * toDeg(Math.atan2(z, Math.hypot(x, y))); // ≈ 28.447°
44
+ * ```
45
+ *
46
+ * :::
47
+ *
48
+ * @param phi - Geodetic latitude $ \varphi $ in **radians** (finite, in [-π/2, π/2]).
49
+ * @param lambda - Longitude $ \lambda $ in **radians**, east positive (finite).
50
+ * @param h - Height $ h $ above the ellipsoid in **m** (finite; negative below it).
51
+ * @param a - Equatorial radius $ a $ in **m** (finite, > 0).
52
+ * @param eSquared - First eccentricity squared $ e^2 $ (finite, in [0, 1)).
53
+ * @returns Body-fixed position `[x, y, z]` in **m**.
54
+ * @throws {TypeError} If any input is not a finite number.
55
+ * @throws {RangeError} If `phi` is outside [-π/2, π/2], `a <= 0`, or `eSquared` is outside [0, 1).
56
+ * @group Cartography
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * import type { Radians } from '@interstellar-tools/types';
61
+ *
62
+ * // On the equator at the prime meridian, 100 m up
63
+ * geodeticToBodyFixed(0 as Radians, 0 as Radians, 100, 6_378_137, 0.00669437999014);
64
+ * // [6 378 237, 0, 0]
65
+ * ```
66
+ *
67
+ * @see {@link bodyFixedToGeodetic}
68
+ * @see {@link eccentricitySquaredOblateSpheroid}
69
+ * @see https://en.wikipedia.org/wiki/Geographic_coordinate_conversion Geographic coordinate conversion
70
+ */
71
+ export const geodeticToBodyFixed = (phi, lambda, h, a, eSquared) => {
72
+ for (const [name, x] of [
73
+ ['phi', phi],
74
+ ['lambda', lambda],
75
+ ['h', h],
76
+ ['a', a],
77
+ ['eSquared', eSquared]
78
+ ]) {
79
+ if (!Number.isFinite(x))
80
+ throw new TypeError(`${name} must be a finite number. Received: ${x}`);
81
+ }
82
+ if (Math.abs(phi) > Math.PI / 2)
83
+ throw new RangeError(`phi must be in [-π/2, π/2]. Received: ${phi}`);
84
+ if (a <= 0)
85
+ throw new RangeError(`a must be > 0. Received: ${a}`);
86
+ if (eSquared < 0 || eSquared >= 1)
87
+ throw new RangeError(`eSquared must be in [0, 1). Received: ${eSquared}`);
88
+ const sinPhi = Math.sin(phi);
89
+ const cosPhi = Math.cos(phi);
90
+ const N = a / Math.sqrt(1 - eSquared * sinPhi * sinPhi);
91
+ return [
92
+ (N + h) * cosPhi * Math.cos(lambda),
93
+ (N + h) * cosPhi * Math.sin(lambda),
94
+ (N * (1 - eSquared) + h) * sinPhi
95
+ ];
96
+ };
97
+ //# sourceMappingURL=geodetic-to-body-fixed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geodetic-to-body-fixed.js","sourceRoot":"","sources":["../../../src/categories/cartography/geodetic-to-body-fixed.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,GAAY,EACZ,MAAe,EACf,CAAS,EACT,CAAS,EACT,QAAgB,EACG,EAAE;IACrB,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI;QACtB,CAAC,KAAK,EAAE,GAAG,CAAC;QACZ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAClB,CAAC,GAAG,EAAE,CAAC,CAAC;QACR,CAAC,GAAG,EAAE,CAAC,CAAC;QACR,CAAC,UAAU,EAAE,QAAQ,CAAC;KACd,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,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC;QAC7B,MAAM,IAAI,UAAU,CAAC,yCAAyC,GAAG,EAAE,CAAC,CAAC;IAEvE,IAAI,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,4BAA4B,CAAC,EAAE,CAAC,CAAC;IAElE,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI,CAAC;QAC/B,MAAM,IAAI,UAAU,CAAC,yCAAyC,QAAQ,EAAE,CAAC,CAAC;IAE5E,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;IAExD,OAAO;QACL,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;QACnC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;QACnC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;KAClC,CAAC;AACJ,CAAC,CAAC"}
@@ -17,7 +17,7 @@ import type { Radians } from '@interstellar-tools/types';
17
17
  *
18
18
  * ::: info Notes
19
19
  *
20
- * - `lat` is the **geocentric** latitude. Published latitudes are usually geodetic, which on Earth differ by up to 0.19°, and the inclination by about as much. Convert first (see [#186](https://github.com/phun-ky/interstellar-tools/issues/186)).
20
+ * - `lat` is the **geocentric** latitude. Published latitudes are usually geodetic, which on Earth differ by up to 0.19°, and the inclination by about as much. Convert first with {@link geodeticToBodyFixed}, at the point's height.
21
21
  * - The relation holds at every point of the ground track, not only at launch: an orbit never reaches a latitude higher than its inclination.
22
22
  * - Launching due east ($ \beta = 90° $) gives the lowest inclination a site can reach without a plane change: its own latitude.
23
23
  * - Azimuths between 180° and 360° head west, into retrograde orbits ($ i > 90° $).
@@ -27,14 +27,16 @@ import type { Radians } from '@interstellar-tools/types';
27
27
  *
28
28
  * ::: practice Apollo 11, entering Earth orbit
29
29
  *
30
- * **32.52°**
30
+ * **32.521°**
31
31
  *
32
- * _At orbit insertion: 32.497° N geocentric, heading 88.848°_
32
+ * _At orbit insertion: 32.502° N geocentric (32.672° geodetic, 191.1 km up), heading 88.848°_
33
33
  *
34
34
  * The flown parking orbit was inclined 32.521°. Apollo 11 entered orbit near the northernmost point of its track, heading almost due east. With the published geodetic latitude, 32.672°, the result would be 32.69°.
35
35
  *
36
36
  * ```ts
37
- * inclinationFromLaunchAzimuth(toRad(32.497), toRad(88.848)); // ≈ 32.52°
37
+ * const [x, y, z] = geodeticToBodyFixed(toRad(32.672), toRad(-52.694), 191_100, 6_378_137, 0.00669437999014);
38
+ * const lat = Math.atan2(z, Math.hypot(x, y)); // 32.502°
39
+ * inclinationFromLaunchAzimuth(lat, toRad(88.848)); // ≈ 32.521°
38
40
  * ```
39
41
  *
40
42
  * :::
@@ -1 +1 @@
1
- {"version":3,"file":"inclination-from-launch-azimuth.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/inclination-from-launch-azimuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,eAAO,MAAM,4BAA4B,GACvC,KAAK,OAAO,EACZ,SAAS,OAAO,KACf,OAgBF,CAAC"}
1
+ {"version":3,"file":"inclination-from-launch-azimuth.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/inclination-from-launch-azimuth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,eAAO,MAAM,4BAA4B,GACvC,KAAK,OAAO,EACZ,SAAS,OAAO,KACf,OAgBF,CAAC"}
@@ -16,7 +16,7 @@
16
16
  *
17
17
  * ::: info Notes
18
18
  *
19
- * - `lat` is the **geocentric** latitude. Published latitudes are usually geodetic, which on Earth differ by up to 0.19°, and the inclination by about as much. Convert first (see [#186](https://github.com/phun-ky/interstellar-tools/issues/186)).
19
+ * - `lat` is the **geocentric** latitude. Published latitudes are usually geodetic, which on Earth differ by up to 0.19°, and the inclination by about as much. Convert first with {@link geodeticToBodyFixed}, at the point's height.
20
20
  * - The relation holds at every point of the ground track, not only at launch: an orbit never reaches a latitude higher than its inclination.
21
21
  * - Launching due east ($ \beta = 90° $) gives the lowest inclination a site can reach without a plane change: its own latitude.
22
22
  * - Azimuths between 180° and 360° head west, into retrograde orbits ($ i > 90° $).
@@ -26,14 +26,16 @@
26
26
  *
27
27
  * ::: practice Apollo 11, entering Earth orbit
28
28
  *
29
- * **32.52°**
29
+ * **32.521°**
30
30
  *
31
- * _At orbit insertion: 32.497° N geocentric, heading 88.848°_
31
+ * _At orbit insertion: 32.502° N geocentric (32.672° geodetic, 191.1 km up), heading 88.848°_
32
32
  *
33
33
  * The flown parking orbit was inclined 32.521°. Apollo 11 entered orbit near the northernmost point of its track, heading almost due east. With the published geodetic latitude, 32.672°, the result would be 32.69°.
34
34
  *
35
35
  * ```ts
36
- * inclinationFromLaunchAzimuth(toRad(32.497), toRad(88.848)); // ≈ 32.52°
36
+ * const [x, y, z] = geodeticToBodyFixed(toRad(32.672), toRad(-52.694), 191_100, 6_378_137, 0.00669437999014);
37
+ * const lat = Math.atan2(z, Math.hypot(x, y)); // 32.502°
38
+ * inclinationFromLaunchAzimuth(lat, toRad(88.848)); // ≈ 32.521°
37
39
  * ```
38
40
  *
39
41
  * :::
@@ -1 +1 @@
1
- {"version":3,"file":"inclination-from-launch-azimuth.js","sourceRoot":"","sources":["../../../src/categories/orbits/inclination-from-launch-azimuth.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,GAAY,EACZ,OAAgB,EACP,EAAE;IACX,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI;QACtB,CAAC,KAAK,EAAE,GAAG,CAAC;QACZ,CAAC,SAAS,EAAE,OAAO,CAAC;KACZ,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,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC;QAC7B,MAAM,IAAI,UAAU,CAAC,yCAAyC,GAAG,EAAE,CAAC,CAAC;IAEvE,8CAA8C;IAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE1E,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAY,CAAC;AACpC,CAAC,CAAC"}
1
+ {"version":3,"file":"inclination-from-launch-azimuth.js","sourceRoot":"","sources":["../../../src/categories/orbits/inclination-from-launch-azimuth.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,GAAY,EACZ,OAAgB,EACP,EAAE;IACX,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI;QACtB,CAAC,KAAK,EAAE,GAAG,CAAC;QACZ,CAAC,SAAS,EAAE,OAAO,CAAC;KACZ,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,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,CAAC;QAC7B,MAAM,IAAI,UAAU,CAAC,yCAAyC,GAAG,EAAE,CAAC,CAAC;IAEvE,8CAA8C;IAC9C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAE1E,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAY,CAAC;AACpC,CAAC,CAAC"}
@@ -20,7 +20,7 @@ import type { Radians } from '@interstellar-tools/types';
20
20
  * - A rocket launched eastward gets this speed for free; one launched westward has to cancel it first.
21
21
  * - Earth's sidereal rotation rate is about 7.2921150 × 10⁻⁵ rad/s.
22
22
  * - A body that rotates backwards (Venus, Uranus) has a negative `omega`, and the result is negative: westward.
23
- * - $ R\cos\varphi $ is the distance from the rotation axis. On an oblate body, pass the geocentric latitude and the point's distance from the body's centre, not the equatorial radius with a geodetic latitude (see [#186](https://github.com/phun-ky/interstellar-tools/issues/186)).
23
+ * - $ R\cos\varphi $ is the distance from the rotation axis. On an oblate body, pass the geocentric latitude and the point's distance from the body's centre, not the equatorial radius with a geodetic latitude; {@link geodeticToBodyFixed} gives both.
24
24
  *
25
25
  * :::
26
26
  *
@@ -19,7 +19,7 @@
19
19
  * - A rocket launched eastward gets this speed for free; one launched westward has to cancel it first.
20
20
  * - Earth's sidereal rotation rate is about 7.2921150 × 10⁻⁵ rad/s.
21
21
  * - A body that rotates backwards (Venus, Uranus) has a negative `omega`, and the result is negative: westward.
22
- * - $ R\cos\varphi $ is the distance from the rotation axis. On an oblate body, pass the geocentric latitude and the point's distance from the body's centre, not the equatorial radius with a geodetic latitude (see [#186](https://github.com/phun-ky/interstellar-tools/issues/186)).
22
+ * - $ R\cos\varphi $ is the distance from the rotation axis. On an oblate body, pass the geocentric latitude and the point's distance from the body's centre, not the equatorial radius with a geodetic latitude; {@link geodeticToBodyFixed} gives both.
23
23
  *
24
24
  * :::
25
25
  *
package/dist/index.d.ts CHANGED
@@ -6,8 +6,10 @@
6
6
  export * from './categories/angle/compute-angle.js';
7
7
  export * from './categories/angle/wrap-angle.js';
8
8
  export * from './categories/cartography/body-fixed-from-inertial-dcm-iau.js';
9
+ export * from './categories/cartography/body-fixed-to-geodetic.js';
9
10
  export * from './categories/cartography/eccentricity-squared-oblate-spheroid.js';
10
11
  export * from './categories/cartography/flattening-oblate-spheroid.js';
12
+ export * from './categories/cartography/geodetic-to-body-fixed.js';
11
13
  export * from './categories/cartography/is-on-triaxial-ellipsoid-surface.js';
12
14
  export * from './categories/cartography/planetocentric-latitude.js';
13
15
  export * from './categories/cartography/planetographic-latitude-oblate.js';
@@ -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,6CAA6C,CAAC;AAE5D,cAAc,6CAA6C,CAAC;AAE5D,cAAc,4DAA4D,CAAC;AAE3E,cAAc,mDAAmD,CAAC;AAElE,cAAc,4CAA4C,CAAC;AAE3D,cAAc,yCAAyC,CAAC;AAIxD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,+CAA+C,CAAC;AAE9D,cAA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AC;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,cAAc,uCAAuC,CAAC;AAItD,cAAc,sCAAsC,CAAC;AAErD,cAAc,kDAAkD,CAAC;AAEjE,cAAc,oDAAoD,CAAC;AAEnE,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,8CAA8C,CAAC;AAE7D,cAAc,iDAAiD,CAAC;AAEhE,cAAc,oDAAoD,CAAC;AAEnE,cAAc,mDAAmD,CAAC;AAElE,cAAc,0CAA0C,CAAC;AAEzD,cAAc,6CAA6C,CAAC"}
package/dist/index.js CHANGED
@@ -8,8 +8,10 @@ export * from './categories/angle/compute-angle.js';
8
8
  export * from './categories/angle/wrap-angle.js';
9
9
  // categories/cartography
10
10
  export * from './categories/cartography/body-fixed-from-inertial-dcm-iau.js';
11
+ export * from './categories/cartography/body-fixed-to-geodetic.js';
11
12
  export * from './categories/cartography/eccentricity-squared-oblate-spheroid.js';
12
13
  export * from './categories/cartography/flattening-oblate-spheroid.js';
14
+ export * from './categories/cartography/geodetic-to-body-fixed.js';
13
15
  export * from './categories/cartography/is-on-triaxial-ellipsoid-surface.js';
14
16
  export * from './categories/cartography/planetocentric-latitude.js';
15
17
  export * from './categories/cartography/planetographic-latitude-oblate.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;AAEz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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interstellar-tools/equations",
3
- "version": "1.4.0",
3
+ "version": "1.5.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",