ootk 3.0.0 → 4.0.0-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 (261) hide show
  1. package/.eslintrc.json +10 -10
  2. package/CHANGELOG.md +122 -0
  3. package/README.md +27 -40
  4. package/lib/coordinate/Hill.d.ts +50 -0
  5. package/lib/coordinate/Hill.js +214 -0
  6. package/lib/coordinate/Hill.js.map +1 -0
  7. package/lib/coordinate/index.d.ts +1 -0
  8. package/lib/coordinate/index.js +2 -0
  9. package/lib/coordinate/index.js.map +1 -0
  10. package/lib/covariance/CovarianceSample.d.ts +44 -0
  11. package/lib/covariance/CovarianceSample.js +146 -0
  12. package/lib/covariance/CovarianceSample.js.map +1 -0
  13. package/lib/covariance/StateCovariance.d.ts +41 -0
  14. package/lib/covariance/StateCovariance.js +62 -0
  15. package/lib/covariance/StateCovariance.js.map +1 -0
  16. package/lib/force/AtmosphericDrag.d.ts +32 -0
  17. package/lib/force/AtmosphericDrag.js +66 -0
  18. package/lib/force/AtmosphericDrag.js.map +1 -0
  19. package/lib/force/EarthGravity.d.ts +28 -0
  20. package/lib/force/EarthGravity.js +115 -0
  21. package/lib/force/EarthGravity.js.map +1 -0
  22. package/{dist/ootk.d.ts → lib/force/Force.d.ts} +10 -10
  23. package/lib/force/Force.js +30 -0
  24. package/lib/force/Force.js.map +1 -0
  25. package/lib/force/ForceModel.d.ts +38 -0
  26. package/lib/force/ForceModel.js +71 -0
  27. package/lib/force/ForceModel.js.map +1 -0
  28. package/lib/force/Gravity.d.ts +41 -0
  29. package/lib/force/Gravity.js +48 -0
  30. package/lib/force/Gravity.js.map +1 -0
  31. package/lib/force/SolarRadiationPressure.d.ts +27 -0
  32. package/lib/force/SolarRadiationPressure.js +42 -0
  33. package/lib/force/SolarRadiationPressure.js.map +1 -0
  34. package/lib/force/ThirdBodyGravity.d.ts +27 -0
  35. package/lib/force/ThirdBodyGravity.js +56 -0
  36. package/lib/force/ThirdBodyGravity.js.map +1 -0
  37. package/lib/force/Thrust.d.ts +35 -0
  38. package/lib/force/Thrust.js +53 -0
  39. package/lib/force/Thrust.js.map +1 -0
  40. package/lib/interpolator/ChebyshevCoefficients.d.ts +54 -0
  41. package/lib/interpolator/ChebyshevCoefficients.js +90 -0
  42. package/lib/interpolator/ChebyshevCoefficients.js.map +1 -0
  43. package/lib/interpolator/ChebyshevInterpolator.d.ts +39 -0
  44. package/lib/interpolator/ChebyshevInterpolator.js +71 -0
  45. package/lib/interpolator/ChebyshevInterpolator.js.map +1 -0
  46. package/lib/interpolator/CubicSpline.d.ts +36 -0
  47. package/lib/interpolator/CubicSpline.js +64 -0
  48. package/lib/interpolator/CubicSpline.js.map +1 -0
  49. package/lib/interpolator/CubicSplineInterpolator.d.ts +37 -0
  50. package/lib/interpolator/CubicSplineInterpolator.js +78 -0
  51. package/lib/interpolator/CubicSplineInterpolator.js.map +1 -0
  52. package/lib/interpolator/FieldInterpolator.d.ts +26 -0
  53. package/lib/interpolator/FieldInterpolator.js +31 -0
  54. package/lib/interpolator/FieldInterpolator.js.map +1 -0
  55. package/lib/interpolator/Interpolator.d.ts +23 -0
  56. package/lib/interpolator/Interpolator.js +48 -0
  57. package/lib/interpolator/Interpolator.js.map +1 -0
  58. package/lib/interpolator/LagrangeInterpolator.d.ts +42 -0
  59. package/lib/interpolator/LagrangeInterpolator.js +156 -0
  60. package/lib/interpolator/LagrangeInterpolator.js.map +1 -0
  61. package/lib/interpolator/StateInterpolator.d.ts +29 -0
  62. package/lib/interpolator/StateInterpolator.js +37 -0
  63. package/lib/interpolator/StateInterpolator.js.map +1 -0
  64. package/lib/interpolator/VerletBlendInterpolator.d.ts +44 -0
  65. package/lib/interpolator/VerletBlendInterpolator.js +115 -0
  66. package/lib/interpolator/VerletBlendInterpolator.js.map +1 -0
  67. package/lib/maneuver/TwoBurnOrbitTransfer.d.ts +43 -0
  68. package/lib/maneuver/TwoBurnOrbitTransfer.js +62 -0
  69. package/lib/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
  70. package/lib/maneuver/Waypoint.d.ts +66 -0
  71. package/lib/maneuver/Waypoint.js +152 -0
  72. package/lib/maneuver/Waypoint.js.map +1 -0
  73. package/lib/objects/DetailedSatellite.d.ts +94 -0
  74. package/lib/objects/DetailedSatellite.js +140 -0
  75. package/lib/objects/DetailedSatellite.js.map +1 -0
  76. package/lib/objects/DetailedSensor.d.ts +43 -0
  77. package/lib/objects/DetailedSensor.js +45 -0
  78. package/lib/objects/DetailedSensor.js.map +1 -0
  79. package/{dist/objects/space-object.d.ts → lib/objects/LandObject.d.ts} +19 -21
  80. package/lib/objects/LandObject.js +28 -0
  81. package/lib/objects/LandObject.js.map +1 -0
  82. package/lib/objects/Marker.d.ts +21 -0
  83. package/lib/objects/Marker.js +25 -0
  84. package/lib/objects/Marker.js.map +1 -0
  85. package/lib/objects/index.d.ts +5 -4
  86. package/lib/objects/index.js +5 -4
  87. package/lib/objects/index.js.map +1 -1
  88. package/lib/observation/Observation.d.ts +51 -0
  89. package/lib/observation/Observation.js +71 -0
  90. package/lib/observation/Observation.js.map +1 -0
  91. package/lib/observation/ObservationOptical.d.ts +47 -0
  92. package/lib/observation/ObservationOptical.js +101 -0
  93. package/lib/observation/ObservationOptical.js.map +1 -0
  94. package/lib/observation/ObservationRadar.d.ts +43 -0
  95. package/lib/observation/ObservationRadar.js +90 -0
  96. package/lib/observation/ObservationRadar.js.map +1 -0
  97. package/lib/observation/ObservationUtils.d.ts +21 -0
  98. package/lib/observation/ObservationUtils.js +33 -0
  99. package/lib/observation/ObservationUtils.js.map +1 -0
  100. package/lib/observation/PropagatorPairs.d.ts +31 -0
  101. package/lib/observation/PropagatorPairs.js +40 -0
  102. package/lib/observation/PropagatorPairs.js.map +1 -0
  103. package/lib/ootk.d.ts +10 -8
  104. package/lib/ootk.js +10 -8
  105. package/lib/ootk.js.map +1 -1
  106. package/lib/operations/BoxMuller.d.ts +41 -0
  107. package/lib/operations/BoxMuller.js +66 -0
  108. package/lib/operations/BoxMuller.js.map +1 -0
  109. package/lib/operations/EulerAngles.d.ts +50 -0
  110. package/lib/operations/EulerAngles.js +111 -0
  111. package/lib/operations/EulerAngles.js.map +1 -0
  112. package/lib/operations/Quaternion.d.ts +57 -0
  113. package/lib/operations/Quaternion.js +164 -0
  114. package/lib/operations/Quaternion.js.map +1 -0
  115. package/lib/operations/RandomGaussianSource.d.ts +25 -0
  116. package/lib/operations/RandomGaussianSource.js +43 -0
  117. package/lib/operations/RandomGaussianSource.js.map +1 -0
  118. package/lib/operations/index.d.ts +4 -0
  119. package/lib/operations/index.js +5 -0
  120. package/lib/operations/index.js.map +1 -0
  121. package/lib/optimize/ChebyshevCompressor.d.ts +31 -0
  122. package/lib/optimize/ChebyshevCompressor.js +80 -0
  123. package/lib/optimize/ChebyshevCompressor.js.map +1 -0
  124. package/lib/optimize/DownhillSimplex.d.ts +50 -0
  125. package/lib/optimize/DownhillSimplex.js +168 -0
  126. package/lib/optimize/DownhillSimplex.js.map +1 -0
  127. package/lib/optimize/GoldenSection.d.ts +33 -0
  128. package/lib/optimize/GoldenSection.js +49 -0
  129. package/lib/optimize/GoldenSection.js.map +1 -0
  130. package/lib/optimize/PolynomialRegression.d.ts +37 -0
  131. package/lib/optimize/PolynomialRegression.js +66 -0
  132. package/lib/optimize/PolynomialRegression.js.map +1 -0
  133. package/lib/optimize/PolynomicalRegressionResult.d.ts +28 -0
  134. package/lib/optimize/PolynomicalRegressionResult.js +32 -0
  135. package/lib/optimize/PolynomicalRegressionResult.js.map +1 -0
  136. package/lib/optimize/SimpleLinearRegression.d.ts +41 -0
  137. package/lib/optimize/SimpleLinearRegression.js +107 -0
  138. package/lib/optimize/SimpleLinearRegression.js.map +1 -0
  139. package/lib/optimize/SimplexEntry.d.ts +33 -0
  140. package/lib/optimize/SimplexEntry.js +39 -0
  141. package/lib/optimize/SimplexEntry.js.map +1 -0
  142. package/lib/orbit_determination/BatchLeastSquaresOD.d.ts +54 -0
  143. package/lib/orbit_determination/BatchLeastSquaresOD.js +118 -0
  144. package/lib/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
  145. package/lib/orbit_determination/BatchLeastSquaresResult.d.ts +29 -0
  146. package/lib/orbit_determination/BatchLeastSquaresResult.js +31 -0
  147. package/lib/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
  148. package/lib/orbit_determination/GibbsIOD.d.ts +33 -0
  149. package/lib/orbit_determination/GibbsIOD.js +70 -0
  150. package/lib/orbit_determination/GibbsIOD.js.map +1 -0
  151. package/lib/orbit_determination/GoodingIOD.d.ts +52 -0
  152. package/lib/orbit_determination/GoodingIOD.js +244 -0
  153. package/lib/orbit_determination/GoodingIOD.js.map +1 -0
  154. package/lib/{objects/space-object.d.ts → orbit_determination/HerrickGibbsIOD.d.ts} +17 -22
  155. package/lib/orbit_determination/HerrickGibbsIOD.js +49 -0
  156. package/lib/orbit_determination/HerrickGibbsIOD.js.map +1 -0
  157. package/lib/orbit_determination/LambertIOD.d.ts +46 -0
  158. package/lib/orbit_determination/LambertIOD.js +199 -0
  159. package/lib/orbit_determination/LambertIOD.js.map +1 -0
  160. package/lib/orbit_determination/ModifiedGoodingIOD.d.ts +41 -0
  161. package/lib/orbit_determination/ModifiedGoodingIOD.js +82 -0
  162. package/lib/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
  163. package/lib/propagator/DormandPrince54Propagator.d.ts +29 -0
  164. package/lib/propagator/DormandPrince54Propagator.js +68 -0
  165. package/lib/propagator/DormandPrince54Propagator.js.map +1 -0
  166. package/lib/propagator/KeplerPropagator.d.ts +36 -0
  167. package/lib/propagator/KeplerPropagator.js +81 -0
  168. package/lib/propagator/KeplerPropagator.js.map +1 -0
  169. package/lib/propagator/Propagator.d.ts +35 -0
  170. package/lib/propagator/Propagator.js +163 -0
  171. package/lib/propagator/Propagator.js.map +1 -0
  172. package/lib/propagator/RkCheckpoint.d.ts +23 -0
  173. package/lib/propagator/RkCheckpoint.js +26 -0
  174. package/lib/propagator/RkCheckpoint.js.map +1 -0
  175. package/lib/propagator/RkResult.d.ts +24 -0
  176. package/lib/propagator/RkResult.js +28 -0
  177. package/lib/propagator/RkResult.js.map +1 -0
  178. package/lib/propagator/RungeKutta4Propagator.d.ts +46 -0
  179. package/lib/propagator/RungeKutta4Propagator.js +132 -0
  180. package/lib/propagator/RungeKutta4Propagator.js.map +1 -0
  181. package/lib/propagator/RungeKutta89Propagator.d.ts +29 -0
  182. package/lib/propagator/RungeKutta89Propagator.js +130 -0
  183. package/lib/propagator/RungeKutta89Propagator.js.map +1 -0
  184. package/lib/propagator/RungeKuttaAdaptive.d.ts +52 -0
  185. package/lib/propagator/RungeKuttaAdaptive.js +152 -0
  186. package/lib/propagator/RungeKuttaAdaptive.js.map +1 -0
  187. package/lib/propagator/Sgp4Propagator.d.ts +35 -0
  188. package/lib/propagator/Sgp4Propagator.js +55 -0
  189. package/lib/propagator/Sgp4Propagator.js.map +1 -0
  190. package/lib/smoothing/ExponentialSmoothing.d.ts +24 -0
  191. package/lib/smoothing/ExponentialSmoothing.js +82 -0
  192. package/lib/smoothing/ExponentialSmoothing.js.map +1 -0
  193. package/lib/types/types.d.ts +65 -584
  194. package/lib/types/types.js +21 -33
  195. package/lib/types/types.js.map +1 -1
  196. package/package.json +16 -14
  197. package/.prettierrc +0 -17
  198. package/babel.config.js +0 -16
  199. package/codecov.yml +0 -21
  200. package/dist/objects/base-object.d.ts +0 -40
  201. package/dist/objects/detailed-sat.d.ts +0 -66
  202. package/dist/objects/index.d.ts +0 -4
  203. package/dist/objects/sat.d.ts +0 -92
  204. package/dist/objects/sensor.d.ts +0 -93
  205. package/dist/objects/star.d.ts +0 -46
  206. package/dist/ootk.js +0 -2
  207. package/dist/ootk.js.LICENSE.txt +0 -77
  208. package/dist/sgp4/sgp4.d.ts +0 -82
  209. package/dist/tle/tle-format-data.d.ts +0 -6
  210. package/dist/tle/tle.d.ts +0 -375
  211. package/dist/transforms/transforms.d.ts +0 -94
  212. package/dist/types/types.d.ts +0 -605
  213. package/dist/utils/constants.d.ts +0 -34
  214. package/dist/utils/moon-math.d.ts +0 -113
  215. package/dist/utils/sun-math.d.ts +0 -230
  216. package/dist/utils/utils.d.ts +0 -39
  217. package/lib/objects/base-object.d.ts +0 -40
  218. package/lib/objects/base-object.js +0 -79
  219. package/lib/objects/base-object.js.map +0 -1
  220. package/lib/objects/detailed-sat.d.ts +0 -66
  221. package/lib/objects/detailed-sat.js +0 -149
  222. package/lib/objects/detailed-sat.js.map +0 -1
  223. package/lib/objects/sat.d.ts +0 -92
  224. package/lib/objects/sat.js +0 -188
  225. package/lib/objects/sat.js.map +0 -1
  226. package/lib/objects/sensor.d.ts +0 -93
  227. package/lib/objects/sensor.js +0 -273
  228. package/lib/objects/sensor.js.map +0 -1
  229. package/lib/objects/space-object.js +0 -60
  230. package/lib/objects/space-object.js.map +0 -1
  231. package/lib/objects/star.d.ts +0 -46
  232. package/lib/objects/star.js +0 -91
  233. package/lib/objects/star.js.map +0 -1
  234. package/lib/sgp4/sgp4.d.ts +0 -82
  235. package/lib/sgp4/sgp4.js +0 -3262
  236. package/lib/sgp4/sgp4.js.map +0 -1
  237. package/lib/tle/tle-format-data.d.ts +0 -6
  238. package/lib/tle/tle-format-data.js +0 -10
  239. package/lib/tle/tle-format-data.js.map +0 -1
  240. package/lib/tle/tle.d.ts +0 -375
  241. package/lib/tle/tle.js +0 -611
  242. package/lib/tle/tle.js.map +0 -1
  243. package/lib/transforms/transforms.d.ts +0 -94
  244. package/lib/transforms/transforms.js +0 -308
  245. package/lib/transforms/transforms.js.map +0 -1
  246. package/lib/utils/constants.d.ts +0 -34
  247. package/lib/utils/constants.js +0 -35
  248. package/lib/utils/constants.js.map +0 -1
  249. package/lib/utils/moon-math.d.ts +0 -113
  250. package/lib/utils/moon-math.js +0 -387
  251. package/lib/utils/moon-math.js.map +0 -1
  252. package/lib/utils/sun-math.d.ts +0 -230
  253. package/lib/utils/sun-math.js +0 -422
  254. package/lib/utils/sun-math.js.map +0 -1
  255. package/lib/utils/utils.d.ts +0 -39
  256. package/lib/utils/utils.js +0 -102
  257. package/lib/utils/utils.js.map +0 -1
  258. package/sandbox.html +0 -8
  259. package/tsconfig.base.json +0 -31
  260. package/tsconfig.build.json +0 -14
  261. /package/{LICENSE.MD → LICENSE.md} +0 -0
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ *
4
+ * @license AGPL-3.0-or-later
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
6
+ *
7
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
8
+ * terms of the GNU Affero General Public License as published by the Free Software
9
+ * Foundation, either version 3 of the License, or (at your option) any later version.
10
+ *
11
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ * See the GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along with
16
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { Epoch, EpochUTC, J2000 } from 'ootk-core';
19
+ import { ForceModel } from '../force/ForceModel';
20
+ import { Thrust } from '../force/Thrust';
21
+ import { StateCovariance } from './StateCovariance';
22
+ export declare class CovarianceSample {
23
+ private _origin;
24
+ private _samples;
25
+ private _pts;
26
+ /**
27
+ * Create a new [CovarianceSample] object from an inertial state, covariance
28
+ * and optional force models for the origin state and samples.
29
+ *
30
+ * Two-body physics will be used if a force model is not provided.
31
+ * @param state
32
+ * @param covariance
33
+ * @param originForceModel
34
+ * @param sampleForceModel
35
+ */
36
+ constructor(state: J2000, covariance: StateCovariance, originForceModel?: ForceModel, sampleForceModel?: ForceModel);
37
+ get epoch(): Epoch;
38
+ get state(): J2000;
39
+ private _rebuildCovariance;
40
+ propagate(epoch: EpochUTC): void;
41
+ maneuver(maneuver: Thrust): void;
42
+ desampleJ2000(): StateCovariance;
43
+ desampleRIC(): StateCovariance;
44
+ }
@@ -0,0 +1,146 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ *
4
+ * @license AGPL-3.0-or-later
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
6
+ *
7
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
8
+ * terms of the GNU Affero General Public License as published by the Free Software
9
+ * Foundation, either version 3 of the License, or (at your option) any later version.
10
+ *
11
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ * See the GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along with
16
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ /* eslint-disable class-methods-use-this */
19
+ import { J2000, Matrix, RelativeState, RIC, Vector, Vector3D } from 'ootk-core';
20
+ import { ForceModel } from '../force/ForceModel';
21
+ import { RungeKutta89Propagator } from '../propagator/RungeKutta89Propagator';
22
+ import { CovarianceFrame, StateCovariance } from './StateCovariance';
23
+ // / Sigma point covariance sample.
24
+ export class CovarianceSample {
25
+ /**
26
+ * Create a new [CovarianceSample] object from an inertial state, covariance
27
+ * and optional force models for the origin state and samples.
28
+ *
29
+ * Two-body physics will be used if a force model is not provided.
30
+ * @param state
31
+ * @param covariance
32
+ * @param originForceModel
33
+ * @param sampleForceModel
34
+ */
35
+ constructor(state, covariance, originForceModel, sampleForceModel) {
36
+ this._samples = [];
37
+ this._pts = Matrix.zero(6, 12);
38
+ originForceModel ??= new ForceModel().setGravity();
39
+ sampleForceModel ??= new ForceModel().setGravity();
40
+ this._origin = new RungeKutta89Propagator(state, originForceModel);
41
+ const s = covariance.matrix.cholesky();
42
+ const sqrt6 = Math.sqrt(6.0);
43
+ for (let i = 0; i < 6; i++) {
44
+ for (let j = 0; j < 6; j++) {
45
+ s[i][j] *= sqrt6;
46
+ }
47
+ }
48
+ // 6 x 12 matrix
49
+ const sigmapts = Matrix.zero(6, 12);
50
+ for (let i = 0; i < 6; i++) {
51
+ const jj = (i - 1) * 2 + 2;
52
+ for (let j = 0; j < 3; j++) {
53
+ sigmapts[j][jj] = s[j][i];
54
+ sigmapts[j + 3][jj] = s[j + 3][i];
55
+ sigmapts[j][jj + 1] = -s[j][i];
56
+ sigmapts[j + 3][jj + 1] = -s[j + 3][i];
57
+ }
58
+ }
59
+ for (let i = 0; i < 12; i++) {
60
+ const sampleR = new Vector3D(sigmapts[0][i], sigmapts[1][i], sigmapts[2][i]);
61
+ const sampleV = new Vector3D(sigmapts[3][i], sigmapts[4][i], sigmapts[5][i]);
62
+ if (covariance.frame === CovarianceFrame.ECI) {
63
+ const sample = new J2000(state.epoch, state.position.add(sampleR), state.velocity.add(sampleV));
64
+ this._samples.push(new RungeKutta89Propagator(sample, sampleForceModel));
65
+ }
66
+ else if (covariance.frame === CovarianceFrame.RIC) {
67
+ const sample = new RIC(sampleR, sampleV).toJ2000(state);
68
+ this._samples.push(new RungeKutta89Propagator(sample, sampleForceModel));
69
+ }
70
+ }
71
+ }
72
+ // / Current covariance sample epoch.
73
+ get epoch() {
74
+ return this._origin.state.epoch;
75
+ }
76
+ // / Current covariance sample origin state.
77
+ get state() {
78
+ return this._origin.state;
79
+ }
80
+ // / Rebuild covariance from sigma points.
81
+ _rebuildCovariance(pts) {
82
+ const c = 1.0 / 12.0;
83
+ const yu = new Vector([0, 0, 0, 0, 0, 0]);
84
+ const y = Matrix.zero(6, 12);
85
+ for (let i = 0; i < 12; i++) {
86
+ for (let j = 0; j < 6; j++) {
87
+ yu[j] += pts[j][i];
88
+ }
89
+ }
90
+ for (let j = 0; j < 6; j++) {
91
+ yu[j] *= c;
92
+ }
93
+ for (let i = 0; i < 12; i++) {
94
+ for (let j = 0; j < 6; j++) {
95
+ y[j][i] = pts[j][i] - yu[j];
96
+ }
97
+ }
98
+ const yt = y.transpose();
99
+ const tmp = y.multiply(yt);
100
+ return tmp.scale(c);
101
+ }
102
+ // / Propagate covariance to a new epoch.
103
+ propagate(epoch) {
104
+ this._origin.propagate(epoch);
105
+ for (const sample of this._samples) {
106
+ sample.propagate(epoch);
107
+ }
108
+ }
109
+ // / Apply a maneuver to this covariance.
110
+ maneuver(maneuver) {
111
+ this._origin.maneuver(maneuver);
112
+ for (const sample of this._samples) {
113
+ sample.maneuver(maneuver);
114
+ }
115
+ }
116
+ // / Desample covariance in J2000 frame.
117
+ desampleJ2000() {
118
+ for (let i = 0; i < 12; i++) {
119
+ const state = this._samples[i].state;
120
+ this._pts[0][i] = state.position[0];
121
+ this._pts[1][i] = state.position[1];
122
+ this._pts[2][i] = state.position[2];
123
+ this._pts[3][i] = state.velocity[0];
124
+ this._pts[4][i] = state.velocity[1];
125
+ this._pts[5][i] = state.velocity[2];
126
+ }
127
+ const matrix = this._rebuildCovariance(this._pts);
128
+ return new StateCovariance(matrix, CovarianceFrame.ECI);
129
+ }
130
+ // / Desample covariance in RIC frame.
131
+ desampleRIC() {
132
+ const rot = RelativeState.createMatrix(this._origin.state.position, this._origin.state.velocity);
133
+ for (let i = 0; i < 12; i++) {
134
+ const state = RIC.fromJ2000Matrix(this._samples[i].state, this._origin.state, rot);
135
+ this._pts[0][i] = state.position[0];
136
+ this._pts[1][i] = state.position[1];
137
+ this._pts[2][i] = state.position[2];
138
+ this._pts[3][i] = state.velocity[0];
139
+ this._pts[4][i] = state.velocity[1];
140
+ this._pts[5][i] = state.velocity[2];
141
+ }
142
+ const matrix = this._rebuildCovariance(this._pts);
143
+ return new StateCovariance(matrix, CovarianceFrame.RIC);
144
+ }
145
+ }
146
+ //# sourceMappingURL=CovarianceSample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CovarianceSample.js","sourceRoot":"","sources":["../../src/covariance/CovarianceSample.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,2CAA2C;AAC3C,OAAO,EAAmB,KAAK,EAAE,MAAM,EAAE,aA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CAAC,EAAE,EAAE;YAC3B,MAAM,KAAK,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAEnF,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;SACrC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElD,OAAO,IAAI,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;CACF"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ *
4
+ * @license AGPL-3.0-or-later
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
6
+ *
7
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
8
+ * terms of the GNU Affero General Public License as published by the Free Software
9
+ * Foundation, either version 3 of the License, or (at your option) any later version.
10
+ *
11
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ * See the GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along with
16
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { Matrix, Vector } from 'ootk-core';
19
+ /** Covariance Frame */
20
+ export declare enum CovarianceFrame {
21
+ /** Earth-centered inertial */
22
+ ECI = "eci",
23
+ /** Radial-Intrack-Crosstrack */
24
+ RIC = "ric"
25
+ }
26
+ export declare class StateCovariance {
27
+ matrix: Matrix;
28
+ frame: CovarianceFrame;
29
+ /**
30
+ * Create a new [StateCovariance] object given its covariance [matrix] and
31
+ * [CovarianceFrame].
32
+ */
33
+ constructor(matrix: Matrix, frame: CovarianceFrame);
34
+ static fromSigmas(sigmas: number[], frame: CovarianceFrame): StateCovariance;
35
+ /**
36
+ * Calculates the standard deviations (sigmas) of each element in the covariance matrix.
37
+ *
38
+ * @returns A vector containing the standard deviations of each element in the covariance matrix.
39
+ */
40
+ sigmas(): Vector;
41
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ *
4
+ * @license AGPL-3.0-or-later
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
6
+ *
7
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
8
+ * terms of the GNU Affero General Public License as published by the Free Software
9
+ * Foundation, either version 3 of the License, or (at your option) any later version.
10
+ *
11
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ * See the GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along with
16
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { Matrix, Vector } from 'ootk-core';
19
+ /** Covariance Frame */
20
+ export var CovarianceFrame;
21
+ (function (CovarianceFrame) {
22
+ /** Earth-centered inertial */
23
+ CovarianceFrame["ECI"] = "eci";
24
+ /** Radial-Intrack-Crosstrack */
25
+ CovarianceFrame["RIC"] = "ric";
26
+ })(CovarianceFrame || (CovarianceFrame = {}));
27
+ // / State covariance.
28
+ export class StateCovariance {
29
+ /**
30
+ * Create a new [StateCovariance] object given its covariance [matrix] and
31
+ * [CovarianceFrame].
32
+ */
33
+ constructor(matrix, frame) {
34
+ this.matrix = matrix;
35
+ this.frame = frame;
36
+ // Nothing to do here.
37
+ }
38
+ // / Create a new [StateCovariance] object from 1-sigma values.
39
+ static fromSigmas(sigmas, frame) {
40
+ const n = sigmas.length;
41
+ const output = Matrix.zero(n, n);
42
+ for (let i = 0; i < n; i++) {
43
+ output[i][i] = Math.max(sigmas[i] * sigmas[i], 1e-32);
44
+ }
45
+ return new StateCovariance(output, frame);
46
+ }
47
+ /**
48
+ * Calculates the standard deviations (sigmas) of each element in the covariance matrix.
49
+ *
50
+ * @returns A vector containing the standard deviations of each element in the covariance matrix.
51
+ */
52
+ sigmas() {
53
+ const c = this.matrix.columns;
54
+ const result = new Float64Array(c);
55
+ for (let i = 0; i < c; i++) {
56
+ const variance = this.matrix[i][i];
57
+ result[i] = Math.sqrt(variance);
58
+ }
59
+ return new Vector(result);
60
+ }
61
+ }
62
+ //# sourceMappingURL=StateCovariance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateCovariance.js","sourceRoot":"","sources":["../../src/covariance/StateCovariance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAE3C,uBAAuB;AACvB,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAA8B;IAC9B,8BAAW,CAAA;IACX,g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-0,0 +1,32 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ *
4
+ * @license AGPL-3.0-or-later
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
6
+ *
7
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
8
+ * terms of the GNU Affero General Public License as published by the Free Software
9
+ * Foundation, either version 3 of the License, or (at your option) any later version.
10
+ *
11
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ * See the GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along with
16
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { J2000, Vector3D } from 'ootk-core';
19
+ import { Force } from './Force';
20
+ /**
21
+ * Harris-Priester atmospheric drag force model.
22
+ * Atmospheric density model assumes mean solar flux.
23
+ */
24
+ export declare class AtmosphericDrag implements Force {
25
+ mass: number;
26
+ area: number;
27
+ dragCoeff: number;
28
+ cosine: number;
29
+ constructor(mass: number, area: number, dragCoeff: number, cosine: number);
30
+ private static _getHPDensity;
31
+ acceleration(state: J2000): Vector3D;
32
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ *
4
+ * @license AGPL-3.0-or-later
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
6
+ *
7
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
8
+ * terms of the GNU Affero General Public License as published by the Free Software
9
+ * Foundation, either version 3 of the License, or (at your option) any later version.
10
+ *
11
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ * See the GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along with
16
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { DataHandler, DEG2RAD, Earth, ITRF, J2000, Sun, Vector3D } from 'ootk-core';
19
+ /**
20
+ * Harris-Priester atmospheric drag force model.
21
+ * Atmospheric density model assumes mean solar flux.
22
+ */
23
+ export class AtmosphericDrag {
24
+ constructor(mass, area, dragCoeff, cosine) {
25
+ this.mass = mass;
26
+ this.area = area;
27
+ this.dragCoeff = dragCoeff;
28
+ this.cosine = cosine;
29
+ }
30
+ static _getHPDensity(state, n) {
31
+ const hpa = DataHandler.getInstance().getHpAtmosphere(state.getHeight());
32
+ if (hpa === null) {
33
+ return 0.0;
34
+ }
35
+ const sunPos = Sun.positionApparent(state.epoch);
36
+ const sunVec = new J2000(state.epoch, sunPos, Vector3D.origin).toITRF().position.normalize();
37
+ const bulVec = sunVec.rotZ(-30.0 * DEG2RAD);
38
+ const cosPsi = bulVec.normalize().dot(state.position.normalize());
39
+ const c2Psi2 = 0.5 * (1.0 + cosPsi);
40
+ const cPsi2 = Math.sqrt(c2Psi2);
41
+ const cosPow = cPsi2 > 1e-12 ? c2Psi2 * cPsi2 ** (n - 2) : 0.0;
42
+ const altitude = hpa.height;
43
+ const [h0, min0, max0] = hpa.hp0;
44
+ const [h1, min1, max1] = hpa.hp1;
45
+ const dH = (h0 - altitude) / (h0 - h1);
46
+ const rhoMin = min0 * (min1 / min0) ** dH;
47
+ if (cosPow === 0) {
48
+ return rhoMin;
49
+ }
50
+ const rhoMax = max0 * (max1 / max0) ** dH;
51
+ return rhoMin + (rhoMax - rhoMin) * cosPow;
52
+ }
53
+ acceleration(state) {
54
+ const itrfState = state.toITRF();
55
+ const density = AtmosphericDrag._getHPDensity(itrfState, this.cosine);
56
+ if (density === 0) {
57
+ return Vector3D.origin;
58
+ }
59
+ const rotation = new ITRF(state.epoch, Earth.rotation, Vector3D.origin).toJ2000().position;
60
+ const vRel = state.velocity.subtract(rotation.cross(state.position)).scale(1000.0);
61
+ const vm = vRel.magnitude();
62
+ const fScale = -0.5 * density * ((this.dragCoeff * this.area) / this.mass) * vm;
63
+ return vRel.scale(fScale / 1000.0);
64
+ }
65
+ }
66
+ //# sourceMappingURL=AtmosphericDrag.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AtmosphericDrag.js","sourceRoot":"","sources":["../../src/force/AtmosphericDrag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGpF;;;GAGG;AACH,MAAM,OAAO,eAAe;IAM1B,YAAY,IAAY,EAAE,IAAY,EAAE,SAAiB,EAAE,MAAc;QACvE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,KAAW,EAAE,CAAS;QACjD,MAAM,GAAG,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;QAEzE,IAAI,GAAG,KAAK,IAAI,EAAE;YAChB,OAAO,GAAG,CAAC;SACZ;QACD,MAAM,MAAM,GAAG,GAAG,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;QAC7F,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,CAAC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AAM,CAAC;SACxB;QACD,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;QAC3F,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnF,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAG,CAAC,GAAG,GAAG,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAEhF,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ *
4
+ * @license AGPL-3.0-or-later
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
6
+ *
7
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
8
+ * terms of the GNU Affero General Public License as published by the Free Software
9
+ * Foundation, either version 3 of the License, or (at your option) any later version.
10
+ *
11
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ * See the GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along with
16
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { J2000, Vector3D } from 'ootk-core';
19
+ import { Force } from './Force';
20
+ export declare class EarthGravity implements Force {
21
+ degree: number;
22
+ order: number;
23
+ _asphericalFlag: boolean;
24
+ constructor(degree: number, order: number);
25
+ _spherical(state: J2000): Vector3D;
26
+ _aspherical(state: J2000): Vector3D;
27
+ acceleration(state: J2000): Vector3D;
28
+ }
@@ -0,0 +1,115 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ *
4
+ * @license AGPL-3.0-or-later
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
6
+ *
7
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
8
+ * terms of the GNU Affero General Public License as published by the Free Software
9
+ * Foundation, either version 3 of the License, or (at your option) any later version.
10
+ *
11
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ * See the GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along with
16
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import { DataHandler, Earth, ITRF, Vector3D } from 'ootk-core';
19
+ // / tesseral geopotential perturbations.
20
+ export class EarthGravity {
21
+ constructor(degree, order) {
22
+ this.degree = Math.min(Math.max(degree, 0), 36);
23
+ this.order = Math.min(Math.max(order, 0), 36);
24
+ this._asphericalFlag = degree >= 2;
25
+ }
26
+ _spherical(state) {
27
+ const rMag = state.position.magnitude();
28
+ return state.position.scale(-Earth.mu / (rMag * rMag * rMag));
29
+ }
30
+ // eslint-disable-next-line max-statements
31
+ _aspherical(state) {
32
+ const posEcef = state.toITRF().position;
33
+ const ri = 1.0 / posEcef.magnitude();
34
+ const xor = posEcef.x * ri;
35
+ const yor = posEcef.y * ri;
36
+ const zor = posEcef.z * ri;
37
+ const ep = zor;
38
+ const reor = Earth.radiusEquator * ri;
39
+ let reorn = reor;
40
+ const muor2 = Earth.mu * ri * ri;
41
+ let sumH = 0.0;
42
+ let sumGm = 0.0;
43
+ let sumJ = 0.0;
44
+ let sumK = 0.0;
45
+ const cTil = new Float64Array(this.order + 4);
46
+ const sTil = new Float64Array(this.order + 4);
47
+ const pN = new Float64Array(this.order + 4);
48
+ const pNm1 = new Float64Array(this.order + 4);
49
+ const pNm2 = new Float64Array(this.order + 4);
50
+ pNm2[0] = 1.0;
51
+ pNm1[0] = ep;
52
+ pNm1[1] = 1.0;
53
+ cTil[0] = 1.0;
54
+ cTil[1] = xor;
55
+ sTil[1] = yor;
56
+ const dh = DataHandler.getInstance();
57
+ for (let n = 2, nm1 = 1, nm2 = 0, np1 = 3; n <= this.degree; nm2++, nm1++, n++, np1++) {
58
+ const twonm1 = 2.0 * n - 1.0;
59
+ reorn *= reor;
60
+ const cN0 = dh.getEgm96Coeffs(n, 0)[2];
61
+ pN[0] = (twonm1 * ep * pNm1[0] - nm1 * pNm2[0]) / n;
62
+ pN[1] = pNm2[1] + twonm1 * pNm1[0];
63
+ pN[2] = pNm2[2] + twonm1 * pNm1[1];
64
+ let sumHn = pN[1] * cN0;
65
+ let sumGmn = pN[0] * cN0 * np1;
66
+ if (this.order > 0) {
67
+ let sumJn = 0.0;
68
+ let sumKn = 0.0;
69
+ cTil[n] = cTil[1] * cTil[nm1] - sTil[1] * sTil[nm1];
70
+ sTil[n] = sTil[1] * cTil[nm1] + cTil[1] * sTil[nm1];
71
+ const lim = n < this.order ? n : this.order;
72
+ for (let m = 1, mm1 = 0, mm2 = -1, mp1 = 2, mp2 = 3; m <= lim; mm2++, mm1++, m++, mp1++, mp2++) {
73
+ pN[mp1] = pNm2[mp1] + twonm1 * pNm1[m];
74
+ const dm = m;
75
+ const npmp1 = n + mp1;
76
+ const pNm = pN[m];
77
+ const pNmp1 = pN[mp1];
78
+ const coefs = dh.getEgm96Coeffs(n, m);
79
+ const cNm = coefs[2];
80
+ const sNm = coefs[3];
81
+ const mxPnm = dm * pNm;
82
+ const bNmtil = cNm * cTil[m] + sNm * sTil[m];
83
+ const pNmBnm = pNm * bNmtil;
84
+ const bNmtm1 = cNm * cTil[mm1] + sNm * sTil[mm1];
85
+ const aNmtm1 = cNm * sTil[mm1] - sNm * cTil[mm1];
86
+ sumHn += pNmp1 * bNmtil;
87
+ sumGmn += npmp1 * pNmBnm;
88
+ sumJn += mxPnm * bNmtm1;
89
+ sumKn -= mxPnm * aNmtm1;
90
+ }
91
+ sumJ += reorn * sumJn;
92
+ sumK += reorn * sumKn;
93
+ }
94
+ sumH += reorn * sumHn;
95
+ sumGm += reorn * sumGmn;
96
+ if (n < this.degree) {
97
+ for (let i = 0; i <= n; i++) {
98
+ pNm2[i] = pNm1[i];
99
+ pNm1[i] = pN[i];
100
+ }
101
+ }
102
+ }
103
+ const lambda = sumGm + ep * sumH;
104
+ const g = new Vector3D(-muor2 * (lambda * xor - sumJ), -muor2 * (lambda * yor - sumK), -muor2 * (lambda * zor - sumH));
105
+ return new ITRF(state.epoch, g, Vector3D.origin).toJ2000().position;
106
+ }
107
+ acceleration(state) {
108
+ let accVec = this._spherical(state);
109
+ if (this._asphericalFlag) {
110
+ accVec = accVec.add(this._aspherical(state));
111
+ }
112
+ return accVec;
113
+ }
114
+ }
115
+ //# sourceMappingURL=EarthGravity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EarthGravity.js","sourceRoot":"","sources":["../../src/force/EarthGravity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAS,QAAQ,EAAE,MAAM,WAAW,CAAC;AAMtE,yCAAyC;AACzC,MAAM,OAAO,YAAY;IAKvB,YAAY,MAAc,EAAE,KAAa;QACvC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC9C,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,EAAE;oBAC3B,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;oBAClB,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;iBACjB;aACF;SACF;QAED,MAAM,MAAM,GAAG,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC;QACjC,MAAM,CAAC,GAAG,IAAI,QAAQ,CACpB,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,EAC9B,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,EAC9B,CAAC,KAAK,GAAG,CAAC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,CAC/B,CAAC;QAEF,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;IACtE,CAAC;IAED,YAAY,CAAC,KAAY;QACvB,IAAI,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QAEpC,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;SAC9C;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -1,10 +1,8 @@
1
1
  /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
4
- * with satellites and other orbital objects.
2
+ * @author @thkruz Theodore Kruczek
5
3
  *
6
4
  * @license AGPL-3.0-or-later
7
- * @Copyright (c) 2020-2023 Theodore Kruczek
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
8
6
  *
9
7
  * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
10
8
  * terms of the GNU Affero General Public License as published by the Free Software
@@ -17,9 +15,11 @@
17
15
  * You should have received a copy of the GNU Affero General Public License along with
18
16
  * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
19
17
  */
20
- export { Sgp4 } from './sgp4/sgp4';
21
- export { Transforms } from './transforms/transforms';
22
- export { Utils } from './utils/utils';
23
- export { Tle } from './tle/tle';
24
- export * from './objects/index';
25
- export * from './types/types';
18
+ import { J2000, Vector3D } from 'ootk-core';
19
+ export declare abstract class Force {
20
+ /**
21
+ * Calculate the acceleration due to the perturbing force on a given
22
+ * state vector.
23
+ */
24
+ acceleration(state: J2000): Vector3D;
25
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ *
4
+ * @license AGPL-3.0-or-later
5
+ * @Copyright (c) 2020-2024 Theodore Kruczek
6
+ *
7
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
8
+ * terms of the GNU Affero General Public License as published by the Free Software
9
+ * Foundation, either version 3 of the License, or (at your option) any later version.
10
+ *
11
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ * See the GNU Affero General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along with
16
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ /* eslint-disable @typescript-eslint/no-unused-vars */
19
+ /* eslint-disable class-methods-use-this */
20
+ // / Base class for perturbation forces.
21
+ export class Force {
22
+ /**
23
+ * Calculate the acceleration due to the perturbing force on a given
24
+ * state vector.
25
+ */
26
+ acceleration(state) {
27
+ throw Error('Not implemented');
28
+ }
29
+ }
30
+ //# sourceMappingURL=Force.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Force.js","sourceRoot":"","sources":["../../src/force/Force.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,sDAAsD;AACtD,2CAA2C;AAE3C,wCAAwC;AACxC,MAAM,OAAgB,KAAK;IACzB;;;OAGG;IACH,YAAY,CAAC,KAAY;QACvB,MAAM,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACjC,CAAC;CACF"}