@interstellar-tools/equations 0.2.0 → 0.3.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.
Files changed (189) hide show
  1. package/dist/__tests__/circular-speed.spec.d.ts +2 -0
  2. package/dist/__tests__/circular-speed.spec.d.ts.map +1 -0
  3. package/dist/__tests__/circular-speed.spec.js +69 -0
  4. package/dist/__tests__/circular-speed.spec.js.map +1 -0
  5. package/dist/__tests__/compute-angle.int.spec.js +2 -2
  6. package/dist/__tests__/compute-angle.int.spec.js.map +1 -1
  7. package/dist/__tests__/eccentric-to-true-anomaly.spec.js +1 -1
  8. package/dist/__tests__/eccentric-to-true-anomaly.spec.js.map +1 -1
  9. package/dist/__tests__/escape-speed.spec.d.ts +2 -0
  10. package/dist/__tests__/escape-speed.spec.d.ts.map +1 -0
  11. package/dist/__tests__/escape-speed.spec.js +79 -0
  12. package/dist/__tests__/escape-speed.spec.js.map +1 -0
  13. package/dist/__tests__/gravitational-acceleration-on1-by2.int.spec.js +16 -16
  14. package/dist/__tests__/gravitational-acceleration-on1-by2.int.spec.js.map +1 -1
  15. package/dist/__tests__/gravitational-force-on1-by2.int.spec.js +20 -20
  16. package/dist/__tests__/gravitational-force-on1-by2.int.spec.js.map +1 -1
  17. package/dist/__tests__/gravitational-force.spec.js +1 -1
  18. package/dist/__tests__/gravitational-force.spec.js.map +1 -1
  19. package/dist/__tests__/gravitational-parameters.spec.js +1 -1
  20. package/dist/__tests__/gravitational-parameters.spec.js.map +1 -1
  21. package/dist/__tests__/helpers/index.d.ts +2 -1
  22. package/dist/__tests__/helpers/index.d.ts.map +1 -1
  23. package/dist/__tests__/helpers/index.js +6 -0
  24. package/dist/__tests__/helpers/index.js.map +1 -1
  25. package/dist/__tests__/kepler-period.spec.js +1 -1
  26. package/dist/__tests__/kepler-period.spec.js.map +1 -1
  27. package/dist/__tests__/mean-to-eccentric-anomaly.spec.d.ts +2 -0
  28. package/dist/__tests__/mean-to-eccentric-anomaly.spec.d.ts.map +1 -0
  29. package/dist/__tests__/{compute-mean-anomaly.int.spec.js → mean-to-eccentric-anomaly.spec.js} +49 -27
  30. package/dist/__tests__/mean-to-eccentric-anomaly.spec.js.map +1 -0
  31. package/dist/__tests__/peri-apoapsis-radii.spec.d.ts +2 -0
  32. package/dist/__tests__/peri-apoapsis-radii.spec.d.ts.map +1 -0
  33. package/dist/__tests__/peri-apoapsis-radii.spec.js +74 -0
  34. package/dist/__tests__/peri-apoapsis-radii.spec.js.map +1 -0
  35. package/dist/__tests__/solve-kepler-bisection.spec.js +1 -1
  36. package/dist/__tests__/solve-kepler-bisection.spec.js.map +1 -1
  37. package/dist/__tests__/solve-kepler-high-eccentricity.spec.js +1 -1
  38. package/dist/__tests__/solve-kepler-high-eccentricity.spec.js.map +1 -1
  39. package/dist/__tests__/solve-kepler-newton-raphson.spec.js +1 -1
  40. package/dist/__tests__/solve-kepler-newton-raphson.spec.js.map +1 -1
  41. package/dist/__tests__/solve-kepler.int.spec.js +1 -1
  42. package/dist/__tests__/solve-kepler.int.spec.js.map +1 -1
  43. package/dist/__tests__/specific-angular-momentum-from-elements.spec.d.ts +2 -0
  44. package/dist/__tests__/specific-angular-momentum-from-elements.spec.d.ts.map +1 -0
  45. package/dist/__tests__/specific-angular-momentum-from-elements.spec.js +86 -0
  46. package/dist/__tests__/specific-angular-momentum-from-elements.spec.js.map +1 -0
  47. package/dist/__tests__/specific-angular-momentum.spec.d.ts +2 -0
  48. package/dist/__tests__/specific-angular-momentum.spec.d.ts.map +1 -0
  49. package/dist/__tests__/specific-angular-momentum.spec.js +84 -0
  50. package/dist/__tests__/specific-angular-momentum.spec.js.map +1 -0
  51. package/dist/__tests__/specific-mechanical-energy.spec.js +1 -1
  52. package/dist/__tests__/specific-mechanical-energy.spec.js.map +1 -1
  53. package/dist/__tests__/true-to-mean-anomaly.spec.d.ts +2 -0
  54. package/dist/__tests__/true-to-mean-anomaly.spec.d.ts.map +1 -0
  55. package/dist/__tests__/{true-anomaly-to-mean-anomaly.int.spec.js → true-to-mean-anomaly.spec.js} +13 -13
  56. package/dist/__tests__/true-to-mean-anomaly.spec.js.map +1 -0
  57. package/dist/__tests__/vis-viva-speed.spec.js +1 -1
  58. package/dist/__tests__/vis-viva-speed.spec.js.map +1 -1
  59. package/dist/__tests__/wrap-angle.spec.js +1 -1
  60. package/dist/__tests__/wrap-angle.spec.js.map +1 -1
  61. package/dist/{compute-angle.d.ts → categories/angle/compute-angle.d.ts} +1 -1
  62. package/dist/categories/angle/compute-angle.d.ts.map +1 -0
  63. package/dist/{compute-angle.js → categories/angle/compute-angle.js} +5 -5
  64. package/dist/categories/angle/compute-angle.js.map +1 -0
  65. package/dist/{wrap-angle.d.ts → categories/angle/wrap-angle.d.ts} +1 -1
  66. package/dist/categories/angle/wrap-angle.d.ts.map +1 -0
  67. package/dist/{wrap-angle.js → categories/angle/wrap-angle.js} +1 -1
  68. package/dist/categories/angle/wrap-angle.js.map +1 -0
  69. package/dist/{eccentric-to-true-anomaly.d.ts → categories/anomalies/eccentric-to-true-anomaly.d.ts} +1 -1
  70. package/dist/categories/anomalies/eccentric-to-true-anomaly.d.ts.map +1 -0
  71. package/dist/{eccentric-to-true-anomaly.js → categories/anomalies/eccentric-to-true-anomaly.js} +1 -1
  72. package/dist/categories/anomalies/eccentric-to-true-anomaly.js.map +1 -0
  73. package/dist/{compute-mean-anomaly.d.ts → categories/anomalies/mean-to-eccentric-anomaly.d.ts} +5 -5
  74. package/dist/categories/anomalies/mean-to-eccentric-anomaly.d.ts.map +1 -0
  75. package/dist/{compute-mean-anomaly.js → categories/anomalies/mean-to-eccentric-anomaly.js} +11 -20
  76. package/dist/categories/anomalies/mean-to-eccentric-anomaly.js.map +1 -0
  77. package/dist/{true-anomaly-to-mean-anomaly.d.ts → categories/anomalies/true-to-mean-anomaly.d.ts} +6 -6
  78. package/dist/categories/anomalies/true-to-mean-anomaly.d.ts.map +1 -0
  79. package/dist/{true-anomaly-to-mean-anomaly.js → categories/anomalies/true-to-mean-anomaly.js} +7 -7
  80. package/dist/categories/anomalies/true-to-mean-anomaly.js.map +1 -0
  81. package/dist/categories/anomalies/utils/are-equal.d.ts +10 -0
  82. package/dist/categories/anomalies/utils/are-equal.d.ts.map +1 -0
  83. package/dist/categories/anomalies/utils/are-equal.js +13 -0
  84. package/dist/categories/anomalies/utils/are-equal.js.map +1 -0
  85. package/dist/categories/gravity/acceleration-on1-by2.d.ts +66 -0
  86. package/dist/categories/gravity/acceleration-on1-by2.d.ts.map +1 -0
  87. package/dist/categories/gravity/acceleration-on1-by2.js +75 -0
  88. package/dist/categories/gravity/acceleration-on1-by2.js.map +1 -0
  89. package/dist/categories/gravity/force-on1-by2.d.ts +87 -0
  90. package/dist/categories/gravity/force-on1-by2.d.ts.map +1 -0
  91. package/dist/categories/gravity/force-on1-by2.js +96 -0
  92. package/dist/categories/gravity/force-on1-by2.js.map +1 -0
  93. package/dist/categories/gravity/gravitational-force.d.ts +94 -0
  94. package/dist/categories/gravity/gravitational-force.d.ts.map +1 -0
  95. package/dist/categories/gravity/gravitational-force.js +119 -0
  96. package/dist/categories/gravity/gravitational-force.js.map +1 -0
  97. package/dist/{gravitational-parameter.d.ts → categories/gravity/gravitational-parameter.d.ts} +1 -1
  98. package/dist/categories/gravity/gravitational-parameter.d.ts.map +1 -0
  99. package/dist/{gravitational-parameter.js → categories/gravity/gravitational-parameter.js} +1 -1
  100. package/dist/categories/gravity/gravitational-parameter.js.map +1 -0
  101. package/dist/{solve-kepler-bisection.d.ts → categories/kepler/solve-kepler-bisection.d.ts} +1 -1
  102. package/dist/categories/kepler/solve-kepler-bisection.d.ts.map +1 -0
  103. package/dist/{solve-kepler-bisection.js → categories/kepler/solve-kepler-bisection.js} +1 -1
  104. package/dist/categories/kepler/solve-kepler-bisection.js.map +1 -0
  105. package/dist/{solve-kepler-high-eccentricity.d.ts → categories/kepler/solve-kepler-high-eccentricity.d.ts} +2 -8
  106. package/dist/categories/kepler/solve-kepler-high-eccentricity.d.ts.map +1 -0
  107. package/dist/{solve-kepler-high-eccentricity.js → categories/kepler/solve-kepler-high-eccentricity.js} +5 -9
  108. package/dist/categories/kepler/solve-kepler-high-eccentricity.js.map +1 -0
  109. package/dist/{solve-kepler-newton-raphson.d.ts → categories/kepler/solve-kepler-newton-raphson.d.ts} +1 -1
  110. package/dist/categories/kepler/solve-kepler-newton-raphson.d.ts.map +1 -0
  111. package/dist/{solve-kepler-newton-raphson.js → categories/kepler/solve-kepler-newton-raphson.js} +1 -1
  112. package/dist/categories/kepler/solve-kepler-newton-raphson.js.map +1 -0
  113. package/dist/{solve-kepler.d.ts → categories/kepler/solve-kepler.d.ts} +1 -1
  114. package/dist/categories/kepler/solve-kepler.d.ts.map +1 -0
  115. package/dist/{solve-kepler.js → categories/kepler/solve-kepler.js} +2 -2
  116. package/dist/categories/kepler/solve-kepler.js.map +1 -0
  117. package/dist/categories/orbits/circular-speed.d.ts +42 -0
  118. package/dist/categories/orbits/circular-speed.d.ts.map +1 -0
  119. package/dist/categories/orbits/circular-speed.js +50 -0
  120. package/dist/categories/orbits/circular-speed.js.map +1 -0
  121. package/dist/categories/orbits/escape-speed.d.ts +50 -0
  122. package/dist/categories/orbits/escape-speed.d.ts.map +1 -0
  123. package/dist/categories/orbits/escape-speed.js +58 -0
  124. package/dist/categories/orbits/escape-speed.js.map +1 -0
  125. package/dist/{kepler-period.d.ts → categories/orbits/kepler-period.d.ts} +1 -1
  126. package/dist/categories/orbits/kepler-period.d.ts.map +1 -0
  127. package/dist/{kepler-period.js → categories/orbits/kepler-period.js} +1 -1
  128. package/dist/categories/orbits/kepler-period.js.map +1 -0
  129. package/dist/categories/orbits/peri-apoapsis-radii.d.ts +46 -0
  130. package/dist/categories/orbits/peri-apoapsis-radii.d.ts.map +1 -0
  131. package/dist/categories/orbits/peri-apoapsis-radii.js +85 -0
  132. package/dist/categories/orbits/peri-apoapsis-radii.js.map +1 -0
  133. package/dist/categories/orbits/specific-angular-momentum-from-elements.d.ts +60 -0
  134. package/dist/categories/orbits/specific-angular-momentum-from-elements.d.ts.map +1 -0
  135. package/dist/categories/orbits/specific-angular-momentum-from-elements.js +76 -0
  136. package/dist/categories/orbits/specific-angular-momentum-from-elements.js.map +1 -0
  137. package/dist/categories/orbits/specific-angular-momentum.d.ts +55 -0
  138. package/dist/categories/orbits/specific-angular-momentum.d.ts.map +1 -0
  139. package/dist/categories/orbits/specific-angular-momentum.js +76 -0
  140. package/dist/categories/orbits/specific-angular-momentum.js.map +1 -0
  141. package/dist/{specific-mechanical-energy.d.ts → categories/orbits/specific-mechanical-energy.d.ts} +1 -1
  142. package/dist/categories/orbits/specific-mechanical-energy.d.ts.map +1 -0
  143. package/dist/{specific-mechanical-energy.js → categories/orbits/specific-mechanical-energy.js} +1 -1
  144. package/dist/categories/orbits/specific-mechanical-energy.js.map +1 -0
  145. package/dist/{vis-viva-speed.d.ts → categories/orbits/vis-viva-speed.d.ts} +1 -1
  146. package/dist/categories/orbits/vis-viva-speed.d.ts.map +1 -0
  147. package/dist/{vis-viva-speed.js → categories/orbits/vis-viva-speed.js} +1 -1
  148. package/dist/categories/orbits/vis-viva-speed.js.map +1 -0
  149. package/dist/index.d.ts +20 -15
  150. package/dist/index.d.ts.map +1 -1
  151. package/dist/index.js +25 -15
  152. package/dist/index.js.map +1 -1
  153. package/package.json +2 -2
  154. package/dist/__tests__/compute-mean-anomaly.int.spec.d.ts +0 -2
  155. package/dist/__tests__/compute-mean-anomaly.int.spec.d.ts.map +0 -1
  156. package/dist/__tests__/compute-mean-anomaly.int.spec.js.map +0 -1
  157. package/dist/__tests__/true-anomaly-to-mean-anomaly.int.spec.d.ts +0 -2
  158. package/dist/__tests__/true-anomaly-to-mean-anomaly.int.spec.d.ts.map +0 -1
  159. package/dist/__tests__/true-anomaly-to-mean-anomaly.int.spec.js.map +0 -1
  160. package/dist/compute-angle.d.ts.map +0 -1
  161. package/dist/compute-angle.js.map +0 -1
  162. package/dist/compute-mean-anomaly.d.ts.map +0 -1
  163. package/dist/compute-mean-anomaly.js.map +0 -1
  164. package/dist/eccentric-to-true-anomaly.d.ts.map +0 -1
  165. package/dist/eccentric-to-true-anomaly.js.map +0 -1
  166. package/dist/gravitational-parameter.d.ts.map +0 -1
  167. package/dist/gravitational-parameter.js.map +0 -1
  168. package/dist/kepler-period.d.ts.map +0 -1
  169. package/dist/kepler-period.js.map +0 -1
  170. package/dist/law-of-gravitation.d.ts +0 -243
  171. package/dist/law-of-gravitation.d.ts.map +0 -1
  172. package/dist/law-of-gravitation.js +0 -284
  173. package/dist/law-of-gravitation.js.map +0 -1
  174. package/dist/solve-kepler-bisection.d.ts.map +0 -1
  175. package/dist/solve-kepler-bisection.js.map +0 -1
  176. package/dist/solve-kepler-high-eccentricity.d.ts.map +0 -1
  177. package/dist/solve-kepler-high-eccentricity.js.map +0 -1
  178. package/dist/solve-kepler-newton-raphson.d.ts.map +0 -1
  179. package/dist/solve-kepler-newton-raphson.js.map +0 -1
  180. package/dist/solve-kepler.d.ts.map +0 -1
  181. package/dist/solve-kepler.js.map +0 -1
  182. package/dist/specific-mechanical-energy.d.ts.map +0 -1
  183. package/dist/specific-mechanical-energy.js.map +0 -1
  184. package/dist/true-anomaly-to-mean-anomaly.d.ts.map +0 -1
  185. package/dist/true-anomaly-to-mean-anomaly.js.map +0 -1
  186. package/dist/vis-viva-speed.d.ts.map +0 -1
  187. package/dist/vis-viva-speed.js.map +0 -1
  188. package/dist/wrap-angle.d.ts.map +0 -1
  189. package/dist/wrap-angle.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solve-kepler-high-eccentricity.d.ts","sourceRoot":"","sources":["../../../src/categories/kepler/solve-kepler-high-eccentricity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAKpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AAEH,eAAO,MAAM,2BAA2B,GACtC,GAAG,OAAO,EACV,GAAG,MAAM,EACT,gBAAsE,EACtE,kBAAgB,KACf,OAgEF,CAAC"}
