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.
- package/CHANGELOG.md +235 -10
- package/README.md +27 -40
- package/dist/coordinate/Hill.d.ts +49 -0
- package/dist/coordinate/Hill.js +222 -0
- package/dist/coordinate/Hill.js.map +1 -0
- package/dist/coordinate/index.d.ts +1 -0
- package/dist/coordinate/index.js +2 -0
- package/dist/coordinate/index.js.map +1 -0
- package/dist/covariance/CovarianceSample.d.ts +43 -0
- package/dist/covariance/CovarianceSample.js +147 -0
- package/dist/covariance/CovarianceSample.js.map +1 -0
- package/dist/covariance/StateCovariance.d.ts +42 -0
- package/dist/covariance/StateCovariance.js +65 -0
- package/dist/covariance/StateCovariance.js.map +1 -0
- package/dist/force/AtmosphericDrag.d.ts +31 -0
- package/dist/force/AtmosphericDrag.js +73 -0
- package/dist/force/AtmosphericDrag.js.map +1 -0
- package/dist/force/EarthGravity.d.ts +27 -0
- package/dist/force/EarthGravity.js +117 -0
- package/dist/force/EarthGravity.js.map +1 -0
- package/{lib/ootk.d.ts → dist/force/Force.d.ts} +12 -11
- package/dist/force/Force.js +31 -0
- package/dist/force/Force.js.map +1 -0
- package/dist/force/ForceModel.d.ts +37 -0
- package/dist/force/ForceModel.js +75 -0
- package/dist/force/ForceModel.js.map +1 -0
- package/dist/force/Gravity.d.ts +38 -0
- package/dist/force/Gravity.js +47 -0
- package/dist/force/Gravity.js.map +1 -0
- package/dist/{ootk.d.ts → force/SolarRadiationPressure.d.ts} +12 -11
- package/dist/force/SolarRadiationPressure.js +44 -0
- package/dist/force/SolarRadiationPressure.js.map +1 -0
- package/dist/force/ThirdBodyGravity.d.ts +26 -0
- package/dist/force/ThirdBodyGravity.js +57 -0
- package/dist/force/ThirdBodyGravity.js.map +1 -0
- package/dist/force/Thrust.d.ts +34 -0
- package/dist/force/Thrust.js +58 -0
- package/dist/force/Thrust.js.map +1 -0
- package/dist/interfaces/RfSensorParams.d.ts +28 -0
- package/dist/interfaces/RfSensorParams.js +24 -0
- package/dist/interfaces/RfSensorParams.js.map +1 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interpolator/ChebyshevCoefficients.d.ts +50 -0
- package/dist/interpolator/ChebyshevCoefficients.js +94 -0
- package/dist/interpolator/ChebyshevCoefficients.js.map +1 -0
- package/dist/interpolator/ChebyshevInterpolator.d.ts +38 -0
- package/dist/interpolator/ChebyshevInterpolator.js +71 -0
- package/dist/interpolator/ChebyshevInterpolator.js.map +1 -0
- package/dist/interpolator/CubicSpline.d.ts +35 -0
- package/dist/interpolator/CubicSpline.js +69 -0
- package/dist/interpolator/CubicSpline.js.map +1 -0
- package/dist/interpolator/CubicSplineInterpolator.d.ts +36 -0
- package/dist/interpolator/CubicSplineInterpolator.js +80 -0
- package/dist/interpolator/CubicSplineInterpolator.js.map +1 -0
- package/dist/interpolator/FieldInterpolator.d.ts +28 -0
- package/dist/interpolator/FieldInterpolator.js +34 -0
- package/dist/interpolator/FieldInterpolator.js.map +1 -0
- package/dist/interpolator/Interpolator.d.ts +22 -0
- package/dist/interpolator/Interpolator.js +47 -0
- package/dist/interpolator/Interpolator.js.map +1 -0
- package/dist/interpolator/LagrangeInterpolator.d.ts +40 -0
- package/dist/interpolator/LagrangeInterpolator.js +159 -0
- package/dist/interpolator/LagrangeInterpolator.js.map +1 -0
- package/dist/interpolator/StateInterpolator.d.ts +27 -0
- package/dist/interpolator/StateInterpolator.js +35 -0
- package/dist/interpolator/StateInterpolator.js.map +1 -0
- package/dist/interpolator/VerletBlendInterpolator.d.ts +43 -0
- package/dist/interpolator/VerletBlendInterpolator.js +118 -0
- package/dist/interpolator/VerletBlendInterpolator.js.map +1 -0
- package/{lib/ootk.js → dist/main.d.ts} +13 -10
- package/dist/{objects/space-object.d.ts → main.js} +17 -23
- package/dist/main.js.map +1 -0
- package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +41 -0
- package/dist/maneuver/TwoBurnOrbitTransfer.js +65 -0
- package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
- package/dist/maneuver/Waypoint.d.ts +91 -0
- package/dist/maneuver/Waypoint.js +179 -0
- package/dist/maneuver/Waypoint.js.map +1 -0
- package/{lib/objects/detailed-sat.d.ts → dist/objects/DetailedSatellite.d.ts} +40 -36
- package/dist/objects/DetailedSatellite.js +136 -0
- package/dist/objects/DetailedSatellite.js.map +1 -0
- package/dist/objects/DetailedSensor.d.ts +42 -0
- package/dist/objects/DetailedSensor.js +65 -0
- package/dist/objects/DetailedSensor.js.map +1 -0
- package/dist/objects/LandObject.d.ts +33 -0
- package/dist/objects/LandObject.js +34 -0
- package/dist/objects/LandObject.js.map +1 -0
- package/dist/objects/Marker.d.ts +20 -0
- package/dist/objects/Marker.js +24 -0
- package/dist/objects/Marker.js.map +1 -0
- package/dist/objects/RfSensor.d.ts +41 -0
- package/dist/objects/RfSensor.js +67 -0
- package/dist/objects/RfSensor.js.map +1 -0
- package/dist/objects/index.d.ts +5 -4
- package/dist/objects/index.js +6 -0
- package/dist/objects/index.js.map +1 -0
- package/dist/observation/Observation.d.ts +89 -0
- package/dist/observation/Observation.js +102 -0
- package/dist/observation/Observation.js.map +1 -0
- package/dist/observation/ObservationOptical.d.ts +48 -0
- package/dist/observation/ObservationOptical.js +105 -0
- package/dist/observation/ObservationOptical.js.map +1 -0
- package/dist/observation/ObservationRadar.d.ts +46 -0
- package/dist/observation/ObservationRadar.js +96 -0
- package/dist/observation/ObservationRadar.js.map +1 -0
- package/dist/observation/ObservationUtils.d.ts +20 -0
- package/dist/observation/ObservationUtils.js +32 -0
- package/dist/observation/ObservationUtils.js.map +1 -0
- package/dist/observation/PropagatorPairs.d.ts +32 -0
- package/dist/observation/PropagatorPairs.js +43 -0
- package/dist/observation/PropagatorPairs.js.map +1 -0
- package/dist/operations/BoxMuller.d.ts +46 -0
- package/dist/operations/BoxMuller.js +77 -0
- package/dist/operations/BoxMuller.js.map +1 -0
- package/dist/operations/EulerAngles.d.ts +105 -0
- package/dist/operations/EulerAngles.js +161 -0
- package/dist/operations/EulerAngles.js.map +1 -0
- package/dist/operations/Quaternion.d.ts +56 -0
- package/dist/operations/Quaternion.js +167 -0
- package/dist/operations/Quaternion.js.map +1 -0
- package/dist/operations/RandomGaussianSource.d.ts +24 -0
- package/dist/operations/RandomGaussianSource.js +43 -0
- package/dist/operations/RandomGaussianSource.js.map +1 -0
- package/dist/operations/index.d.ts +4 -0
- package/dist/operations/index.js +5 -0
- package/dist/operations/index.js.map +1 -0
- package/dist/optimize/ChebyshevCompressor.d.ts +32 -0
- package/dist/optimize/ChebyshevCompressor.js +83 -0
- package/dist/optimize/ChebyshevCompressor.js.map +1 -0
- package/dist/optimize/DownhillSimplex.d.ts +64 -0
- package/dist/optimize/DownhillSimplex.js +182 -0
- package/dist/optimize/DownhillSimplex.js.map +1 -0
- package/dist/optimize/GoldenSection.d.ts +39 -0
- package/dist/optimize/GoldenSection.js +55 -0
- package/dist/optimize/GoldenSection.js.map +1 -0
- package/dist/optimize/PolynomialRegression.d.ts +49 -0
- package/dist/optimize/PolynomialRegression.js +83 -0
- package/dist/optimize/PolynomialRegression.js.map +1 -0
- package/dist/optimize/PolynomicalRegressionResult.d.ts +31 -0
- package/dist/optimize/PolynomicalRegressionResult.js +38 -0
- package/dist/optimize/PolynomicalRegressionResult.js.map +1 -0
- package/dist/optimize/SimpleLinearRegression.d.ts +44 -0
- package/dist/optimize/SimpleLinearRegression.js +112 -0
- package/dist/optimize/SimpleLinearRegression.js.map +1 -0
- package/dist/optimize/SimplexEntry.d.ts +32 -0
- package/dist/optimize/SimplexEntry.js +42 -0
- package/dist/optimize/SimplexEntry.js.map +1 -0
- package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +65 -0
- package/dist/orbit_determination/BatchLeastSquaresOD.js +143 -0
- package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
- package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +31 -0
- package/{lib/objects/space-object.d.ts → dist/orbit_determination/BatchLeastSquaresResult.js} +21 -23
- package/dist/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
- package/dist/orbit_determination/GibbsIOD.d.ts +38 -0
- package/dist/orbit_determination/GibbsIOD.js +76 -0
- package/dist/orbit_determination/GibbsIOD.js.map +1 -0
- package/dist/orbit_determination/GoodingIOD.d.ts +51 -0
- package/dist/orbit_determination/GoodingIOD.js +247 -0
- package/dist/orbit_determination/GoodingIOD.js.map +1 -0
- package/dist/orbit_determination/HerrickGibbsIOD.d.ts +33 -0
- package/dist/orbit_determination/HerrickGibbsIOD.js +50 -0
- package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -0
- package/dist/orbit_determination/LambertIOD.d.ts +59 -0
- package/dist/orbit_determination/LambertIOD.js +213 -0
- package/dist/orbit_determination/LambertIOD.js.map +1 -0
- package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +40 -0
- package/dist/orbit_determination/ModifiedGoodingIOD.js +83 -0
- package/dist/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
- package/dist/propagator/DormandPrince54Propagator.d.ts +28 -0
- package/dist/propagator/DormandPrince54Propagator.js +64 -0
- package/dist/propagator/DormandPrince54Propagator.js.map +1 -0
- package/dist/propagator/KeplerPropagator.d.ts +35 -0
- package/dist/propagator/KeplerPropagator.js +84 -0
- package/dist/propagator/KeplerPropagator.js.map +1 -0
- package/dist/propagator/Propagator.d.ts +34 -0
- package/dist/propagator/Propagator.js +162 -0
- package/dist/propagator/Propagator.js.map +1 -0
- package/dist/propagator/RkCheckpoint.d.ts +22 -0
- package/dist/propagator/RkCheckpoint.js +27 -0
- package/dist/propagator/RkCheckpoint.js.map +1 -0
- package/dist/propagator/RkResult.d.ts +23 -0
- package/dist/propagator/RkResult.js +30 -0
- package/dist/propagator/RkResult.js.map +1 -0
- package/dist/propagator/RungeKutta4Propagator.d.ts +50 -0
- package/dist/propagator/RungeKutta4Propagator.js +141 -0
- package/dist/propagator/RungeKutta4Propagator.js.map +1 -0
- package/dist/propagator/RungeKutta89Propagator.d.ts +28 -0
- package/dist/propagator/RungeKutta89Propagator.js +126 -0
- package/dist/propagator/RungeKutta89Propagator.js.map +1 -0
- package/dist/propagator/RungeKuttaAdaptive.d.ts +54 -0
- package/dist/propagator/RungeKuttaAdaptive.js +159 -0
- package/dist/propagator/RungeKuttaAdaptive.js.map +1 -0
- package/dist/propagator/Sgp4Propagator.d.ts +34 -0
- package/dist/propagator/Sgp4Propagator.js +56 -0
- package/dist/propagator/Sgp4Propagator.js.map +1 -0
- package/dist/smoothing/ExponentialSmoothing.d.ts +23 -0
- package/dist/smoothing/ExponentialSmoothing.js +81 -0
- package/dist/smoothing/ExponentialSmoothing.js.map +1 -0
- package/dist/transforms/index.d.ts +1 -0
- package/dist/transforms/index.js +2 -0
- package/dist/transforms/index.js.map +1 -0
- package/dist/transforms/transforms.d.ts +56 -92
- package/dist/transforms/transforms.js +94 -0
- package/dist/transforms/transforms.js.map +1 -0
- package/dist/types/types.d.ts +105 -584
- package/dist/types/types.js +23 -0
- package/dist/types/types.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/jacobian.d.ts +11 -0
- package/dist/utils/jacobian.js +29 -0
- package/dist/utils/jacobian.js.map +1 -0
- package/package.json +34 -42
- package/src/coordinate/Hill.ts +326 -0
- package/src/coordinate/index.ts +1 -0
- package/src/covariance/CovarianceSample.ts +194 -0
- package/src/covariance/StateCovariance.ts +69 -0
- package/src/force/AtmosphericDrag.ts +101 -0
- package/src/force/EarthGravity.ts +157 -0
- package/src/force/Force.ts +33 -0
- package/src/force/ForceModel.ts +91 -0
- package/src/force/Gravity.ts +53 -0
- package/src/force/SolarRadiationPressure.ts +42 -0
- package/src/force/ThirdBodyGravity.ts +62 -0
- package/src/force/Thrust.ts +83 -0
- package/src/interfaces/RfSensorParams.ts +30 -0
- package/src/interfaces/index.ts +1 -0
- package/src/interpolator/ChebyshevCoefficients.ts +109 -0
- package/src/interpolator/ChebyshevInterpolator.ts +87 -0
- package/src/interpolator/CubicSpline.ts +72 -0
- package/src/interpolator/CubicSplineInterpolator.ts +90 -0
- package/src/interpolator/FieldInterpolator.ts +37 -0
- package/src/interpolator/Interpolator.ts +56 -0
- package/src/interpolator/LagrangeInterpolator.ts +192 -0
- package/src/interpolator/StateInterpolator.ts +39 -0
- package/src/interpolator/VerletBlendInterpolator.ts +146 -0
- package/src/main.ts +32 -0
- package/src/maneuver/TwoBurnOrbitTransfer.ts +79 -0
- package/src/maneuver/Waypoint.ts +267 -0
- package/src/objects/DetailedSatellite.ts +159 -0
- package/src/objects/DetailedSensor.ts +68 -0
- package/src/objects/LandObject.ts +46 -0
- package/src/objects/Marker.ts +25 -0
- package/src/objects/RfSensor.ts +78 -0
- package/src/objects/index.ts +5 -0
- package/src/observation/Observation.ts +125 -0
- package/src/observation/ObservationOptical.ts +146 -0
- package/src/observation/ObservationRadar.ts +131 -0
- package/src/observation/ObservationUtils.ts +40 -0
- package/src/observation/PropagatorPairs.ts +45 -0
- package/src/operations/BoxMuller.ts +87 -0
- package/src/operations/EulerAngles.ts +183 -0
- package/src/operations/Quaternion.ts +222 -0
- package/src/operations/RandomGaussianSource.ts +51 -0
- package/src/operations/index.ts +4 -0
- package/src/optimize/ChebyshevCompressor.ts +96 -0
- package/src/optimize/DownhillSimplex.ts +212 -0
- package/src/optimize/GoldenSection.ts +71 -0
- package/src/optimize/PolynomialRegression.ts +109 -0
- package/src/optimize/PolynomicalRegressionResult.ts +32 -0
- package/src/optimize/SimpleLinearRegression.ts +127 -0
- package/src/optimize/SimplexEntry.ts +50 -0
- package/src/orbit_determination/BatchLeastSquaresOD.ts +174 -0
- package/src/orbit_determination/BatchLeastSquaresResult.ts +33 -0
- package/src/orbit_determination/GibbsIOD.ts +95 -0
- package/src/orbit_determination/GoodingIOD.ts +380 -0
- package/src/orbit_determination/HerrickGibbsIOD.ts +51 -0
- package/src/orbit_determination/LambertIOD.ts +260 -0
- package/src/orbit_determination/ModifiedGoodingIOD.ts +133 -0
- package/src/propagator/DormandPrince54Propagator.ts +73 -0
- package/src/propagator/KeplerPropagator.ts +102 -0
- package/src/propagator/Propagator.ts +253 -0
- package/src/propagator/RkCheckpoint.ts +25 -0
- package/src/propagator/RkResult.ts +26 -0
- package/src/propagator/RungeKutta4Propagator.ts +179 -0
- package/src/propagator/RungeKutta89Propagator.ts +132 -0
- package/src/propagator/RungeKuttaAdaptive.ts +232 -0
- package/src/propagator/Sgp4Propagator.ts +71 -0
- package/src/smoothing/ExponentialSmoothing.ts +90 -0
- package/src/transforms/index.ts +1 -0
- package/src/transforms/transforms.ts +117 -0
- package/src/types/types.ts +135 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/jacobian.ts +38 -0
- package/.eslintrc.json +0 -244
- package/.prettierrc +0 -17
- package/babel.config.js +0 -16
- package/codecov.yml +0 -21
- package/dist/objects/base-object.d.ts +0 -40
- package/dist/objects/detailed-sat.d.ts +0 -66
- package/dist/objects/sat.d.ts +0 -92
- package/dist/objects/sensor.d.ts +0 -93
- package/dist/objects/star.d.ts +0 -46
- package/dist/ootk.js +0 -2
- package/dist/ootk.js.LICENSE.txt +0 -77
- package/dist/sgp4/sgp4.d.ts +0 -82
- package/dist/tle/tle-format-data.d.ts +0 -6
- package/dist/tle/tle.d.ts +0 -375
- package/dist/utils/constants.d.ts +0 -34
- package/dist/utils/moon-math.d.ts +0 -113
- package/dist/utils/sun-math.d.ts +0 -230
- package/dist/utils/utils.d.ts +0 -39
- package/jest.config.ts +0 -30
- package/lib/objects/base-object.d.ts +0 -40
- package/lib/objects/base-object.js +0 -79
- package/lib/objects/base-object.js.map +0 -1
- package/lib/objects/detailed-sat.js +0 -149
- package/lib/objects/detailed-sat.js.map +0 -1
- package/lib/objects/index.d.ts +0 -4
- package/lib/objects/index.js +0 -5
- package/lib/objects/index.js.map +0 -1
- package/lib/objects/sat.d.ts +0 -92
- package/lib/objects/sat.js +0 -188
- package/lib/objects/sat.js.map +0 -1
- package/lib/objects/sensor.d.ts +0 -93
- package/lib/objects/sensor.js +0 -273
- package/lib/objects/sensor.js.map +0 -1
- package/lib/objects/space-object.js +0 -60
- package/lib/objects/space-object.js.map +0 -1
- package/lib/objects/star.d.ts +0 -46
- package/lib/objects/star.js +0 -91
- package/lib/objects/star.js.map +0 -1
- package/lib/ootk.js.map +0 -1
- package/lib/sgp4/sgp4.d.ts +0 -82
- package/lib/sgp4/sgp4.js +0 -3262
- package/lib/sgp4/sgp4.js.map +0 -1
- package/lib/tle/tle-format-data.d.ts +0 -6
- package/lib/tle/tle-format-data.js +0 -10
- package/lib/tle/tle-format-data.js.map +0 -1
- package/lib/tle/tle.d.ts +0 -375
- package/lib/tle/tle.js +0 -611
- package/lib/tle/tle.js.map +0 -1
- package/lib/transforms/transforms.d.ts +0 -94
- package/lib/transforms/transforms.js +0 -308
- package/lib/transforms/transforms.js.map +0 -1
- package/lib/types/types.d.ts +0 -605
- package/lib/types/types.js +0 -36
- package/lib/types/types.js.map +0 -1
- package/lib/utils/constants.d.ts +0 -34
- package/lib/utils/constants.js +0 -35
- package/lib/utils/constants.js.map +0 -1
- package/lib/utils/moon-math.d.ts +0 -113
- package/lib/utils/moon-math.js +0 -387
- package/lib/utils/moon-math.js.map +0 -1
- package/lib/utils/sun-math.d.ts +0 -230
- package/lib/utils/sun-math.js +0 -422
- package/lib/utils/sun-math.js.map +0 -1
- package/lib/utils/utils.d.ts +0 -39
- package/lib/utils/utils.js +0 -102
- package/lib/utils/utils.js.map +0 -1
- package/sandbox.html +0 -8
- package/tsconfig.base.json +0 -31
- package/tsconfig.build.json +0 -14
- /package/{LICENSE.MD → LICENSE.md} +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
import { Moon, Sun, Vector3D } from 'ootk-core';
|
|
18
|
+
// / Third-body gravity model.
|
|
19
|
+
export class ThirdBodyGravity {
|
|
20
|
+
moon;
|
|
21
|
+
sun;
|
|
22
|
+
// / Create a new [ThirdBodyGravity] object with the selected bodies enabled.
|
|
23
|
+
constructor(moon = false, sun = false) {
|
|
24
|
+
this.moon = moon;
|
|
25
|
+
this.sun = sun;
|
|
26
|
+
// Nothing to do here.
|
|
27
|
+
}
|
|
28
|
+
static _moonGravity(state) {
|
|
29
|
+
const rMoon = Moon.eci(state.epoch);
|
|
30
|
+
const aNum = rMoon.subtract(state.position);
|
|
31
|
+
const aDen = aNum.magnitude() ** 3;
|
|
32
|
+
const bNum = rMoon;
|
|
33
|
+
const bDen = rMoon.magnitude() ** 3;
|
|
34
|
+
const gravity = aNum.scale(1 / aDen).add(bNum.scale(-1 / bDen));
|
|
35
|
+
return gravity.scale(Moon.mu);
|
|
36
|
+
}
|
|
37
|
+
static _sunGravity(state) {
|
|
38
|
+
const rSun = Sun.positionApparent(state.epoch);
|
|
39
|
+
const aNum = rSun.subtract(state.position);
|
|
40
|
+
const aDen = aNum.magnitude() ** 3;
|
|
41
|
+
const bNum = rSun;
|
|
42
|
+
const bDen = rSun.magnitude() ** 3;
|
|
43
|
+
const gravity = aNum.scale(1 / aDen).add(bNum.scale(-1 / bDen));
|
|
44
|
+
return gravity.scale(Sun.mu);
|
|
45
|
+
}
|
|
46
|
+
acceleration(state) {
|
|
47
|
+
let accVec = Vector3D.origin;
|
|
48
|
+
if (this.moon) {
|
|
49
|
+
accVec = accVec.add(ThirdBodyGravity._moonGravity(state));
|
|
50
|
+
}
|
|
51
|
+
if (this.sun) {
|
|
52
|
+
accVec = accVec.add(ThirdBodyGravity._sunGravity(state));
|
|
53
|
+
}
|
|
54
|
+
return accVec;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=ThirdBodyGravity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThirdBodyGravity.js","sourceRoot":"","sources":["../../src/force/ThirdBodyGravity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAS,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGvD,8BAA8B;AAC9B,MAAM,OAAO,gBAAgB;IAER;IAA8B;IADjD,6EAA6E;IAC7E,YAAmB,OAAgB,KAAK,EAAS,MAAe,KAAK;QAAlD,SAAI,GAAJ,IAAI,CAAiB;QAAS,QAAG,GAAH,GAAG,CAAiB;QACnE,sBAAsB;IACxB,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAAY;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACnC,MAAM,IAAI,GAAG,KAAK,CAAC;QACnB,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,EAA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,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import { EpochUTC, J2000, KilometersPerSecond, MetersPerSecond, Seconds, SecondsPerMeterPerSecond, Vector3D } from 'ootk-core';
|
|
18
|
+
import { Force } from './Force';
|
|
19
|
+
export declare class Thrust implements Force {
|
|
20
|
+
center: EpochUTC;
|
|
21
|
+
radial: MetersPerSecond;
|
|
22
|
+
intrack: MetersPerSecond;
|
|
23
|
+
crosstrack: MetersPerSecond;
|
|
24
|
+
durationRate: SecondsPerMeterPerSecond;
|
|
25
|
+
constructor(center: EpochUTC, radial: MetersPerSecond, intrack: MetersPerSecond, crosstrack: MetersPerSecond, durationRate?: SecondsPerMeterPerSecond);
|
|
26
|
+
deltaV: Vector3D<KilometersPerSecond>;
|
|
27
|
+
get magnitude(): MetersPerSecond;
|
|
28
|
+
get duration(): Seconds;
|
|
29
|
+
get start(): EpochUTC;
|
|
30
|
+
get stop(): EpochUTC;
|
|
31
|
+
acceleration(state: J2000): Vector3D;
|
|
32
|
+
apply(state: J2000): J2000;
|
|
33
|
+
get isImpulsive(): boolean;
|
|
34
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
import { RIC, Vector3D, } from 'ootk-core';
|
|
18
|
+
// / Thrust force model.
|
|
19
|
+
export class Thrust {
|
|
20
|
+
center;
|
|
21
|
+
radial;
|
|
22
|
+
intrack;
|
|
23
|
+
crosstrack;
|
|
24
|
+
durationRate;
|
|
25
|
+
constructor(center, radial, intrack, crosstrack, durationRate = 0.0) {
|
|
26
|
+
this.center = center;
|
|
27
|
+
this.radial = radial;
|
|
28
|
+
this.intrack = intrack;
|
|
29
|
+
this.crosstrack = crosstrack;
|
|
30
|
+
this.durationRate = durationRate;
|
|
31
|
+
this.deltaV = new Vector3D(radial * 1e-3, intrack * 1e-3, crosstrack * 1e-3);
|
|
32
|
+
}
|
|
33
|
+
deltaV;
|
|
34
|
+
get magnitude() {
|
|
35
|
+
return this.deltaV.magnitude() * 1000.0;
|
|
36
|
+
}
|
|
37
|
+
get duration() {
|
|
38
|
+
return this.magnitude * this.durationRate;
|
|
39
|
+
}
|
|
40
|
+
get start() {
|
|
41
|
+
return this.center.roll(-0.5 * this.duration);
|
|
42
|
+
}
|
|
43
|
+
get stop() {
|
|
44
|
+
return this.center.roll(0.5 * this.duration);
|
|
45
|
+
}
|
|
46
|
+
acceleration(state) {
|
|
47
|
+
const relative = new RIC(Vector3D.origin, this.deltaV.scale(1.0 / this.duration));
|
|
48
|
+
return relative.toJ2000(state).velocity.subtract(state.velocity);
|
|
49
|
+
}
|
|
50
|
+
apply(state) {
|
|
51
|
+
const relative = new RIC(Vector3D.origin, this.deltaV);
|
|
52
|
+
return relative.toJ2000(state);
|
|
53
|
+
}
|
|
54
|
+
get isImpulsive() {
|
|
55
|
+
return this.duration <= 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=Thrust.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Thrust.js","sourceRoot":"","sources":["../../src/force/Thrust.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAML,GAAG,EAGH,QAAQ,GACT,MAAM,WAAW,CAAC;AAGnB,wBAAwB;AACxB,MAAM,OAAO,MAAM;IAER;IACA;IACA;IACA;IACA;IALT,YACS,MAAgB,EAChB,MAAuB,EACvB,OAAwB,EACxB,UAA2B,EAC3B,eAAe,GAA+B;QAJ9C,WAAM,GAAN,MAAM,CAAU;QAChB,WAAM,GAAN,MAAM,CAAiB;QACvB,YAAO,GAAP,OAAO,CAAiB;QACxB,eAAU,GAAV,UAAU,CAAiB;QAC3B,iBAAY,GAAZ,YAAY,CAAkC;QAErD,IAAI,CAAC,MAAM,GAAG,IAAI,QAAQ,CACxB,MAAM,GAAG,IAA2B,EACpC,OAAO,GAAG,IAA2B,EACrC,UAAU,GAAG,IAA2B,CACzC,CAAC;IACJ,CAAC;IAED,MAAM,CAAgC;IAEtC,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,GAAG,MAAyB,CAAC;IAC7D,CAAC;IAED,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAuB,CAAC;IACvD,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,QAAmB,CAAC,CAAC;IAC3D,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,QAAmB,CAAC,CAAC;IAC1D,CAAC;IAED,YAAY,CAAC,KAAY;QACvB,MAAM,QAAQ,GAAG,IAAI,GAAG,CACtB,QAAQ,CAAC,MAA8B,EACvC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,QAA+B,CAAC,CAC9D,CAAC;QAEF,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,CAAC,KAAY;QAChB,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,MAA8B,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAE/E,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IAED,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,QAAQ,IAAI,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @copyright (c) 2022-2024 Theodore Kruczek Permission is
|
|
5
|
+
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
|
+
* software and associated documentation files (the "Software"), to deal in the
|
|
7
|
+
* Software without restriction, including without limitation the rights to use,
|
|
8
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
* the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
* so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
|
13
|
+
* all copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
import { Degrees, SensorParams } from 'ootk-core';
|
|
24
|
+
export interface RfSensorParams extends SensorParams {
|
|
25
|
+
coneHalfAngle: Degrees;
|
|
26
|
+
boresightAz: Degrees;
|
|
27
|
+
boresightEl: Degrees;
|
|
28
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @copyright (c) 2022-2024 Theodore Kruczek Permission is
|
|
5
|
+
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
|
+
* software and associated documentation files (the "Software"), to deal in the
|
|
7
|
+
* Software without restriction, including without limitation the rights to use,
|
|
8
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
* the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
* so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
|
13
|
+
* all copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=RfSensorParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RfSensorParams.js","sourceRoot":"","sources":["../../src/interfaces/RfSensorParams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { RfSensorParams } from './RfSensorParams';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
import { PositionVelocity, Seconds } from 'ootk-core';
|
|
18
|
+
export declare class ChebyshevCoefficients {
|
|
19
|
+
a: Seconds;
|
|
20
|
+
b: Seconds;
|
|
21
|
+
private cx_;
|
|
22
|
+
private cy_;
|
|
23
|
+
private cz_;
|
|
24
|
+
cxd_: Float64Array;
|
|
25
|
+
cyd_: Float64Array;
|
|
26
|
+
czd_: Float64Array;
|
|
27
|
+
constructor(a: Seconds, b: Seconds, cx_: Float64Array, cy_: Float64Array, cz_: Float64Array);
|
|
28
|
+
/**
|
|
29
|
+
* Calculates the derivative of a polynomial represented by Chebyshev coefficients.
|
|
30
|
+
* @param a - The lower bound of the polynomial's domain.
|
|
31
|
+
* @param b - The upper bound of the polynomial's domain.
|
|
32
|
+
* @param c - The Chebyshev coefficients of the polynomial.
|
|
33
|
+
* @returns The derivative of the polynomial as an array of coefficients.
|
|
34
|
+
*/
|
|
35
|
+
private static _derivative;
|
|
36
|
+
get sizeBytes(): number;
|
|
37
|
+
/**
|
|
38
|
+
* Evaluates the Chebyshev polynomial represented by the given coefficients at the specified value.
|
|
39
|
+
* @param c - The coefficients of the Chebyshev polynomial.
|
|
40
|
+
* @param t - The value at which to evaluate the polynomial _(POSIX seconds)_.
|
|
41
|
+
* @returns The result of evaluating the polynomial at the specified value.
|
|
42
|
+
*/
|
|
43
|
+
evaluate(c: Float64Array, t: number): number;
|
|
44
|
+
/**
|
|
45
|
+
* Interpolates the position and velocity at a given time (km, km/s).
|
|
46
|
+
* @param t - The time value to interpolate at _(POSIX seconds)_.
|
|
47
|
+
* @returns An object containing the interpolated position and velocity.
|
|
48
|
+
*/
|
|
49
|
+
interpolate(t: number): PositionVelocity;
|
|
50
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
import { Vector3D } from 'ootk-core';
|
|
18
|
+
// / Chebyshev compressed ephemeris coefficients.
|
|
19
|
+
export class ChebyshevCoefficients {
|
|
20
|
+
a;
|
|
21
|
+
b;
|
|
22
|
+
cx_;
|
|
23
|
+
cy_;
|
|
24
|
+
cz_;
|
|
25
|
+
cxd_;
|
|
26
|
+
cyd_;
|
|
27
|
+
czd_;
|
|
28
|
+
// / Create a new [ChebyshevCoefficients] object.
|
|
29
|
+
constructor(a, b, cx_, cy_, cz_) {
|
|
30
|
+
this.a = a;
|
|
31
|
+
this.b = b;
|
|
32
|
+
this.cx_ = cx_;
|
|
33
|
+
this.cy_ = cy_;
|
|
34
|
+
this.cz_ = cz_;
|
|
35
|
+
this.cxd_ = ChebyshevCoefficients._derivative(a, b, cx_);
|
|
36
|
+
this.cyd_ = ChebyshevCoefficients._derivative(a, b, cy_);
|
|
37
|
+
this.czd_ = ChebyshevCoefficients._derivative(a, b, cz_);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Calculates the derivative of a polynomial represented by Chebyshev coefficients.
|
|
41
|
+
* @param a - The lower bound of the polynomial's domain.
|
|
42
|
+
* @param b - The upper bound of the polynomial's domain.
|
|
43
|
+
* @param c - The Chebyshev coefficients of the polynomial.
|
|
44
|
+
* @returns The derivative of the polynomial as an array of coefficients.
|
|
45
|
+
*/
|
|
46
|
+
static _derivative(a, b, c) {
|
|
47
|
+
const n = c.length;
|
|
48
|
+
const d = new Float64Array(n);
|
|
49
|
+
d[n - 1] = 0;
|
|
50
|
+
d[n - 2] = 2 * (n - 1) * c[n - 1];
|
|
51
|
+
for (let k = n - 3; k >= 0; k--) {
|
|
52
|
+
d[k] = d[k + 2] + 2 * (k + 1) * c[k + 1];
|
|
53
|
+
}
|
|
54
|
+
for (let k = 0; k < n; k++) {
|
|
55
|
+
d[k] *= 2 / (b - a);
|
|
56
|
+
}
|
|
57
|
+
return d;
|
|
58
|
+
}
|
|
59
|
+
// / Return the size _(bytes)_ of this coefficient set's cached data.
|
|
60
|
+
get sizeBytes() {
|
|
61
|
+
return (64 * 2 + 64 * 3 * this.cx_.length) / 8;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Evaluates the Chebyshev polynomial represented by the given coefficients at the specified value.
|
|
65
|
+
* @param c - The coefficients of the Chebyshev polynomial.
|
|
66
|
+
* @param t - The value at which to evaluate the polynomial _(POSIX seconds)_.
|
|
67
|
+
* @returns The result of evaluating the polynomial at the specified value.
|
|
68
|
+
*/
|
|
69
|
+
evaluate(c, t) {
|
|
70
|
+
const n = c.length;
|
|
71
|
+
const x = (t - 0.5 * (this.b + this.a)) / (0.5 * (this.b - this.a));
|
|
72
|
+
const alpha = 2 * x;
|
|
73
|
+
const beta = -1;
|
|
74
|
+
let y1 = 0.0;
|
|
75
|
+
let y2 = 0.0;
|
|
76
|
+
for (let k = n - 1; k >= 1; k--) {
|
|
77
|
+
const tmp = y1;
|
|
78
|
+
y1 = alpha * y1 + beta * y2 + c[k];
|
|
79
|
+
y2 = tmp;
|
|
80
|
+
}
|
|
81
|
+
return x * y1 - y2 + 0.5 * c[0];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Interpolates the position and velocity at a given time (km, km/s).
|
|
85
|
+
* @param t - The time value to interpolate at _(POSIX seconds)_.
|
|
86
|
+
* @returns An object containing the interpolated position and velocity.
|
|
87
|
+
*/
|
|
88
|
+
interpolate(t) {
|
|
89
|
+
const pos = new Vector3D(this.evaluate(this.cx_, t), this.evaluate(this.cy_, t), this.evaluate(this.cz_, t));
|
|
90
|
+
const vel = new Vector3D(this.evaluate(this.cxd_, t), this.evaluate(this.cyd_, t), this.evaluate(this.czd_, t));
|
|
91
|
+
return { position: pos, velocity: vel };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=ChebyshevCoefficients.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChebyshevCoefficients.js","sourceRoot":"","sources":["../../src/interpolator/ChebyshevCoefficients.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAA8D,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEjG,iDAAiD;AACjD,MAAM,OAAO,qBAAqB;IAMvB;IACA;IACC;IACA;IACA;IATV,IAAI,CAAe;IACnB,IAAI,CAAe;IACnB,IAAI,CAAe;IACnB,iDAAiD;IACjD,YACS,CAAU,EACV,CAAU,EACT,GAAiB,EACjB,GAAiB,EACjB,GAAiB;QAJlB,MAAC,GAAD,CAAC,CAAS;QACV,MAAC,GAAD,CAAC,CAAS;QACT,QAAG,GAAH,GAAG,CAAc;QACjB,QAAG,GAAH,GAAG,CAAc;QACjB,QAAG,GAAH,GAAG,CAAc;QAEzB,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AG,GAAG,IAAI,QAAQ,CACtB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAwB,EAClD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAwB,EAClD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAwB,CACnD,CAAC;QAEF,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
import { EpochUTC, EpochWindow, J2000 } from 'ootk-core';
|
|
18
|
+
import { ChebyshevCoefficients } from './ChebyshevCoefficients';
|
|
19
|
+
import { StateInterpolator } from './StateInterpolator';
|
|
20
|
+
/**
|
|
21
|
+
* Compressed Chebyshev ephemeris interpolator.
|
|
22
|
+
*
|
|
23
|
+
* The ChebyshevInterpolator sacrifices state accuracy in order to gain
|
|
24
|
+
* speed and memory requirements, so you can store many ephemerides in RAM
|
|
25
|
+
* and interpolate through them quickly.
|
|
26
|
+
*
|
|
27
|
+
* Using more coefficients per revolution during lossy compression results
|
|
28
|
+
* in increased accuracy and decreased performance.
|
|
29
|
+
*/
|
|
30
|
+
export declare class ChebyshevInterpolator extends StateInterpolator {
|
|
31
|
+
private _coefficients;
|
|
32
|
+
constructor(coefficients: ChebyshevCoefficients[]);
|
|
33
|
+
private _calcSizeBytes;
|
|
34
|
+
get sizeBytes(): number;
|
|
35
|
+
interpolate(epoch: EpochUTC): J2000 | null;
|
|
36
|
+
window(): EpochWindow;
|
|
37
|
+
private _matchCoefficients;
|
|
38
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
import { EpochUTC, EpochWindow, J2000 } from 'ootk-core';
|
|
18
|
+
import { StateInterpolator } from './StateInterpolator';
|
|
19
|
+
/**
|
|
20
|
+
* Compressed Chebyshev ephemeris interpolator.
|
|
21
|
+
*
|
|
22
|
+
* The ChebyshevInterpolator sacrifices state accuracy in order to gain
|
|
23
|
+
* speed and memory requirements, so you can store many ephemerides in RAM
|
|
24
|
+
* and interpolate through them quickly.
|
|
25
|
+
*
|
|
26
|
+
* Using more coefficients per revolution during lossy compression results
|
|
27
|
+
* in increased accuracy and decreased performance.
|
|
28
|
+
*/
|
|
29
|
+
export class ChebyshevInterpolator extends StateInterpolator {
|
|
30
|
+
_coefficients;
|
|
31
|
+
constructor(coefficients) {
|
|
32
|
+
super();
|
|
33
|
+
this._coefficients = coefficients;
|
|
34
|
+
}
|
|
35
|
+
_calcSizeBytes() {
|
|
36
|
+
let output = 0;
|
|
37
|
+
for (const coeffs of this._coefficients) {
|
|
38
|
+
output += coeffs.sizeBytes;
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
41
|
+
}
|
|
42
|
+
get sizeBytes() {
|
|
43
|
+
return this._calcSizeBytes();
|
|
44
|
+
}
|
|
45
|
+
interpolate(epoch) {
|
|
46
|
+
if (!this.inWindow(epoch)) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const coeffs = this._matchCoefficients(epoch.posix);
|
|
50
|
+
const { position: pos, velocity: vel } = coeffs.interpolate(epoch.posix);
|
|
51
|
+
return new J2000(epoch, pos, vel);
|
|
52
|
+
}
|
|
53
|
+
window() {
|
|
54
|
+
return new EpochWindow(new EpochUTC(this._coefficients[0].a), new EpochUTC(this._coefficients[this._coefficients.length - 1].b));
|
|
55
|
+
}
|
|
56
|
+
_matchCoefficients(posix) {
|
|
57
|
+
let left = 0;
|
|
58
|
+
let right = this._coefficients.length;
|
|
59
|
+
while (left < right) {
|
|
60
|
+
const middle = (left + right) >> 1;
|
|
61
|
+
if (this._coefficients[middle].b < posix) {
|
|
62
|
+
left = middle + 1;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
right = middle;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return this._coefficients[left];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=ChebyshevInterpolator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AI,CAAC,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAClE,CAAC;IACJ,CAAC;IAEO,kBAAkB,CAAC,KAAa;QACtC,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,IAAI,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;QAEtC,OAAO,IAAI,GAAG,KAAK,EAAE;YACnB,MAAM,MAAM,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE;gBACxC,IAAI,GAAG,MAAM,GAAG,CAAC,CAAC;aACnB;iBAAM;gBACL,KAAK,GAAG,MAAM,CAAC;aAChB;SACF;QAED,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
import { Seconds, Vector3D } from 'ootk-core';
|
|
18
|
+
export declare class CubicSpline {
|
|
19
|
+
t0: Seconds;
|
|
20
|
+
p0: Vector3D;
|
|
21
|
+
m0: Vector3D;
|
|
22
|
+
t1: Seconds;
|
|
23
|
+
p1: Vector3D;
|
|
24
|
+
m1: Vector3D;
|
|
25
|
+
constructor(t0: Seconds, p0: Vector3D, m0: Vector3D, t1: Seconds, p1: Vector3D, m1: Vector3D);
|
|
26
|
+
private position_;
|
|
27
|
+
private velocity_;
|
|
28
|
+
/**
|
|
29
|
+
* Interpolates the position and velocity at a given time.
|
|
30
|
+
* (km) and velocity (km/s) vectors at the provided time.
|
|
31
|
+
* @param t The time value to interpolate at _(POSIX seconds)_.
|
|
32
|
+
* @returns An array containing the interpolated position and velocity as Vector3D objects.
|
|
33
|
+
*/
|
|
34
|
+
interpolate(t: Seconds): Vector3D[];
|
|
35
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
// / Container for cubic spline data.
|
|
18
|
+
export class CubicSpline {
|
|
19
|
+
t0;
|
|
20
|
+
p0;
|
|
21
|
+
m0;
|
|
22
|
+
t1;
|
|
23
|
+
p1;
|
|
24
|
+
m1;
|
|
25
|
+
// / Create a new [CubicSpline] object.
|
|
26
|
+
constructor(t0, p0, m0, t1, p1, m1) {
|
|
27
|
+
this.t0 = t0;
|
|
28
|
+
this.p0 = p0;
|
|
29
|
+
this.m0 = m0;
|
|
30
|
+
this.t1 = t1;
|
|
31
|
+
this.p1 = p1;
|
|
32
|
+
this.m1 = m1;
|
|
33
|
+
// Nothing to do here.
|
|
34
|
+
}
|
|
35
|
+
// / Interpolate position at the provided time [t] _(POSIX seconds)_.
|
|
36
|
+
position_(t) {
|
|
37
|
+
const t2 = t * t;
|
|
38
|
+
const t3 = t2 * t;
|
|
39
|
+
const r0 = this.p0.scale(2 * t3 - 3 * t2 + 1);
|
|
40
|
+
const v0 = this.m0.scale((t3 - 2 * t2 + t) * (this.t1 - this.t0));
|
|
41
|
+
const r1 = this.p1.scale(-2 * t3 + 3 * t2);
|
|
42
|
+
const v1 = this.m1.scale((t3 - t2) * (this.t1 - this.t0));
|
|
43
|
+
return r0.add(v0).add(r1).add(v1);
|
|
44
|
+
}
|
|
45
|
+
// / Interpolate velocity at the provided time [t] _(POSIX seconds)_.
|
|
46
|
+
velocity_(t) {
|
|
47
|
+
const t2 = t * t;
|
|
48
|
+
const r0 = this.p0.scale(6 * t2 - 6 * t);
|
|
49
|
+
const v0 = this.m0.scale((3 * t2 - 4 * t + 1) * (this.t1 - this.t0));
|
|
50
|
+
const r1 = this.p1.scale(-6 * t2 + 6 * t);
|
|
51
|
+
const v1 = this.m1.scale((3 * t2 - 2 * t) * (this.t1 - this.t0));
|
|
52
|
+
return r0
|
|
53
|
+
.add(v0)
|
|
54
|
+
.add(r1)
|
|
55
|
+
.add(v1)
|
|
56
|
+
.scale(1 / (this.t1 - this.t0));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Interpolates the position and velocity at a given time.
|
|
60
|
+
* (km) and velocity (km/s) vectors at the provided time.
|
|
61
|
+
* @param t The time value to interpolate at _(POSIX seconds)_.
|
|
62
|
+
* @returns An array containing the interpolated position and velocity as Vector3D objects.
|
|
63
|
+
*/
|
|
64
|
+
interpolate(t) {
|
|
65
|
+
const n = (t - this.t0) / (this.t1 - this.t0);
|
|
66
|
+
return [this.position_(n), this.velocity_(n)];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=CubicSpline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubicSpline.js","sourceRoot":"","sources":["../../src/interpolator/CubicSpline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,qCAAqC;AACrC,MAAM,OAAO,WAAW;IAGb;IACA;IACA;IACA;IACA;IACA;IAPT,uCAAuC;IACvC,YACS,EAAW,EACX,EAAY,EACZ,EAAY,EACZ,EAAW,EACX,EAAY,EACZ,EAAY;QALZ,OAAE,GAAF,EAAE,CAAS;QACX,OAAE,GAAF,EAAE,CAAU;QACZ,OAAE,GAAF,EAAE,CAAU;QACZ,OAAE,GAAF,EAAE,CAAS;QACX,OAAE,GAAF,EAAE,CAAU;QACZ,OAAE,GAAF,EAAE,CAAU;QAEnB,sBAAsB;IACxB,CAAC;IAED,qEAAqE;IAC7D,SAAS,CAAC,CAAU;QAC1B,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;QACjB,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAClB,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC9C,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAClE,MAAM,EA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AAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAkC,CAAC;IACrE,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,CAAU;QACpB,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAY,CAAC;QAEzD,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
import { EpochUTC, EpochWindow, J2000 } from 'ootk-core';
|
|
18
|
+
import { CubicSpline } from './CubicSpline';
|
|
19
|
+
import { StateInterpolator } from './StateInterpolator';
|
|
20
|
+
/**
|
|
21
|
+
* Cubic spline ephemeris interpolator.
|
|
22
|
+
*
|
|
23
|
+
* The [CubicSplineInterpolator] is a very fast and accurate interpolator
|
|
24
|
+
* at the expense of memory due to the cached spline pairs used in the
|
|
25
|
+
* interpolation operation. Accuracy is significantly impacted when using
|
|
26
|
+
* sparse ephemerides.
|
|
27
|
+
*/
|
|
28
|
+
export declare class CubicSplineInterpolator extends StateInterpolator {
|
|
29
|
+
private _splines;
|
|
30
|
+
constructor(_splines: CubicSpline[]);
|
|
31
|
+
static fromEphemeris(ephemeris: J2000[]): CubicSplineInterpolator;
|
|
32
|
+
get sizeBytes(): number;
|
|
33
|
+
private matchSpline_;
|
|
34
|
+
interpolate(epoch: EpochUTC): J2000 | null;
|
|
35
|
+
window(): EpochWindow;
|
|
36
|
+
}
|