ootk 3.0.0 → 4.0.0-1

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 (357) hide show
  1. package/CHANGELOG.md +235 -10
  2. package/README.md +27 -40
  3. package/dist/coordinate/Hill.d.ts +49 -0
  4. package/dist/coordinate/Hill.js +222 -0
  5. package/dist/coordinate/Hill.js.map +1 -0
  6. package/dist/coordinate/index.d.ts +1 -0
  7. package/dist/coordinate/index.js +2 -0
  8. package/dist/coordinate/index.js.map +1 -0
  9. package/dist/covariance/CovarianceSample.d.ts +43 -0
  10. package/dist/covariance/CovarianceSample.js +147 -0
  11. package/dist/covariance/CovarianceSample.js.map +1 -0
  12. package/dist/covariance/StateCovariance.d.ts +42 -0
  13. package/dist/covariance/StateCovariance.js +65 -0
  14. package/dist/covariance/StateCovariance.js.map +1 -0
  15. package/dist/force/AtmosphericDrag.d.ts +31 -0
  16. package/dist/force/AtmosphericDrag.js +73 -0
  17. package/dist/force/AtmosphericDrag.js.map +1 -0
  18. package/dist/force/EarthGravity.d.ts +27 -0
  19. package/dist/force/EarthGravity.js +117 -0
  20. package/dist/force/EarthGravity.js.map +1 -0
  21. package/{lib/ootk.d.ts → dist/force/Force.d.ts} +12 -11
  22. package/dist/force/Force.js +31 -0
  23. package/dist/force/Force.js.map +1 -0
  24. package/dist/force/ForceModel.d.ts +37 -0
  25. package/dist/force/ForceModel.js +75 -0
  26. package/dist/force/ForceModel.js.map +1 -0
  27. package/dist/force/Gravity.d.ts +38 -0
  28. package/dist/force/Gravity.js +47 -0
  29. package/dist/force/Gravity.js.map +1 -0
  30. package/dist/{ootk.d.ts → force/SolarRadiationPressure.d.ts} +12 -11
  31. package/dist/force/SolarRadiationPressure.js +44 -0
  32. package/dist/force/SolarRadiationPressure.js.map +1 -0
  33. package/dist/force/ThirdBodyGravity.d.ts +26 -0
  34. package/dist/force/ThirdBodyGravity.js +57 -0
  35. package/dist/force/ThirdBodyGravity.js.map +1 -0
  36. package/dist/force/Thrust.d.ts +34 -0
  37. package/dist/force/Thrust.js +58 -0
  38. package/dist/force/Thrust.js.map +1 -0
  39. package/dist/interfaces/RfSensorParams.d.ts +28 -0
  40. package/dist/interfaces/RfSensorParams.js +24 -0
  41. package/dist/interfaces/RfSensorParams.js.map +1 -0
  42. package/dist/interfaces/index.d.ts +1 -0
  43. package/dist/interfaces/index.js +2 -0
  44. package/dist/interfaces/index.js.map +1 -0
  45. package/dist/interpolator/ChebyshevCoefficients.d.ts +50 -0
  46. package/dist/interpolator/ChebyshevCoefficients.js +94 -0
  47. package/dist/interpolator/ChebyshevCoefficients.js.map +1 -0
  48. package/dist/interpolator/ChebyshevInterpolator.d.ts +38 -0
  49. package/dist/interpolator/ChebyshevInterpolator.js +71 -0
  50. package/dist/interpolator/ChebyshevInterpolator.js.map +1 -0
  51. package/dist/interpolator/CubicSpline.d.ts +35 -0
  52. package/dist/interpolator/CubicSpline.js +69 -0
  53. package/dist/interpolator/CubicSpline.js.map +1 -0
  54. package/dist/interpolator/CubicSplineInterpolator.d.ts +36 -0
  55. package/dist/interpolator/CubicSplineInterpolator.js +80 -0
  56. package/dist/interpolator/CubicSplineInterpolator.js.map +1 -0
  57. package/dist/interpolator/FieldInterpolator.d.ts +28 -0
  58. package/dist/interpolator/FieldInterpolator.js +34 -0
  59. package/dist/interpolator/FieldInterpolator.js.map +1 -0
  60. package/dist/interpolator/Interpolator.d.ts +22 -0
  61. package/dist/interpolator/Interpolator.js +47 -0
  62. package/dist/interpolator/Interpolator.js.map +1 -0
  63. package/dist/interpolator/LagrangeInterpolator.d.ts +40 -0
  64. package/dist/interpolator/LagrangeInterpolator.js +159 -0
  65. package/dist/interpolator/LagrangeInterpolator.js.map +1 -0
  66. package/dist/interpolator/StateInterpolator.d.ts +27 -0
  67. package/dist/interpolator/StateInterpolator.js +35 -0
  68. package/dist/interpolator/StateInterpolator.js.map +1 -0
  69. package/dist/interpolator/VerletBlendInterpolator.d.ts +43 -0
  70. package/dist/interpolator/VerletBlendInterpolator.js +118 -0
  71. package/dist/interpolator/VerletBlendInterpolator.js.map +1 -0
  72. package/{lib/ootk.js → dist/main.d.ts} +13 -10
  73. package/dist/{objects/space-object.d.ts → main.js} +17 -23
  74. package/dist/main.js.map +1 -0
  75. package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +41 -0
  76. package/dist/maneuver/TwoBurnOrbitTransfer.js +65 -0
  77. package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
  78. package/dist/maneuver/Waypoint.d.ts +91 -0
  79. package/dist/maneuver/Waypoint.js +179 -0
  80. package/dist/maneuver/Waypoint.js.map +1 -0
  81. package/{lib/objects/detailed-sat.d.ts → dist/objects/DetailedSatellite.d.ts} +40 -36
  82. package/dist/objects/DetailedSatellite.js +136 -0
  83. package/dist/objects/DetailedSatellite.js.map +1 -0
  84. package/dist/objects/DetailedSensor.d.ts +42 -0
  85. package/dist/objects/DetailedSensor.js +65 -0
  86. package/dist/objects/DetailedSensor.js.map +1 -0
  87. package/dist/objects/LandObject.d.ts +33 -0
  88. package/dist/objects/LandObject.js +34 -0
  89. package/dist/objects/LandObject.js.map +1 -0
  90. package/dist/objects/Marker.d.ts +20 -0
  91. package/dist/objects/Marker.js +24 -0
  92. package/dist/objects/Marker.js.map +1 -0
  93. package/dist/objects/RfSensor.d.ts +41 -0
  94. package/dist/objects/RfSensor.js +67 -0
  95. package/dist/objects/RfSensor.js.map +1 -0
  96. package/dist/objects/index.d.ts +5 -4
  97. package/dist/objects/index.js +6 -0
  98. package/dist/objects/index.js.map +1 -0
  99. package/dist/observation/Observation.d.ts +89 -0
  100. package/dist/observation/Observation.js +102 -0
  101. package/dist/observation/Observation.js.map +1 -0
  102. package/dist/observation/ObservationOptical.d.ts +48 -0
  103. package/dist/observation/ObservationOptical.js +105 -0
  104. package/dist/observation/ObservationOptical.js.map +1 -0
  105. package/dist/observation/ObservationRadar.d.ts +46 -0
  106. package/dist/observation/ObservationRadar.js +96 -0
  107. package/dist/observation/ObservationRadar.js.map +1 -0
  108. package/dist/observation/ObservationUtils.d.ts +20 -0
  109. package/dist/observation/ObservationUtils.js +32 -0
  110. package/dist/observation/ObservationUtils.js.map +1 -0
  111. package/dist/observation/PropagatorPairs.d.ts +32 -0
  112. package/dist/observation/PropagatorPairs.js +43 -0
  113. package/dist/observation/PropagatorPairs.js.map +1 -0
  114. package/dist/operations/BoxMuller.d.ts +46 -0
  115. package/dist/operations/BoxMuller.js +77 -0
  116. package/dist/operations/BoxMuller.js.map +1 -0
  117. package/dist/operations/EulerAngles.d.ts +105 -0
  118. package/dist/operations/EulerAngles.js +161 -0
  119. package/dist/operations/EulerAngles.js.map +1 -0
  120. package/dist/operations/Quaternion.d.ts +56 -0
  121. package/dist/operations/Quaternion.js +167 -0
  122. package/dist/operations/Quaternion.js.map +1 -0
  123. package/dist/operations/RandomGaussianSource.d.ts +24 -0
  124. package/dist/operations/RandomGaussianSource.js +43 -0
  125. package/dist/operations/RandomGaussianSource.js.map +1 -0
  126. package/dist/operations/index.d.ts +4 -0
  127. package/dist/operations/index.js +5 -0
  128. package/dist/operations/index.js.map +1 -0
  129. package/dist/optimize/ChebyshevCompressor.d.ts +32 -0
  130. package/dist/optimize/ChebyshevCompressor.js +83 -0
  131. package/dist/optimize/ChebyshevCompressor.js.map +1 -0
  132. package/dist/optimize/DownhillSimplex.d.ts +64 -0
  133. package/dist/optimize/DownhillSimplex.js +182 -0
  134. package/dist/optimize/DownhillSimplex.js.map +1 -0
  135. package/dist/optimize/GoldenSection.d.ts +39 -0
  136. package/dist/optimize/GoldenSection.js +55 -0
  137. package/dist/optimize/GoldenSection.js.map +1 -0
  138. package/dist/optimize/PolynomialRegression.d.ts +49 -0
  139. package/dist/optimize/PolynomialRegression.js +83 -0
  140. package/dist/optimize/PolynomialRegression.js.map +1 -0
  141. package/dist/optimize/PolynomicalRegressionResult.d.ts +31 -0
  142. package/dist/optimize/PolynomicalRegressionResult.js +38 -0
  143. package/dist/optimize/PolynomicalRegressionResult.js.map +1 -0
  144. package/dist/optimize/SimpleLinearRegression.d.ts +44 -0
  145. package/dist/optimize/SimpleLinearRegression.js +112 -0
  146. package/dist/optimize/SimpleLinearRegression.js.map +1 -0
  147. package/dist/optimize/SimplexEntry.d.ts +32 -0
  148. package/dist/optimize/SimplexEntry.js +42 -0
  149. package/dist/optimize/SimplexEntry.js.map +1 -0
  150. package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +65 -0
  151. package/dist/orbit_determination/BatchLeastSquaresOD.js +143 -0
  152. package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
  153. package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +31 -0
  154. package/{lib/objects/space-object.d.ts → dist/orbit_determination/BatchLeastSquaresResult.js} +21 -23
  155. package/dist/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
  156. package/dist/orbit_determination/GibbsIOD.d.ts +38 -0
  157. package/dist/orbit_determination/GibbsIOD.js +76 -0
  158. package/dist/orbit_determination/GibbsIOD.js.map +1 -0
  159. package/dist/orbit_determination/GoodingIOD.d.ts +51 -0
  160. package/dist/orbit_determination/GoodingIOD.js +247 -0
  161. package/dist/orbit_determination/GoodingIOD.js.map +1 -0
  162. package/dist/orbit_determination/HerrickGibbsIOD.d.ts +33 -0
  163. package/dist/orbit_determination/HerrickGibbsIOD.js +50 -0
  164. package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -0
  165. package/dist/orbit_determination/LambertIOD.d.ts +59 -0
  166. package/dist/orbit_determination/LambertIOD.js +213 -0
  167. package/dist/orbit_determination/LambertIOD.js.map +1 -0
  168. package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +40 -0
  169. package/dist/orbit_determination/ModifiedGoodingIOD.js +83 -0
  170. package/dist/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
  171. package/dist/propagator/DormandPrince54Propagator.d.ts +28 -0
  172. package/dist/propagator/DormandPrince54Propagator.js +64 -0
  173. package/dist/propagator/DormandPrince54Propagator.js.map +1 -0
  174. package/dist/propagator/KeplerPropagator.d.ts +35 -0
  175. package/dist/propagator/KeplerPropagator.js +84 -0
  176. package/dist/propagator/KeplerPropagator.js.map +1 -0
  177. package/dist/propagator/Propagator.d.ts +34 -0
  178. package/dist/propagator/Propagator.js +162 -0
  179. package/dist/propagator/Propagator.js.map +1 -0
  180. package/dist/propagator/RkCheckpoint.d.ts +22 -0
  181. package/dist/propagator/RkCheckpoint.js +27 -0
  182. package/dist/propagator/RkCheckpoint.js.map +1 -0
  183. package/dist/propagator/RkResult.d.ts +23 -0
  184. package/dist/propagator/RkResult.js +30 -0
  185. package/dist/propagator/RkResult.js.map +1 -0
  186. package/dist/propagator/RungeKutta4Propagator.d.ts +50 -0
  187. package/dist/propagator/RungeKutta4Propagator.js +141 -0
  188. package/dist/propagator/RungeKutta4Propagator.js.map +1 -0
  189. package/dist/propagator/RungeKutta89Propagator.d.ts +28 -0
  190. package/dist/propagator/RungeKutta89Propagator.js +126 -0
  191. package/dist/propagator/RungeKutta89Propagator.js.map +1 -0
  192. package/dist/propagator/RungeKuttaAdaptive.d.ts +54 -0
  193. package/dist/propagator/RungeKuttaAdaptive.js +159 -0
  194. package/dist/propagator/RungeKuttaAdaptive.js.map +1 -0
  195. package/dist/propagator/Sgp4Propagator.d.ts +34 -0
  196. package/dist/propagator/Sgp4Propagator.js +56 -0
  197. package/dist/propagator/Sgp4Propagator.js.map +1 -0
  198. package/dist/smoothing/ExponentialSmoothing.d.ts +23 -0
  199. package/dist/smoothing/ExponentialSmoothing.js +81 -0
  200. package/dist/smoothing/ExponentialSmoothing.js.map +1 -0
  201. package/dist/transforms/index.d.ts +1 -0
  202. package/dist/transforms/index.js +2 -0
  203. package/dist/transforms/index.js.map +1 -0
  204. package/dist/transforms/transforms.d.ts +56 -92
  205. package/dist/transforms/transforms.js +94 -0
  206. package/dist/transforms/transforms.js.map +1 -0
  207. package/dist/types/types.d.ts +105 -584
  208. package/dist/types/types.js +23 -0
  209. package/dist/types/types.js.map +1 -0
  210. package/dist/utils/index.d.ts +1 -0
  211. package/dist/utils/index.js +2 -0
  212. package/dist/utils/index.js.map +1 -0
  213. package/dist/utils/jacobian.d.ts +11 -0
  214. package/dist/utils/jacobian.js +29 -0
  215. package/dist/utils/jacobian.js.map +1 -0
  216. package/package.json +34 -42
  217. package/src/coordinate/Hill.ts +326 -0
  218. package/src/coordinate/index.ts +1 -0
  219. package/src/covariance/CovarianceSample.ts +194 -0
  220. package/src/covariance/StateCovariance.ts +69 -0
  221. package/src/force/AtmosphericDrag.ts +101 -0
  222. package/src/force/EarthGravity.ts +157 -0
  223. package/src/force/Force.ts +33 -0
  224. package/src/force/ForceModel.ts +91 -0
  225. package/src/force/Gravity.ts +53 -0
  226. package/src/force/SolarRadiationPressure.ts +42 -0
  227. package/src/force/ThirdBodyGravity.ts +62 -0
  228. package/src/force/Thrust.ts +83 -0
  229. package/src/interfaces/RfSensorParams.ts +30 -0
  230. package/src/interfaces/index.ts +1 -0
  231. package/src/interpolator/ChebyshevCoefficients.ts +109 -0
  232. package/src/interpolator/ChebyshevInterpolator.ts +87 -0
  233. package/src/interpolator/CubicSpline.ts +72 -0
  234. package/src/interpolator/CubicSplineInterpolator.ts +90 -0
  235. package/src/interpolator/FieldInterpolator.ts +37 -0
  236. package/src/interpolator/Interpolator.ts +56 -0
  237. package/src/interpolator/LagrangeInterpolator.ts +192 -0
  238. package/src/interpolator/StateInterpolator.ts +39 -0
  239. package/src/interpolator/VerletBlendInterpolator.ts +146 -0
  240. package/src/main.ts +32 -0
  241. package/src/maneuver/TwoBurnOrbitTransfer.ts +79 -0
  242. package/src/maneuver/Waypoint.ts +267 -0
  243. package/src/objects/DetailedSatellite.ts +159 -0
  244. package/src/objects/DetailedSensor.ts +68 -0
  245. package/src/objects/LandObject.ts +46 -0
  246. package/src/objects/Marker.ts +25 -0
  247. package/src/objects/RfSensor.ts +78 -0
  248. package/src/objects/index.ts +5 -0
  249. package/src/observation/Observation.ts +125 -0
  250. package/src/observation/ObservationOptical.ts +146 -0
  251. package/src/observation/ObservationRadar.ts +131 -0
  252. package/src/observation/ObservationUtils.ts +40 -0
  253. package/src/observation/PropagatorPairs.ts +45 -0
  254. package/src/operations/BoxMuller.ts +87 -0
  255. package/src/operations/EulerAngles.ts +183 -0
  256. package/src/operations/Quaternion.ts +222 -0
  257. package/src/operations/RandomGaussianSource.ts +51 -0
  258. package/src/operations/index.ts +4 -0
  259. package/src/optimize/ChebyshevCompressor.ts +96 -0
  260. package/src/optimize/DownhillSimplex.ts +212 -0
  261. package/src/optimize/GoldenSection.ts +71 -0
  262. package/src/optimize/PolynomialRegression.ts +109 -0
  263. package/src/optimize/PolynomicalRegressionResult.ts +32 -0
  264. package/src/optimize/SimpleLinearRegression.ts +127 -0
  265. package/src/optimize/SimplexEntry.ts +50 -0
  266. package/src/orbit_determination/BatchLeastSquaresOD.ts +174 -0
  267. package/src/orbit_determination/BatchLeastSquaresResult.ts +33 -0
  268. package/src/orbit_determination/GibbsIOD.ts +95 -0
  269. package/src/orbit_determination/GoodingIOD.ts +380 -0
  270. package/src/orbit_determination/HerrickGibbsIOD.ts +51 -0
  271. package/src/orbit_determination/LambertIOD.ts +260 -0
  272. package/src/orbit_determination/ModifiedGoodingIOD.ts +133 -0
  273. package/src/propagator/DormandPrince54Propagator.ts +73 -0
  274. package/src/propagator/KeplerPropagator.ts +102 -0
  275. package/src/propagator/Propagator.ts +253 -0
  276. package/src/propagator/RkCheckpoint.ts +25 -0
  277. package/src/propagator/RkResult.ts +26 -0
  278. package/src/propagator/RungeKutta4Propagator.ts +179 -0
  279. package/src/propagator/RungeKutta89Propagator.ts +132 -0
  280. package/src/propagator/RungeKuttaAdaptive.ts +232 -0
  281. package/src/propagator/Sgp4Propagator.ts +71 -0
  282. package/src/smoothing/ExponentialSmoothing.ts +90 -0
  283. package/src/transforms/index.ts +1 -0
  284. package/src/transforms/transforms.ts +117 -0
  285. package/src/types/types.ts +135 -0
  286. package/src/utils/index.ts +1 -0
  287. package/src/utils/jacobian.ts +38 -0
  288. package/.eslintrc.json +0 -244
  289. package/.prettierrc +0 -17
  290. package/babel.config.js +0 -16
  291. package/codecov.yml +0 -21
  292. package/dist/objects/base-object.d.ts +0 -40
  293. package/dist/objects/detailed-sat.d.ts +0 -66
  294. package/dist/objects/sat.d.ts +0 -92
  295. package/dist/objects/sensor.d.ts +0 -93
  296. package/dist/objects/star.d.ts +0 -46
  297. package/dist/ootk.js +0 -2
  298. package/dist/ootk.js.LICENSE.txt +0 -77
  299. package/dist/sgp4/sgp4.d.ts +0 -82
  300. package/dist/tle/tle-format-data.d.ts +0 -6
  301. package/dist/tle/tle.d.ts +0 -375
  302. package/dist/utils/constants.d.ts +0 -34
  303. package/dist/utils/moon-math.d.ts +0 -113
  304. package/dist/utils/sun-math.d.ts +0 -230
  305. package/dist/utils/utils.d.ts +0 -39
  306. package/jest.config.ts +0 -30
  307. package/lib/objects/base-object.d.ts +0 -40
  308. package/lib/objects/base-object.js +0 -79
  309. package/lib/objects/base-object.js.map +0 -1
  310. package/lib/objects/detailed-sat.js +0 -149
  311. package/lib/objects/detailed-sat.js.map +0 -1
  312. package/lib/objects/index.d.ts +0 -4
  313. package/lib/objects/index.js +0 -5
  314. package/lib/objects/index.js.map +0 -1
  315. package/lib/objects/sat.d.ts +0 -92
  316. package/lib/objects/sat.js +0 -188
  317. package/lib/objects/sat.js.map +0 -1
  318. package/lib/objects/sensor.d.ts +0 -93
  319. package/lib/objects/sensor.js +0 -273
  320. package/lib/objects/sensor.js.map +0 -1
  321. package/lib/objects/space-object.js +0 -60
  322. package/lib/objects/space-object.js.map +0 -1
  323. package/lib/objects/star.d.ts +0 -46
  324. package/lib/objects/star.js +0 -91
  325. package/lib/objects/star.js.map +0 -1
  326. package/lib/ootk.js.map +0 -1
  327. package/lib/sgp4/sgp4.d.ts +0 -82
  328. package/lib/sgp4/sgp4.js +0 -3262
  329. package/lib/sgp4/sgp4.js.map +0 -1
  330. package/lib/tle/tle-format-data.d.ts +0 -6
  331. package/lib/tle/tle-format-data.js +0 -10
  332. package/lib/tle/tle-format-data.js.map +0 -1
  333. package/lib/tle/tle.d.ts +0 -375
  334. package/lib/tle/tle.js +0 -611
  335. package/lib/tle/tle.js.map +0 -1
  336. package/lib/transforms/transforms.d.ts +0 -94
  337. package/lib/transforms/transforms.js +0 -308
  338. package/lib/transforms/transforms.js.map +0 -1
  339. package/lib/types/types.d.ts +0 -605
  340. package/lib/types/types.js +0 -36
  341. package/lib/types/types.js.map +0 -1
  342. package/lib/utils/constants.d.ts +0 -34
  343. package/lib/utils/constants.js +0 -35
  344. package/lib/utils/constants.js.map +0 -1
  345. package/lib/utils/moon-math.d.ts +0 -113
  346. package/lib/utils/moon-math.js +0 -387
  347. package/lib/utils/moon-math.js.map +0 -1
  348. package/lib/utils/sun-math.d.ts +0 -230
  349. package/lib/utils/sun-math.js +0 -422
  350. package/lib/utils/sun-math.js.map +0 -1
  351. package/lib/utils/utils.d.ts +0 -39
  352. package/lib/utils/utils.js +0 -102
  353. package/lib/utils/utils.js.map +0 -1
  354. package/sandbox.html +0 -8
  355. package/tsconfig.base.json +0 -31
  356. package/tsconfig.build.json +0 -14
  357. /package/{LICENSE.MD → LICENSE.md} +0 -0
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ import { Earth, EpochUTC, J2000, Kilometers, KilometersPerSecond, Vector3D } from 'ootk-core';
19
+
20
+ /**
21
+ * Herrik-Gibbs 3-position initial orbit determination.
22
+ *
23
+ * Possibly better than regular Gibbs IOD for closely spaced position
24
+ * vectors (less than 5°).
25
+ */
26
+ export class HerrickGibbsIOD {
27
+ /**
28
+ * Create a new [HerrickGibbsIOD] object with optional
29
+ * gravitational parameter [mu].
30
+ * @param mu Gravitational parameter (default: Earth.mu)
31
+ */
32
+ constructor(public mu: number = Earth.mu) {
33
+ // Nothing to do here.
34
+ }
35
+
36
+ // / Attempt to create a state estimate from three inertial position vectors.
37
+ solve(r1: Vector3D, t1: EpochUTC, r2: Vector3D<Kilometers>, t2: EpochUTC, r3: Vector3D, t3: EpochUTC): J2000 {
38
+ const dt31 = t3.difference(t1);
39
+ const dt32 = t3.difference(t2);
40
+ const dt21 = t2.difference(t1);
41
+ const r1m = r1.magnitude();
42
+ const r2m = r2.magnitude();
43
+ const r3m = r3.magnitude();
44
+ const vA = r1.scale(-dt32 * (1.0 / (dt21 * dt31) + this.mu / (12.0 * r1m * r1m * r1m)));
45
+ const vB = r2.scale((dt32 - dt21) * (1.0 / (dt21 * dt32) + this.mu / (12.0 * r2m * r2m * r2m)));
46
+ const vC = r3.scale(dt21 * (1.0 / (dt32 * dt31) + this.mu / (12.0 * r3m * r3m * r3m)));
47
+ const v2 = vA.add(vB).add(vC) as Vector3D<KilometersPerSecond>;
48
+
49
+ return new J2000(t2, r2, v2);
50
+ }
51
+ }
@@ -0,0 +1,260 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ import { Earth, EpochUTC, J2000, Kilometers, KilometersPerSecond, Radians, Vector3D } from 'ootk-core';
19
+
20
+ // / Lambert two-position and time initial orbit determination.
21
+ export class LambertIOD {
22
+ constructor(public mu: number = Earth.mu) {
23
+ // Nothing to do here.
24
+ }
25
+
26
+ /**
27
+ * Try to guess the short path argument given an [interceptor] and
28
+ * [target] state.
29
+ * @param interceptor Interceptor
30
+ * @param target Target
31
+ * @returns True if the short path should be used, false otherwise.
32
+ */
33
+ static useShortPath(interceptor: J2000, target: J2000): boolean {
34
+ const transN = interceptor.position.cross(target.position);
35
+ const h = interceptor.position.cross(interceptor.velocity);
36
+
37
+ return h.dot(transN) >= 0;
38
+ }
39
+
40
+ private static timeOfFlight_(
41
+ x: number,
42
+ longway: number,
43
+ mrev: number,
44
+ minSma: number,
45
+ speri: number,
46
+ chord: number,
47
+ ): number {
48
+ const a = minSma / (1.0 - x * x);
49
+ let tof: number;
50
+
51
+ if (Math.abs(x) < 1) {
52
+ const beta = longway * 2.0 * Math.asin(Math.sqrt((speri - chord) / (2.0 * a)));
53
+ const alpha = 2.0 * Math.acos(x);
54
+
55
+ tof = a * Math.sqrt(a) * (alpha - Math.sin(alpha) - (beta - Math.sin(beta)) + 2.0 * Math.PI * mrev);
56
+ } else {
57
+ const alpha = 2.0 * Math.acosh(x);
58
+ const beta = longway * 2.0 * Math.asinh(Math.sqrt((speri - chord) / (-2.0 * a)));
59
+
60
+ tof = -a * Math.sqrt(-a) * (Math.sinh(alpha) - alpha - (Math.sinh(beta) - beta));
61
+ }
62
+
63
+ return tof;
64
+ }
65
+
66
+ /**
67
+ * Attempt to solve output velocity [v1] _(km/s)_ given radii [r1] and
68
+ * [r2] _(canonical)_, sweep angle [dth] _(rad)_, time of flight [tau]
69
+ * _(canonical)_, and number of revolutions _(mRev)_.
70
+ * @param r1 Radius 1
71
+ * @param r2 Radius 2
72
+ * @param dth Sweep angle
73
+ * @param tau Time of flight
74
+ * @param mRev Number of revolutions
75
+ * @param v1 Output velocity
76
+ * @returns True if successful, false otherwise.
77
+ */
78
+ static solve(r1: number, r2: number, dth: number, tau: number, mRev: number, v1: Float64Array): boolean {
79
+ const leftBranch = dth < Math.PI;
80
+ let longway = 1;
81
+
82
+ if (dth > Math.PI) {
83
+ longway = -1;
84
+ }
85
+
86
+ const m = Math.abs(mRev);
87
+ const rtof = Math.abs(tau);
88
+ const theta = dth;
89
+
90
+ const chord = Math.sqrt(r1 * r1 + r2 * r2 - 2.0 * r1 * r2 * Math.cos(theta));
91
+ const speri = 0.5 * (r1 + r2 + chord);
92
+
93
+ const minSma = 0.5 * speri;
94
+ const lambda = longway * Math.sqrt(1.0 - chord / speri);
95
+ const logt = Math.log(rtof);
96
+
97
+ let in1: number;
98
+ let in2: number;
99
+ let x1: number;
100
+ let x2: number;
101
+
102
+ if (m === 0) {
103
+ in1 = -0.6523333;
104
+ in2 = 0.6523333;
105
+ x1 = Math.log(1.0 + in1);
106
+ x2 = Math.log(1.0 + in2);
107
+ } else {
108
+ if (!leftBranch) {
109
+ in1 = -0.523334;
110
+ in2 = -0.223334;
111
+ } else {
112
+ in1 = 0.723334;
113
+ in2 = 0.523334;
114
+ }
115
+ x1 = Math.tan((in1 * Math.PI) / 2);
116
+ x2 = Math.tan((in2 * Math.PI) / 2);
117
+ }
118
+ const tof1 = LambertIOD.timeOfFlight_(in1, longway, m, minSma, speri, chord);
119
+ const tof2 = LambertIOD.timeOfFlight_(in2, longway, m, minSma, speri, chord);
120
+
121
+ let y1: number;
122
+ let y2: number;
123
+
124
+ if (m === 0) {
125
+ y1 = Math.log(tof1) - logt;
126
+ y2 = Math.log(tof2) - logt;
127
+ } else {
128
+ y1 = tof1 - rtof;
129
+ y2 = tof2 - rtof;
130
+ }
131
+ let err = 1e20;
132
+ let iterations = 0;
133
+ const tol = 1e-13;
134
+ const maxiter = 50;
135
+ let xnew = 0.0;
136
+
137
+ while (err > tol && iterations < maxiter) {
138
+ xnew = (x1 * y2 - y1 * x2) / (y2 - y1);
139
+ let xt: number;
140
+
141
+ if (m === 0) {
142
+ xt = Math.exp(xnew) - 1.0;
143
+ } else {
144
+ xt = (Math.atan(xnew) * 2.0) / Math.PI;
145
+ }
146
+
147
+ const tof = LambertIOD.timeOfFlight_(xt, longway, m, minSma, speri, chord);
148
+
149
+ let ynew: number;
150
+
151
+ if (m === 0) {
152
+ ynew = Math.log(tof) - logt;
153
+ } else {
154
+ ynew = tof - rtof;
155
+ }
156
+
157
+ x1 = x2;
158
+ x2 = xnew;
159
+ y1 = y2;
160
+ y2 = ynew;
161
+
162
+ err = Math.abs(x1 - xnew);
163
+ ++iterations;
164
+ }
165
+
166
+ if (err > tol) {
167
+ return false;
168
+ }
169
+
170
+ let x: number;
171
+
172
+ if (m === 0) {
173
+ x = Math.exp(xnew) - 1.0;
174
+ } else {
175
+ x = (Math.atan(xnew) * 2.0) / Math.PI;
176
+ }
177
+
178
+ const sma = minSma / (1.0 - x * x);
179
+
180
+ let eta: number;
181
+
182
+ if (x < 1) {
183
+ const alfa = 2.0 * Math.acos(x);
184
+ const beta = longway * 2.0 * Math.asin(Math.sqrt((speri - chord) / (2.0 * sma)));
185
+ const psi = (alfa - beta) / 2.0;
186
+ const sinPsi = Math.sin(psi);
187
+ const etaSq = (2.0 * sma * sinPsi * sinPsi) / speri;
188
+
189
+ eta = Math.sqrt(etaSq);
190
+ } else {
191
+ const gamma = 2.0 * Math.acosh(x);
192
+ const delta = longway * 2.0 * Math.asinh(Math.sqrt((chord - speri) / (2.0 * sma)));
193
+ const psi = (gamma - delta) / 2.0;
194
+ const sinhPsi = Math.sinh(psi);
195
+ const etaSq = (-2.0 * sma * sinhPsi * sinhPsi) / speri;
196
+
197
+ eta = Math.sqrt(etaSq);
198
+ }
199
+
200
+ const vr1 = (1.0 / eta) * Math.sqrt(1.0 / minSma) * ((2.0 * lambda * minSma) / r1 - (lambda + x * eta));
201
+ const vt1 = (1.0 / eta) * Math.sqrt(1.0 / minSma) * Math.sqrt(r2 / r1) * Math.sin(dth / 2.0);
202
+
203
+ v1[0] = vr1;
204
+ v1[1] = vt1;
205
+
206
+ return true;
207
+ }
208
+
209
+ /**
210
+ * Estimate a state vector for inertial position [p1] _(km)_ given the
211
+ * two epoch and positions.
212
+ * @param p1 Position vector 1
213
+ * @param p2 Position vector 2
214
+ * @param t1 Epoch 1
215
+ * @param t2 Epoch 2
216
+ * @param root0 Optional parameters
217
+ * @param root0.posigrade If true, use the positive root (default: true)
218
+ * @param root0.nRev Number of revolutions (default: 0)
219
+ * @returns A [J2000] object with the estimated state vector.
220
+ */
221
+ estimate(
222
+ p1: Vector3D<Kilometers>,
223
+ p2: Vector3D<Kilometers>,
224
+ t1: EpochUTC,
225
+ t2: EpochUTC,
226
+ { posigrade = true, nRev = 0 }: { posigrade?: boolean; nRev?: number } = {},
227
+ ): J2000 | null {
228
+ const r1 = p1.magnitude();
229
+ const r2 = p2.magnitude();
230
+ const tof = t2.difference(t1);
231
+
232
+ const r = Math.max(r1, r2);
233
+ const v = Math.sqrt(this.mu / r);
234
+ const t = r / v;
235
+
236
+ let dth = p1.angle(p2);
237
+
238
+ if (!posigrade) {
239
+ dth = 2 * Math.PI - dth as Radians;
240
+ }
241
+
242
+ const vDep = new Float64Array(2);
243
+ const exitFlag = LambertIOD.solve(r1 / r, r2 / r, dth, tof / t, nRev, vDep);
244
+
245
+ if (exitFlag) {
246
+ const pn = p1.cross(p2);
247
+ const pt = pn.cross(p1);
248
+ let rt = pt.magnitude();
249
+
250
+ if (!posigrade) {
251
+ rt = -rt as Kilometers;
252
+ }
253
+ const vel1 = p1.scale((v * vDep[0]) / r1).add(pt.scale((v * vDep[1]) / rt)) as Vector3D<KilometersPerSecond>;
254
+
255
+ return new J2000(t1, p1, vel1);
256
+ }
257
+
258
+ return null;
259
+ }
260
+ }
@@ -0,0 +1,133 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ import { Earth, EpochUTC, J2000, Kilometers, KilometersPerSecond, RadecTopocentric, Vector3D } from 'ootk-core';
19
+ import { ForceModel } from '../force/ForceModel';
20
+ import { RungeKutta89Propagator } from '../propagator/RungeKutta89Propagator';
21
+ import { ObservationOptical } from './../observation/ObservationOptical';
22
+ import { DownhillSimplex } from './../optimize/DownhillSimplex';
23
+ import { CostFunction } from './../optimize/SimplexEntry';
24
+ import { GoodingIOD } from './GoodingIOD';
25
+
26
+ type SolveOptions = {
27
+ nRev?: number;
28
+ direction?: boolean;
29
+ posSearch?: number;
30
+ velSearch?: number;
31
+ tolerance?: number;
32
+ printIter?: boolean;
33
+ };
34
+
35
+ /**
36
+ * Gooding angles-only initial orbit determination.
37
+ *
38
+ * Used for orbit determination from multiple optical observations.
39
+ */
40
+ export class ModifiedGoodingIOD {
41
+ private observations_: ObservationOptical[];
42
+ private mu_: number;
43
+
44
+ constructor(observations: ObservationOptical[], mu: number = Earth.mu) {
45
+ this.observations_ = observations;
46
+ this.mu_ = mu;
47
+ }
48
+
49
+ private createInitial_(r0: Kilometers, rN: Kilometers, nRev: number, direction: boolean): J2000 {
50
+ const iod = new GoodingIOD(
51
+ this.observations_[0],
52
+ this.observations_[Math.floor(this.observations_.length / 2)],
53
+ this.observations_[this.observations_.length - 1],
54
+ this.mu_,
55
+ );
56
+
57
+ return iod.solve(r0, rN, nRev, direction);
58
+ }
59
+
60
+ private _createErrorFunction(aprioriEpoch: EpochUTC): CostFunction {
61
+ const forceModel = new ForceModel().setGravity(this.mu_);
62
+ const scoreFn = (x: Float64Array): number => {
63
+ const position = new Vector3D(x[0] as Kilometers, x[1] as Kilometers, x[2] as Kilometers);
64
+ const velocity = new Vector3D(
65
+ x[3] as KilometersPerSecond,
66
+ x[4] as KilometersPerSecond,
67
+ x[5] as KilometersPerSecond,
68
+ );
69
+ const state = new J2000(aprioriEpoch, position, velocity);
70
+ const propagator = new RungeKutta89Propagator(state, forceModel);
71
+ let total = 0;
72
+
73
+ for (const oC of this.observations_) {
74
+ const sC = propagator.propagate(oC.epoch);
75
+ const pC = oC.site;
76
+ const expected = oC.observation.lineOfSight();
77
+ const actual = RadecTopocentric.fromStateVector(sC, pC).lineOfSight();
78
+ const error = expected.angle(actual);
79
+
80
+ total += error;
81
+ }
82
+
83
+ return total;
84
+ };
85
+
86
+ return scoreFn;
87
+ }
88
+
89
+ solve(
90
+ r0: Kilometers,
91
+ rN: Kilometers,
92
+ {
93
+ nRev = 0,
94
+ direction = true,
95
+ posSearch = 10.0,
96
+ velSearch = 0.1,
97
+ tolerance = 1e-6,
98
+ printIter = false,
99
+ }: SolveOptions,
100
+ ): J2000 {
101
+ if (this.observations_.length < 3) {
102
+ throw new Error('At least 3 observations required for Gooding IOD.');
103
+ }
104
+ const init = this.createInitial_(r0, rN, nRev, direction);
105
+ const guess = Float64Array.from([...init.position.toArray(), ...init.velocity.toArray()]);
106
+ const solveFn = this._createErrorFunction(init.epoch);
107
+ const simplex = [
108
+ Float64Array.from(guess),
109
+ Float64Array.from([guess[0] + posSearch, guess[1], guess[2], guess[3], guess[4], guess[5]]),
110
+ Float64Array.from([guess[0], guess[1] + posSearch, guess[2], guess[3], guess[4], guess[5]]),
111
+ Float64Array.from([guess[0], guess[1], guess[2] + posSearch, guess[3], guess[4], guess[5]]),
112
+ Float64Array.from([guess[0], guess[1], guess[2], guess[3] + velSearch, guess[4], guess[5]]),
113
+ Float64Array.from([guess[0], guess[1], guess[2], guess[3], guess[4] + velSearch, guess[5]]),
114
+ Float64Array.from([guess[0], guess[1], guess[2], guess[3], guess[4], guess[5] + velSearch]),
115
+ ];
116
+ const result = DownhillSimplex.solveSimplex(solveFn, simplex, {
117
+ adaptive: true,
118
+ xTolerance: tolerance,
119
+ fTolerance: tolerance,
120
+ printIter,
121
+ });
122
+
123
+ return new J2000(
124
+ init.epoch,
125
+ new Vector3D(result[0] as Kilometers, result[1] as Kilometers, result[2] as Kilometers),
126
+ new Vector3D(
127
+ result[3] as KilometersPerSecond,
128
+ result[4] as KilometersPerSecond,
129
+ result[5] as KilometersPerSecond,
130
+ ),
131
+ );
132
+ }
133
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ /* eslint-disable class-methods-use-this */
19
+ import { RungeKuttaAdaptive } from './RungeKuttaAdaptive';
20
+
21
+ export class DormandPrince54Propagator extends RungeKuttaAdaptive {
22
+ private _a: Float64Array = Float64Array.from([0.0, 1.0 / 5.0, 3.0 / 10.0, 4.0 / 5.0, 8.0 / 9.0, 1.0, 1.0]);
23
+
24
+ private _b: Float64Array[] = [
25
+ new Float64Array(),
26
+ Float64Array.from([1.0 / 5.0]),
27
+ Float64Array.from([3.0 / 40.0, 9.0 / 40.0]),
28
+ Float64Array.from([44.0 / 45.0, -56.0 / 15.0, 32.0 / 9.0]),
29
+ Float64Array.from([19372.0 / 6561.0, -25360.0 / 2187.0, 64448.0 / 6561.0, -212.0 / 729.0]),
30
+ Float64Array.from([9017.0 / 3168.0, -355.0 / 33.0, 46732.0 / 5247.0, 49.0 / 176.0, -5103.0 / 18656.0]),
31
+ Float64Array.from([35.0 / 384.0, 0.0, 500.0 / 1113.0, 125.0 / 192.0, -2187.0 / 6784.0, 11.0 / 84.0]),
32
+ ];
33
+
34
+ private _ch: Float64Array = Float64Array.from([
35
+ 35.0 / 384.0,
36
+ 0.0,
37
+ 500.0 / 1113.0,
38
+ 125.0 / 192.0,
39
+ -2187.0 / 6784.0,
40
+ 11.0 / 84.0,
41
+ 0.0,
42
+ ]);
43
+
44
+ private _c: Float64Array = Float64Array.from([
45
+ 5179.0 / 57600.0,
46
+ 0.0,
47
+ 7571.0 / 16695.0,
48
+ 393.0 / 640.0,
49
+ -92097.0 / 339200.0,
50
+ 187.0 / 2100.0,
51
+ 1.0 / 40.0,
52
+ ]);
53
+
54
+ get a(): Float64Array {
55
+ return this._a;
56
+ }
57
+
58
+ get b(): Float64Array[] {
59
+ return this._b;
60
+ }
61
+
62
+ get ch(): Float64Array {
63
+ return this._ch;
64
+ }
65
+
66
+ get c(): Float64Array {
67
+ return this._c;
68
+ }
69
+
70
+ get order(): number {
71
+ return 5;
72
+ }
73
+ }
@@ -0,0 +1,102 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ import { ClassicalElements, EpochUTC, J2000, Seconds } from 'ootk-core';
19
+ import { Thrust } from '../force/Thrust';
20
+ import { VerletBlendInterpolator } from '../interpolator/VerletBlendInterpolator';
21
+ import { Propagator } from './Propagator';
22
+
23
+ // / Kepler analytical two-body propagator.
24
+ export class KeplerPropagator extends Propagator {
25
+ private _initElements: ClassicalElements;
26
+ private _elements: ClassicalElements;
27
+ private _cacheState: J2000;
28
+ private _checkpoints: J2000[];
29
+
30
+ constructor(initElements: ClassicalElements) {
31
+ super();
32
+ this._initElements = initElements;
33
+ this._elements = initElements;
34
+ this._cacheState = J2000.fromClassicalElements(initElements);
35
+ this._checkpoints = [];
36
+ }
37
+
38
+ get state(): J2000 {
39
+ return this._cacheState;
40
+ }
41
+
42
+ propagate(epoch: EpochUTC): J2000 {
43
+ this._cacheState = J2000.fromClassicalElements(this._elements.propagate(epoch));
44
+
45
+ return this._cacheState;
46
+ }
47
+
48
+ reset(): void {
49
+ this._elements = this._initElements;
50
+ this._cacheState = J2000.fromClassicalElements(this._elements);
51
+ }
52
+
53
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
54
+ maneuver(maneuver: Thrust, interval = 60): J2000[] {
55
+ this._cacheState = maneuver.apply(this.propagate(maneuver.center));
56
+ this._elements = this._cacheState.toClassicalElements();
57
+
58
+ return [this._cacheState];
59
+ }
60
+
61
+ ephemerisManeuver(start: EpochUTC, finish: EpochUTC, maneuvers: Thrust[], interval = 60.0): VerletBlendInterpolator {
62
+ const tMvr = maneuvers.slice(0).filter((mvr) => mvr.center >= start || mvr.center <= finish);
63
+ const ephemeris: J2000[] = [];
64
+
65
+ if (tMvr[0].start > start) {
66
+ ephemeris.push(this.propagate(start));
67
+ }
68
+ for (const mvr of tMvr) {
69
+ while (this._cacheState.epoch < mvr.center) {
70
+ const step = Math.min(mvr.center.difference(this._cacheState.epoch), interval) as Seconds;
71
+
72
+ this.propagate(this._cacheState.epoch.roll(step));
73
+ if (this._cacheState.epoch.posix !== mvr.center.posix) {
74
+ ephemeris.push(this._cacheState);
75
+ }
76
+ }
77
+ ephemeris.push(...this.maneuver(mvr, interval));
78
+ }
79
+ while (this._cacheState.epoch < finish) {
80
+ const step = Math.min(finish.difference(this._cacheState.epoch), interval) as Seconds;
81
+
82
+ this.propagate(this._cacheState.epoch.roll(step));
83
+ ephemeris.push(this._cacheState);
84
+ }
85
+
86
+ return new VerletBlendInterpolator(ephemeris);
87
+ }
88
+
89
+ checkpoint(): number {
90
+ this._checkpoints.push(this._cacheState);
91
+
92
+ return this._checkpoints.length - 1;
93
+ }
94
+
95
+ clearCheckpoints(): void {
96
+ this._checkpoints = [];
97
+ }
98
+
99
+ restore(index: number): void {
100
+ this._cacheState = this._checkpoints[index];
101
+ }
102
+ }