@@ -1,10 +1,9 @@
1
- import { wrapAngle } from './wrap-angle';
1
+ import { wrapAngle } from '../angle/wrap-angle';
2
+ /* node:coverage disable */
2
3
  /**
3
4
  * Solves **Kepler's Equation** for the **Eccentric Anomaly** ($E$) in highly eccentric orbits
4
5
  * ($e > 0.9$) using an iterative numerical approach.
5
6
  *
6
- * ---
7
- *
8
7
  * **Mathematical Explanation:**
9
8
  *
10
9
  * Kepler's equation for eccentric anomaly ($E$) is:
@@ -55,13 +54,11 @@ import { wrapAngle } from './wrap-angle';
55
54
  * 3. **Angle Wrapping (Elliptical Only):**
56
55
  * - The result is wrapped using `wrapAngle()` for consistency.
57
56
  *
58
- * ---
59
57
  *
60
58
  * **Performance Considerations:**
61
59
  * - **Typically converges in fewer than 10 iterations for $e > 0.9$.**
62
60
  * - **Time complexity:** $O(1)$ for standard convergence.
63
61
  *
64
- * ---
65
62
  *
66
63
  * @param {Radians} M - Mean anomaly ($M$) in **radians**.
67
64
  * @param {number} e - Orbital eccentricity ($e > 0.9$ for high-eccentricity orbits).
@@ -69,7 +66,6 @@ import { wrapAngle } from './wrap-angle';
69
66
  * @param {number} [tolerance=1e-9] - Convergence criterion for stopping the iteration.
70
67
  * @returns {Radians} The **eccentric anomaly** ($E$) in **radians** (wrapped to $[-\pi, \pi]$ for elliptical orbits).
71
68
  *
72
- * ---
73
69
  *
74
70
  * @example
75
71
  * ```ts
@@ -89,12 +85,12 @@ import { wrapAngle } from './wrap-angle';
89
85
  * console.log(solveKeplerHighEccentricity(M_hyperbolic, e_hyperbolic));
90
86
  * ```
91
87
  *
92
- * ---
93
- *
94
88
  * @see [Kepler's Equation (Wikipedia)](https://en.wikipedia.org/wiki/Kepler%27s_equation)
95
89
  * @see [Hyperbolic Anomaly (Wikipedia)](https://en.wikipedia.org/wiki/Hyperbolic_trajectory#Hyperbolic_anomaly)
96
- * @category Solve for Kepler
90
+ * @group Kepler Solvers
91
+ *
97
92
  */
93
+ /* node:coverage enable */
98
94
  export const solveKeplerHighEccentricity = (M, e, maxIter = Math.max(300, Math.floor(5 + 3 * Math.log(1 + Math.abs(M)))), tolerance = 1e-9) => {
99
95
  if (e < 0) {
100
96
  throw new RangeError(`Invalid eccentricity: ${e}. Must be e ≥ 0.`);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solve-kepler-high-eccentricity.js","sourceRoot":"","sources":["../../../src/categories/kepler/solve-kepler-high-eccentricity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,2BAA2B;AAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,0BAA0B;AAC1B,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,CAAU,EACV,CAAS,EACT,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EACtE,SAAS,GAAG,IAAI,EACP,EAAE;IACX,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACV,MAAM,IAAI,UAAU,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,CAAS,CAAC;IAEd,gEAAgE;IAChE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACV,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,C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zC,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;QAE1D,CAAC,IAAI,KAAK,CAAC;QACX,IAAI,EAAE,CAAC;QAEP,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7B,UAAU,GAAG,CAAC,CAAC;QACjB,CAAC;QAED,iDAAiD;QACjD,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC;YACtB,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM;QACR,CAAC;IACH,CAAC;IAED,6DAA6D;IAC7D,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACV,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC,CAAC"}
@@ -81,7 +81,7 @@ import { Radians } from '@interstellar-tools/types';
81
81
  * @see [Kepler's Equation (Wikipedia)](https://en.wikipedia.org/wiki/Kepler%27s_equation)
82
82
  * @see [Newton-Raphson Method (Wikipedia)](https://en.wikipedia.org/wiki/Newton%27s_method)
83
83
  * @see [Eccentric Anomaly (Wikipedia)](https://en.wikipedia.org/wiki/Mean_anomaly#Eccentric_anomaly)
84
- * @category Solve for Kepler
84
+ * @group Kepler Solvers
85
85
  */
86
86
  export declare const solveKeplerNewtonRaphson: (M: Radians, e: number, maxIter: number, tolerance: number) => Radians;
87
87
  //# sourceMappingURL=solve-kepler-newton-raphson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solve-kepler-newton-raphson.d.ts","sourceRoot":"","sources":["../../../src/categories/kepler/solve-kepler-newton-raphson.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,eAAO,MAAM,wBAAwB,GACnC,GAAG,OAAO,EACV,GAAG,MAAM,EACT,SAAS,MAAM,EACf,WAAW,MAAM,KAChB,OAwCF,CAAC"}
@@ -80,7 +80,7 @@
80
80
  * @see [Kepler's Equation (Wikipedia)](https://en.wikipedia.org/wiki/Kepler%27s_equation)
81
81
  * @see [Newton-Raphson Method (Wikipedia)](https://en.wikipedia.org/wiki/Newton%27s_method)
82
82
  * @see [Eccentric Anomaly (Wikipedia)](https://en.wikipedia.org/wiki/Mean_anomaly#Eccentric_anomaly)
83
- * @category Solve for Kepler
83
+ * @group Kepler Solvers
84
84
  */
85
85
  export const solveKeplerNewtonRaphson = (M, e, maxIter, tolerance) => {
86
86
  if (e < 0 || e >= 1) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solve-kepler-newton-raphson.js","sourceRoot":"","sources":["../../../src/categories/kepler/solve-kepler-newton-raphson.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmFG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,CAAU,EACV,CAAS,EACT,OAAe,EACf,SAAiB,EACR,EAAE;IACX,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,UAAU,CAAC,yBAAyB,CAAC,2BAA2B,CAAC,CAAC;IAC9E,CAAC;IAED,IAAI,CAAS,CAAC;IAEd,sBAAsB;IACtB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACZ,CAAC,GAAG,CAAC,CAAC;IACR,CAAC;SAAM,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;QACpB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GAAG,CAAC,CAAC,mBAAmB;AACjC,CAAC,CAAC"}
@@ -76,7 +76,7 @@ import { Radians } from '@interstellar-tools/types';
76
76
  * @see [Newton-Raphson Method (Wikipedia)](https://en.wikipedia.org/wiki/Newton%27s_method)
77
77
  * @see [Eccentric Anomaly (Wikipedia)](https://en.wikipedia.org/wiki/Mean_anomaly#Eccentric_anomaly)
78
78
  * @see [RangeError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError)
79
- * @category Solve for Kepler
79
+ * @group Kepler Solvers
80
80
  */
81
81
  export declare const solveKepler: (M: Radians, e: number, maxIter?: number, tolerance?: number) => Radians;
82
82
  //# sourceMappingURL=solve-kepler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solve-kepler.d.ts","sourceRoot":"","sources":["../../../src/categories/kepler/solve-kepler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAQpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AACH,eAAO,MAAM,WAAW,GACtB,GAAG,OAAO,EACV,GAAG,MAAM,EACT,gBAAY,EACZ,kBAAgB,KACf,OAkBF,CAAC"}
@@ -1,7 +1,7 @@
1
+ import { wrapAngle } from '../angle/wrap-angle';
1
2
  import { solveKeplerBisection } from './solve-kepler-bisection';
2
3
  import { solveKeplerHighEccentricity } from './solve-kepler-high-eccentricity';
3
4
  import { solveKeplerNewtonRaphson } from './solve-kepler-newton-raphson';
4
- import { wrapAngle } from './wrap-angle';
5
5
  /**
6
6
  * Solves **Kepler's Equation** for the **Eccentric Anomaly** ($E$) using an adaptive approach:
7
7
  * - **Newton-Raphson method** for fast convergence.
@@ -79,7 +79,7 @@ import { wrapAngle } from './wrap-angle';
79
79
  * @see [Newton-Raphson Method (Wikipedia)](https://en.wikipedia.org/wiki/Newton%27s_method)
80
80
  * @see [Eccentric Anomaly (Wikipedia)](https://en.wikipedia.org/wiki/Mean_anomaly#Eccentric_anomaly)
81
81
  * @see [RangeError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError)
82
- * @category Solve for Kepler
82
+ * @group Kepler Solvers
83
83
  */
84
84
  export const solveKepler = (M, e, maxIter = 50, tolerance = 1e-9) => {
85
85
  if (e < 0 || e >= 1) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solve-kepler.js","sourceRoot":"","sources":["../../../src/categories/kepler/solve-kepler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8EG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,CAAU,EACV,CAAS,EACT,OAAO,GAAG,EAAE,EACZ,SAAS,GAAG,IAAI,EACP,EAAE;IACX,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,UAAU,CAAC,yBAAyB,CAAC,2BAA2B,CAAC,CAAC;IAC9E,CAAC;IAED,wDAAwD;IACxD,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACZ,OAAO,2BAA2B,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED,+DAA+D;IAC/D,IAAI,CAAC,GAAG,wBAAwB,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAE3D,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACb,CAAC,GAAG,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * **Circular speed** ($ v_c $) for a body in a circular orbit at radius ($ r $).
3
+ *
4
+ * **Definition**
5
+ *
6
+ * $$
7
+ * v_c=\sqrt{\frac{\mu}{r}}
8
+ * $$
9
+ *
10
+ * where ($ \mu $) is the standard gravitational parameter and ($ r $) is the distance
11
+ * from the central body's center to the orbiting body.
12
+ *
13
+ * **Units**
14
+ * - Inputs: ($ r $) in **meters (m)**, ($ \mu $) in **m³/s²**.
15
+ * - Output: ($ v_c $) in **m/s**.
16
+ *
17
+ * ::: info
18
+ *
19
+ * - This is the special case of the vis-viva equation for circular orbits (($ a=r $)).
20
+ * - If you need a non-circular orbit, use `visVivaSpeed(r, a, mu)`.
21
+ *
22
+ * :::
23
+ *
24
+ * @param {number} r Orbital radius ($ r $) (m), must be finite and **> 0**.
25
+ * @param {number} mu Gravitational parameter ($ \mu $) (m³/s²), must be finite and **≥ 0**.
26
+ * @returns {number} Circular speed ($ v_c $) (m/s).
27
+ * @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} If inputs are non-finite or out of domain.
28
+ *
29
+ * @see {@link visVivaSpeed}
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * // LEO ~400 km altitude around Earth
34
+ * const muEarth = 3.986004418e14; // m^3/s^2
35
+ * const r = 6378e3 + 400e3; // m
36
+ * const v = circularSpeed(r, muEarth); // ≈ 7670 m/s
37
+ * ```
38
+ *
39
+ * @group Orbits
40
+ */
41
+ export declare const circularSpeed: (r: number, mu: number) => number;
42
+ //# sourceMappingURL=circular-speed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circular-speed.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/circular-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,aAAa,GAAI,GAAG,MAAM,EAAE,IAAI,MAAM,KAAG,MAUrD,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * **Circular speed** ($ v_c $) for a body in a circular orbit at radius ($ r $).
3
+ *
4
+ * **Definition**
5
+ *
6
+ * $$
7
+ * v_c=\sqrt{\frac{\mu}{r}}
8
+ * $$
9
+ *
10
+ * where ($ \mu $) is the standard gravitational parameter and ($ r $) is the distance
11
+ * from the central body's center to the orbiting body.
12
+ *
13
+ * **Units**
14
+ * - Inputs: ($ r $) in **meters (m)**, ($ \mu $) in **m³/s²**.
15
+ * - Output: ($ v_c $) in **m/s**.
16
+ *
17
+ * ::: info
18
+ *
19
+ * - This is the special case of the vis-viva equation for circular orbits (($ a=r $)).
20
+ * - If you need a non-circular orbit, use `visVivaSpeed(r, a, mu)`.
21
+ *
22
+ * :::
23
+ *
24
+ * @param {number} r Orbital radius ($ r $) (m), must be finite and **> 0**.
25
+ * @param {number} mu Gravitational parameter ($ \mu $) (m³/s²), must be finite and **≥ 0**.
26
+ * @returns {number} Circular speed ($ v_c $) (m/s).
27
+ * @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error} If inputs are non-finite or out of domain.
28
+ *
29
+ * @see {@link visVivaSpeed}
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * // LEO ~400 km altitude around Earth
34
+ * const muEarth = 3.986004418e14; // m^3/s^2
35
+ * const r = 6378e3 + 400e3; // m
36
+ * const v = circularSpeed(r, muEarth); // ≈ 7670 m/s
37
+ * ```
38
+ *
39
+ * @group Orbits
40
+ */
41
+ export const circularSpeed = (r, mu) => {
42
+ if (!Number.isFinite(r) || r <= 0) {
43
+ throw new Error('r must be a finite, positive number (m).');
44
+ }
45
+ if (!Number.isFinite(mu) || mu < 0) {
46
+ throw new Error('mu must be a finite, non-negative number (m^3/s^2).');
47
+ }
48
+ return Math.sqrt(mu / r);
49
+ };
50
+ //# sourceMappingURL=circular-speed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"circular-speed.js","sourceRoot":"","sources":["../../../src/categories/orbits/circular-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;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,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;AAC3B,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * **Escape speed** ($ v_{\text{esc}} $) - minimum speed to escape a central body's gravity from radius ($ r $) (ignoring drag/perturbations).
3
+ *
4
+ * **Definition**
5
+ *
6
+ * $$
7
+ * v_{\text{esc}}=\sqrt{\frac{2\mu}{r}}
8
+ * $$
9
+ *
10
+ * where ($ \mu $) is the standard gravitational parameter and ($ r $) is the distance
11
+ * from the central body's center.
12
+ *
13
+ * **Units**
14
+ * - Inputs: ($ r $) in **meters (m)**, ($ \mu $) in **m³/s²**.
15
+ * - Output: ($ v_{\text{esc}} $) in **m/s**.
16
+ *
17
+ * ::: info
18
+ *
19
+ * - Relationship to circular speed ($ v_c $): ($ v_{\text{esc}}=\sqrt{2}\,v_c $).
20
+ * - This corresponds to **parabolic** specific energy (($ \varepsilon = 0 $)).
21
+ * - For general (non-escape) orbital speed use `visVivaSpeed(r, a, mu)`.
22
+ *
23
+ * :::
24
+ *
25
+ * @param {number} r Radius ($ r $) (m), distance from the central body’s center (must be finite and **> 0**).
26
+ * @param {number} mu Gravitational parameter ($ \mu $) (m³/s²), must be finite and **≥ 0**.
27
+ * @returns {number} Escape speed ($ v_{\text{esc}} $) (m/s).
28
+ * @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}
29
+ * If inputs are non-finite or out of domain.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * // Near Earth's surface (approx.)
34
+ * const muEarth = 3.986004418e14; // m^3/s^2
35
+ * const rSurface = 6378e3; // m
36
+ * const vEsc = escapeSpeed(rSurface, muEarth); // ≈ 11186 m/s
37
+ * ```
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * // LEO ~400 km altitude: r = R_E + 400 km
42
+ * const muEarth = 3.986004418e14;
43
+ * const rLEO = 6378e3 + 400e3;
44
+ * const vEsc = escapeSpeed(rLEO, muEarth); // ≈ 10860 m/s
45
+ * ```
46
+ *
47
+ * @group Orbits
48
+ */
49
+ export declare const escapeSpeed: (r: number, mu: number) => number;
50
+ //# sourceMappingURL=escape-speed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escape-speed.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/escape-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,EAAE,IAAI,MAAM,KAAG,MAUnD,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * **Escape speed** ($ v_{\text{esc}} $) - minimum speed to escape a central body's gravity from radius ($ r $) (ignoring drag/perturbations).
3
+ *
4
+ * **Definition**
5
+ *
6
+ * $$
7
+ * v_{\text{esc}}=\sqrt{\frac{2\mu}{r}}
8
+ * $$
9
+ *
10
+ * where ($ \mu $) is the standard gravitational parameter and ($ r $) is the distance
11
+ * from the central body's center.
12
+ *
13
+ * **Units**
14
+ * - Inputs: ($ r $) in **meters (m)**, ($ \mu $) in **m³/s²**.
15
+ * - Output: ($ v_{\text{esc}} $) in **m/s**.
16
+ *
17
+ * ::: info
18
+ *
19
+ * - Relationship to circular speed ($ v_c $): ($ v_{\text{esc}}=\sqrt{2}\,v_c $).
20
+ * - This corresponds to **parabolic** specific energy (($ \varepsilon = 0 $)).
21
+ * - For general (non-escape) orbital speed use `visVivaSpeed(r, a, mu)`.
22
+ *
23
+ * :::
24
+ *
25
+ * @param {number} r Radius ($ r $) (m), distance from the central body’s center (must be finite and **> 0**).
26
+ * @param {number} mu Gravitational parameter ($ \mu $) (m³/s²), must be finite and **≥ 0**.
27
+ * @returns {number} Escape speed ($ v_{\text{esc}} $) (m/s).
28
+ * @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}
29
+ * If inputs are non-finite or out of domain.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * // Near Earth's surface (approx.)
34
+ * const muEarth = 3.986004418e14; // m^3/s^2
35
+ * const rSurface = 6378e3; // m
36
+ * const vEsc = escapeSpeed(rSurface, muEarth); // ≈ 11186 m/s
37
+ * ```
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * // LEO ~400 km altitude: r = R_E + 400 km
42
+ * const muEarth = 3.986004418e14;
43
+ * const rLEO = 6378e3 + 400e3;
44
+ * const vEsc = escapeSpeed(rLEO, muEarth); // ≈ 10860 m/s
45
+ * ```
46
+ *
47
+ * @group Orbits
48
+ */
49
+ export const escapeSpeed = (r, mu) => {
50
+ if (!Number.isFinite(r) || r <= 0) {
51
+ throw new Error('r must be a finite, positive number (m).');
52
+ }
53
+ if (!Number.isFinite(mu) || mu < 0) {
54
+ throw new Error('mu must be a finite, non-negative number (m^3/s^2).');
55
+ }
56
+ return Math.sqrt((2 * mu) / r);
57
+ };
58
+ //# sourceMappingURL=escape-speed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escape-speed.js","sourceRoot":"","sources":["../../../src/categories/orbits/escape-speed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;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,qDAAqD,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC,CAAC"}
@@ -39,7 +39,7 @@
39
39
  * const T = keplerPeriod(a, muEarth); // ≈ 5550 s (~92.5 min)
40
40
  * ```
41
41
  *
42
- * @category Dynamics
42
+ * @group Orbits
43
43
  */
44
44
  export declare const keplerPeriod: (a: number, mu: number) => number;
45
45
  //# sourceMappingURL=kepler-period.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kepler-period.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/kepler-period.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,EAAE,IAAI,MAAM,KAAG,MAYpD,CAAC"}
@@ -39,7 +39,7 @@
39
39
  * const T = keplerPeriod(a, muEarth); // ≈ 5550 s (~92.5 min)
40
40
  * ```
41
41
  *
42
- * @category Dynamics
42
+ * @group Orbits
43
43
  */
44
44
  export const keplerPeriod = (a, mu) => {
45
45
  if (!Number.isFinite(a) || a <= 0) {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kepler-period.js","sourceRoot":"","sources":["../../../src/categories/orbits/kepler-period.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;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,iDAAiD,CAAC,CAAC;IACrE,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"}
@@ -0,0 +1,46 @@
1
+ import { PeriApoRadiiType } from '@interstellar-tools/types';
2
+ /**
3
+ * **Peri/apoapsis radii** from semi-major axis ($ a $) and eccentricity ($ e $).
4
+ *
5
+ * **Definitions**
6
+ *
7
+ * $$
8
+ * r_p = a(1-e),\qquad r_a = a(1+e)
9
+ * $$
10
+ *
11
+ * **Conic validity**
12
+ * - **Elliptic / circular**: ($ a>0,\; 0\le e<1 $) → ($ r_p>0 $) and ($ r_a>0 $).
13
+ * - **Hyperbolic**: ($ a<0,\; e>1 $) → ($ r_p = a(1-e) = |a|(e-1) > 0 $), **no apoapsis** (unbounded), so ($ r_a = null $).
14
+ * - **Parabolic**: ($ e=1 $) is **not** defined with finite ($ a $). Use the parabolic form (e.g. ($ r_p = \tfrac{p}{2} $)) or state vectors.
15
+ *
16
+ * **Units**
17
+ * - Inputs: ($ a $) in **meters (m)**, ($ e $) dimensionless.
18
+ * - Output: ($ r_p, r_a $) in **meters (m)**.
19
+ *
20
+ * @param {number} a Semi-major axis ($ a $) (m). Must be finite and **≠ 0**.
21
+ * @param {number} e Eccentricity ($ e $) (dimensionless). Must be finite and **≥ 0**.
22
+ * @returns {{ rp: number; ra: number | null }} Object with periapsis `rp` and apoapsis `ra` (or `null` if undefined for hyperbolic).
23
+ *
24
+ * @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}
25
+ * If inputs are invalid or the ($ (a,e) $) pair does not correspond to an ellipse/circle or hyperbola with finite ($ a $).
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * // Elliptic example (LEO-like)
30
+ * const a = 7000e3; // m
31
+ * const e = 0.01;
32
+ * const { rp, ra } = periApoapsisRadii(a, e); // rp ≈ 6930 km, ra ≈ 7070 km
33
+ * ```
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * // Hyperbolic flyby (no apoapsis)
38
+ * const a = -50_000e3; // m
39
+ * const e = 1.2;
40
+ * const { rp, ra } = periApoapsisRadii(a, e); // rp = |a|(e-1) = 10,000 km, ra = null
41
+ * ```
42
+ *
43
+ * @group Orbits
44
+ */
45
+ export declare const periApoapsisRadii: (a: number, e: number) => PeriApoRadiiType;
46
+ //# sourceMappingURL=peri-apoapsis-radii.d.ts.map
@@ -0,0 +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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,eAAO,MAAM,iBAAiB,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,gBAsDxD,CAAC"}
@@ -0,0 +1,85 @@
1
+ /* node:coverage disable */
2
+ /**
3
+ * **Peri/apoapsis radii** from semi-major axis ($ a $) and eccentricity ($ e $).
4
+ *
5
+ * **Definitions**
6
+ *
7
+ * $$
8
+ * r_p = a(1-e),\qquad r_a = a(1+e)
9
+ * $$
10
+ *
11
+ * **Conic validity**
12
+ * - **Elliptic / circular**: ($ a>0,\; 0\le e<1 $) → ($ r_p>0 $) and ($ r_a>0 $).
13
+ * - **Hyperbolic**: ($ a<0,\; e>1 $) → ($ r_p = a(1-e) = |a|(e-1) > 0 $), **no apoapsis** (unbounded), so ($ r_a = null $).
14
+ * - **Parabolic**: ($ e=1 $) is **not** defined with finite ($ a $). Use the parabolic form (e.g. ($ r_p = \tfrac{p}{2} $)) or state vectors.
15
+ *
16
+ * **Units**
17
+ * - Inputs: ($ a $) in **meters (m)**, ($ e $) dimensionless.
18
+ * - Output: ($ r_p, r_a $) in **meters (m)**.
19
+ *
20
+ * @param {number} a Semi-major axis ($ a $) (m). Must be finite and **≠ 0**.
21
+ * @param {number} e Eccentricity ($ e $) (dimensionless). Must be finite and **≥ 0**.
22
+ * @returns {{ rp: number; ra: number | null }} Object with periapsis `rp` and apoapsis `ra` (or `null` if undefined for hyperbolic).
23
+ *
24
+ * @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}
25
+ * If inputs are invalid or the ($ (a,e) $) pair does not correspond to an ellipse/circle or hyperbola with finite ($ a $).
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * // Elliptic example (LEO-like)
30
+ * const a = 7000e3; // m
31
+ * const e = 0.01;
32
+ * const { rp, ra } = periApoapsisRadii(a, e); // rp ≈ 6930 km, ra ≈ 7070 km
33
+ * ```
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * // Hyperbolic flyby (no apoapsis)
38
+ * const a = -50_000e3; // m
39
+ * const e = 1.2;
40
+ * const { rp, ra } = periApoapsisRadii(a, e); // rp = |a|(e-1) = 10,000 km, ra = null
41
+ * ```
42
+ *
43
+ * @group Orbits
44
+ */
45
+ /* node:coverage enable */
46
+ export const periApoapsisRadii = (a, e) => {
47
+ if (!Number.isFinite(a) || a === 0) {
48
+ throw new Error('a must be finite and non-zero (meters).');
49
+ }
50
+ if (!Number.isFinite(e) || e < 0) {
51
+ throw new Error('e must be finite and ≥ 0.');
52
+ }
53
+ // Elliptic / circular
54
+ if (a > 0) {
55
+ if (e >= 1) {
56
+ if (e === 1) {
57
+ throw new Error('Parabolic (e=1) is not defined with finite a. Use parabolic relations (e.g., rp = p/2) or state vectors.');
58
+ }
59
+ throw new Error('For a>0 (elliptic/circular), eccentricity must satisfy 0 ≤ e < 1.');
60
+ }
61
+ const rp = a * (1 - e);
62
+ const ra = a * (1 + e);
63
+ // Both must be positive for a valid ellipse
64
+ if (!(rp > 0 && ra > 0)) {
65
+ throw new Error('Computed radii are non-physical for the given (a,e).');
66
+ }
67
+ return { rp, ra };
68
+ }
69
+ // Hyperbolic
70
+ // a < 0 requires e > 1 for a valid hyperbola
71
+ if (e <= 1) {
72
+ throw new Error('For a<0 (hyperbolic), eccentricity must satisfy e > 1.');
73
+ }
74
+ const rp = a * (1 - e); // = |a|(e-1) > 0
75
+ if (!(rp > 0)) {
76
+ // tiny negatives due to FP?
77
+ const tol = Math.abs(1e-14 * Math.abs(a));
78
+ if (rp > -tol) {
79
+ return { rp: 0, ra: null };
80
+ }
81
+ throw new Error('Computed periapsis radius is non-physical (≤ 0).');
82
+ }
83
+ return { rp, ra: null };
84
+ };
85
+ //# sourceMappingURL=peri-apoapsis-radii.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"peri-apoapsis-radii.js","sourceRoot":"","sources":["../../../src/categories/orbits/peri-apoapsis-radii.ts"],"names":[],"mappings":"AAEA,2BAA2B;AAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,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"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * **Specific angular momentum** ($ h $) from **orbital elements**.
3
+ *
4
+ * **Definition**
5
+ *
6
+ * $$
7
+ * h=\sqrt{\mu\,a\,(1-e^2)}
8
+ * $$
9
+ *
10
+ * where ($ a $) is the semi-major axis, ($ e $) the eccentricity, and ($ \mu $) the gravitational parameter.
11
+ *
12
+ * **Validity by conic**
13
+ * - **Elliptic**: ($ a>0,\; 0\le e<1 $) → ($ 1-e^2>0 $) ⇒ radicand ($ >0 $).
14
+ * - **Hyperbolic**: ($ a<0,\; e>1 $) → ($ 1-e^2<0 $) and ($ a<0 $) ⇒ product still ($ >0 $).
15
+ * - **Parabolic**: ($ e=1 $) is not represented by finite ($ a $). Use state vectors or
16
+ * ($ h=\sqrt{2\mu r_p} $) (with periapsis radius ($ r_p $)).
17
+ *
18
+ * **Units**
19
+ * - Inputs: ($ a $) in **m**, ($ e $) dimensionless, ($ \mu $) in **m³/s²**.
20
+ * - Output: ($ h $) in **m²/s**.
21
+ *
22
+ * ::: info
23
+ *
24
+ * - This returns the **magnitude** of ($ \mathbf h = \mathbf r \times \mathbf v $).
25
+ * - For numerical robustness, tiny negative radicands from FP cancellation are clamped to zero.
26
+ *
27
+ * :::
28
+ *
29
+ * @param {number} a Semi-major axis ($ a $) (m). Must be finite and **≠ 0** (elliptic ($ a>0 $), hyperbolic ($ a<0 $)).
30
+ * @param {number} e Eccentricity ($ e $) (dimensionless). Must be finite and **≥ 0**.
31
+ * @param {number} mu Gravitational parameter ($ \mu $) (m³/s²). Must be finite and **≥ 0**.
32
+ * @returns {number} Specific angular momentum ($ h $) (m²/s).
33
+ *
34
+ * @throws {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error | Error}
35
+ * If ($ a $) is non-finite or zero; if ($ e $) is non-finite or negative; if ($ \mu $) is non-finite or negative; or if
36
+ * ($ \mu\,a\,(1-e^2) < 0 $) beyond a tiny FP tolerance (invalid element set for this formula).
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * // Near-circular LEO-like elements
41
+ * const muEarth = 3.986004418e14; // m^3/s^2
42
+ * const a = 6778e3; // m
43
+ * const e = 0.001;
44
+ * const h = specificAngularMomentumFromElements(a, e, muEarth); // ≈ sqrt(μ a)
45
+ * ```
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * // Hyperbolic flyby example
50
+ * const muEarth = 3.986004418e14; // m^3/s^2
51
+ * const a = -50000e3; // m (negative for hyperbola)
52
+ * const e = 1.2;
53
+ * const h = specificAngularMomentumFromElements(a, e, muEarth);
54
+ * ```
55
+ *
56
+ * @see {@link specificAngularMomentum} - compute ($ h $) from state vectors ($ (\mathbf r,\mathbf v) $).
57
+ * @group Orbits
58
+ */
59
+ export declare const specificAngularMomentumFromElements: (a: number, e: number, mu: number) => number;
60
+ //# sourceMappingURL=specific-angular-momentum-from-elements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specific-angular-momentum-from-elements.d.ts","sourceRoot":"","sources":["../../../src/categories/orbits/specific-angular-momentum-from-elements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,eAAO,MAAM,mCAAmC,GAC9C,GAAG,MAAM,EACT,GAAG,MAAM,EACT,IAAI,MAAM,KACT,MAwBF,CAAC"}