ootk 5.1.0 → 6.0.0-rc.2
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/.claude/PROMPT.md +13 -0
- package/.claude/hooks/post-tool-use.ts +33 -0
- package/.claude/hooks/user-prompt-submit.ts +138 -0
- package/.claude/settings.local.json +13 -0
- package/.claude/skill-rules.json +11 -0
- package/.claude/skills/ootk-dev/SKILL.md +16 -0
- package/ADVANCED_FEATURES_GUIDE.md +1025 -0
- package/CHANGELOG.md +42 -3
- package/README.md +77 -45
- package/dist/body/Celestial.d.ts +2 -2
- package/dist/body/Celestial.js +2 -2
- package/dist/body/Celestial.js.map +1 -1
- package/dist/body/Earth.d.ts +4 -4
- package/dist/body/Earth.js +2 -2
- package/dist/body/Earth.js.map +1 -1
- package/dist/body/Moon.d.ts +3 -3
- package/dist/body/Moon.js +7 -7
- package/dist/body/Moon.js.map +1 -1
- package/dist/body/NutationAngles.d.ts +2 -2
- package/dist/body/NutationAngles.js +1 -1
- package/dist/body/PrecessionAngles.d.ts +2 -2
- package/dist/body/PrecessionAngles.js +1 -1
- package/dist/body/Sun.d.ts +2 -2
- package/dist/body/Sun.js +3 -3
- package/dist/body/Sun.js.map +1 -1
- package/dist/body/index.d.ts +5 -5
- package/dist/body/index.js +5 -5
- package/dist/body/index.js.map +1 -1
- package/dist/conjunction/ConjunctionAssessment.d.ts +156 -0
- package/dist/conjunction/ConjunctionAssessment.js +281 -0
- package/dist/conjunction/ConjunctionAssessment.js.map +1 -0
- package/dist/conjunction/ConjunctionEvent.d.ts +104 -0
- package/dist/conjunction/ConjunctionEvent.js +156 -0
- package/dist/conjunction/ConjunctionEvent.js.map +1 -0
- package/dist/conjunction/ProbabilityOfCollision.d.ts +102 -0
- package/dist/conjunction/ProbabilityOfCollision.js +240 -0
- package/dist/conjunction/ProbabilityOfCollision.js.map +1 -0
- package/dist/conjunction/index.d.ts +19 -0
- package/dist/conjunction/index.js +20 -0
- package/dist/conjunction/index.js.map +1 -0
- package/dist/coordinate/ClassicalElements.d.ts +7 -7
- package/dist/coordinate/ClassicalElements.js +7 -7
- package/dist/coordinate/ClassicalElements.js.map +1 -1
- package/dist/coordinate/EquinoctialElements.d.ts +5 -5
- package/dist/coordinate/EquinoctialElements.js +4 -4
- package/dist/coordinate/EquinoctialElements.js.map +1 -1
- package/dist/coordinate/FormatTle.d.ts +2 -2
- package/dist/coordinate/FormatTle.js +2 -2
- package/dist/coordinate/FormatTle.js.map +1 -1
- package/dist/coordinate/Geodetic.d.ts +4 -4
- package/dist/coordinate/Geodetic.js +7 -7
- package/dist/coordinate/Geodetic.js.map +1 -1
- package/dist/coordinate/Hill.d.ts +4 -4
- package/dist/coordinate/Hill.js +3 -3
- package/dist/coordinate/Hill.js.map +1 -1
- package/dist/coordinate/ITRF.d.ts +5 -5
- package/dist/coordinate/ITRF.js +6 -5
- package/dist/coordinate/ITRF.js.map +1 -1
- package/dist/coordinate/J2000.d.ts +5 -5
- package/dist/coordinate/J2000.js +5 -5
- package/dist/coordinate/J2000.js.map +1 -1
- package/dist/coordinate/RIC.d.ts +4 -4
- package/dist/coordinate/RIC.js +3 -3
- package/dist/coordinate/RIC.js.map +1 -1
- package/dist/coordinate/RelativeState.d.ts +5 -5
- package/dist/coordinate/RelativeState.js +2 -2
- package/dist/coordinate/RelativeState.js.map +1 -1
- package/dist/coordinate/StateVector.d.ts +2 -2
- package/dist/coordinate/StateVector.js +2 -2
- package/dist/coordinate/StateVector.js.map +1 -1
- package/dist/coordinate/TEME.d.ts +4 -4
- package/dist/coordinate/TEME.js +4 -4
- package/dist/coordinate/TEME.js.map +1 -1
- package/dist/coordinate/Tle.d.ts +5 -5
- package/dist/coordinate/Tle.js +9 -9
- package/dist/coordinate/Tle.js.map +1 -1
- package/dist/coordinate/index.d.ts +12 -12
- package/dist/coordinate/index.js +12 -12
- package/dist/coordinate/index.js.map +1 -1
- package/dist/coordinate/tle-format-data.d.ts +1 -1
- package/dist/coordinate/tle-format-data.js +1 -1
- package/dist/covariance/CovarianceSample.d.ts +5 -5
- package/dist/covariance/CovarianceSample.js +5 -5
- package/dist/covariance/CovarianceSample.js.map +1 -1
- package/dist/covariance/StateCovariance.d.ts +2 -2
- package/dist/covariance/StateCovariance.js +2 -2
- package/dist/covariance/StateCovariance.js.map +1 -1
- package/dist/covariance/index.d.ts +2 -2
- package/dist/covariance/index.js +2 -2
- package/dist/covariance/index.js.map +1 -1
- package/dist/data/DataHandler.d.ts +4 -4
- package/dist/data/DataHandler.js +5 -5
- package/dist/data/DataHandler.js.map +1 -1
- package/dist/data/values/Egm96Data.d.ts +1 -1
- package/dist/data/values/Egm96Data.js +3 -3
- package/dist/data/values/Egm96Data.js.map +1 -1
- package/dist/data/values/HpAtmosphereData.d.ts +2 -2
- package/dist/data/values/HpAtmosphereData.js +3 -3
- package/dist/data/values/HpAtmosphereData.js.map +1 -1
- package/dist/data/values/HpAtmosphereResult.d.ts +2 -2
- package/dist/data/values/HpAtmosphereResult.js +1 -1
- package/dist/data/values/Iau1980Data.d.ts +1 -1
- package/dist/data/values/Iau1980Data.js +2 -2
- package/dist/data/values/Iau1980Data.js.map +1 -1
- package/dist/data/values/LeapSecond.d.ts +1 -1
- package/dist/data/values/LeapSecond.js +1 -1
- package/dist/data/values/LeapSecondData.d.ts +2 -2
- package/dist/data/values/LeapSecondData.js +2 -2
- package/dist/data/values/LeapSecondData.js.map +1 -1
- package/dist/data/values/egm96.d.ts +2 -2
- package/dist/data/values/egm96.js +1 -1
- package/dist/data/values/hpAtmosphere.d.ts +2 -2
- package/dist/data/values/hpAtmosphere.js +1 -1
- package/dist/data/values/iau1980.d.ts +2 -2
- package/dist/data/values/iau1980.js +1 -1
- package/dist/enums/AngularDiameterMethod.d.ts +1 -1
- package/dist/enums/AngularDiameterMethod.js +1 -1
- package/dist/enums/AngularDistanceMethod.d.ts +1 -1
- package/dist/enums/AngularDistanceMethod.js +1 -1
- package/dist/enums/OrbitRegime.d.ts +1 -1
- package/dist/enums/OrbitRegime.js +1 -1
- package/dist/enums/PassType.d.ts +1 -1
- package/dist/enums/PassType.js +1 -1
- package/dist/enums/Sgp4OpsMode.d.ts +1 -1
- package/dist/enums/Sgp4OpsMode.js +1 -1
- package/dist/enums/index.d.ts +7 -7
- package/dist/enums/index.js +7 -7
- package/dist/enums/index.js.map +1 -1
- package/dist/fetch/horizons-constants.d.ts +43 -0
- package/dist/fetch/horizons-constants.js +50 -0
- package/dist/fetch/horizons-constants.js.map +1 -0
- package/dist/fetch/horizons-interfaces.d.ts +37 -0
- package/dist/fetch/horizons-interfaces.js +2 -0
- package/dist/fetch/horizons-interfaces.js.map +1 -0
- package/dist/fetch/horizons.d.ts +86 -0
- package/dist/fetch/horizons.js +237 -0
- package/dist/fetch/horizons.js.map +1 -0
- package/dist/force/AtmosphericDrag.d.ts +3 -3
- package/dist/force/AtmosphericDrag.js +2 -2
- package/dist/force/AtmosphericDrag.js.map +1 -1
- package/dist/force/EarthGravity.d.ts +3 -3
- package/dist/force/EarthGravity.js +2 -2
- package/dist/force/EarthGravity.js.map +1 -1
- package/dist/force/Force.d.ts +3 -3
- package/dist/force/Force.js +1 -10
- package/dist/force/Force.js.map +1 -1
- package/dist/force/ForceModel.d.ts +3 -3
- package/dist/force/ForceModel.js +7 -7
- package/dist/force/ForceModel.js.map +1 -1
- package/dist/force/Gravity.d.ts +3 -3
- package/dist/force/Gravity.js +2 -2
- package/dist/force/Gravity.js.map +1 -1
- package/dist/force/SolarRadiationPressure.d.ts +3 -3
- package/dist/force/SolarRadiationPressure.js +4 -4
- package/dist/force/SolarRadiationPressure.js.map +1 -1
- package/dist/force/ThirdBodyGravity.d.ts +3 -3
- package/dist/force/ThirdBodyGravity.js +2 -2
- package/dist/force/ThirdBodyGravity.js.map +1 -1
- package/dist/force/Thrust.d.ts +3 -3
- package/dist/force/Thrust.js +2 -2
- package/dist/force/Thrust.js.map +1 -1
- package/dist/force/index.d.ts +1 -1
- package/dist/force/index.js +1 -1
- package/dist/force/index.js.map +1 -1
- package/dist/interfaces/BaseObjectParams.d.ts +2 -2
- package/dist/interfaces/BaseObjectParams.js +1 -1
- package/dist/interfaces/ClassicalElementsParams.d.ts +2 -2
- package/dist/interfaces/ClassicalElementsParams.js +1 -1
- package/dist/interfaces/EquinoctialElementsParams.d.ts +2 -2
- package/dist/interfaces/EquinoctialElementsParams.js +1 -1
- package/dist/interfaces/GroundPositionParams.d.ts +2 -2
- package/dist/interfaces/GroundPositionParams.js +1 -1
- package/dist/interfaces/RfSensorParams.d.ts +2 -2
- package/dist/interfaces/SatelliteParams.d.ts +2 -2
- package/dist/interfaces/SensorParams.d.ts +2 -2
- package/dist/interfaces/StarObjectParams.d.ts +1 -1
- package/dist/interfaces/TimeVariables.d.ts +1 -1
- package/dist/interfaces/index.d.ts +9 -9
- package/dist/interpolator/ChebyshevCoefficients.d.ts +2 -2
- package/dist/interpolator/ChebyshevCoefficients.js +2 -2
- package/dist/interpolator/ChebyshevCoefficients.js.map +1 -1
- package/dist/interpolator/ChebyshevInterpolator.d.ts +4 -4
- package/dist/interpolator/ChebyshevInterpolator.js +3 -3
- package/dist/interpolator/ChebyshevInterpolator.js.map +1 -1
- package/dist/interpolator/CubicSpline.d.ts +2 -2
- package/dist/interpolator/CubicSpline.js +1 -1
- package/dist/interpolator/CubicSplineInterpolator.d.ts +4 -4
- package/dist/interpolator/CubicSplineInterpolator.js +4 -4
- package/dist/interpolator/CubicSplineInterpolator.js.map +1 -1
- package/dist/interpolator/FieldInterpolator.d.ts +3 -3
- package/dist/interpolator/FieldInterpolator.js +2 -12
- package/dist/interpolator/FieldInterpolator.js.map +1 -1
- package/dist/interpolator/Interpolator.d.ts +2 -2
- package/dist/interpolator/Interpolator.js +2 -2
- package/dist/interpolator/Interpolator.js.map +1 -1
- package/dist/interpolator/LagrangeInterpolator.d.ts +3 -3
- package/dist/interpolator/LagrangeInterpolator.js +3 -3
- package/dist/interpolator/LagrangeInterpolator.js.map +1 -1
- package/dist/interpolator/StateInterpolator.d.ts +4 -4
- package/dist/interpolator/StateInterpolator.js +2 -10
- package/dist/interpolator/StateInterpolator.js.map +1 -1
- package/dist/interpolator/VerletBlendInterpolator.d.ts +5 -5
- package/dist/interpolator/VerletBlendInterpolator.js +5 -5
- package/dist/interpolator/VerletBlendInterpolator.js.map +1 -1
- package/dist/main.d.ts +20 -20
- package/dist/main.js +21 -20
- package/dist/main.js.map +1 -1
- package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +3 -3
- package/dist/maneuver/TwoBurnOrbitTransfer.js +3 -3
- package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -1
- package/dist/maneuver/Waypoint.d.ts +5 -5
- package/dist/maneuver/Waypoint.js +7 -7
- package/dist/maneuver/Waypoint.js.map +1 -1
- package/dist/objects/BaseObject.d.ts +3 -3
- package/dist/objects/BaseObject.js +2 -2
- package/dist/objects/BaseObject.js.map +1 -1
- package/dist/objects/DetailedSatellite.d.ts +4 -4
- package/dist/objects/DetailedSatellite.js +4 -4
- package/dist/objects/DetailedSatellite.js.map +1 -1
- package/dist/objects/DetailedSensor.d.ts +5 -5
- package/dist/objects/DetailedSensor.js +2 -2
- package/dist/objects/DetailedSensor.js.map +1 -1
- package/dist/objects/GroundObject.d.ts +4 -4
- package/dist/objects/GroundObject.js +3 -3
- package/dist/objects/GroundObject.js.map +1 -1
- package/dist/objects/LandObject.d.ts +3 -3
- package/dist/objects/LandObject.js +2 -2
- package/dist/objects/LandObject.js.map +1 -1
- package/dist/objects/Marker.d.ts +2 -2
- package/dist/objects/Marker.js +2 -2
- package/dist/objects/Marker.js.map +1 -1
- package/dist/objects/RfSensor.d.ts +2 -2
- package/dist/objects/RfSensor.js +2 -2
- package/dist/objects/RfSensor.js.map +1 -1
- package/dist/objects/Satellite.d.ts +12 -12
- package/dist/objects/Satellite.js +14 -14
- package/dist/objects/Satellite.js.map +1 -1
- package/dist/objects/Sensor.d.ts +6 -6
- package/dist/objects/Sensor.js +5 -5
- package/dist/objects/Sensor.js.map +1 -1
- package/dist/objects/Star.d.ts +3 -3
- package/dist/objects/Star.js +3 -3
- package/dist/objects/Star.js.map +1 -1
- package/dist/objects/index.d.ts +10 -10
- package/dist/objects/index.js +10 -10
- package/dist/objects/index.js.map +1 -1
- package/dist/observation/Observation.d.ts +11 -11
- package/dist/observation/Observation.js +1 -52
- package/dist/observation/Observation.js.map +1 -1
- package/dist/observation/ObservationOptical.d.ts +6 -6
- package/dist/observation/ObservationOptical.js +4 -4
- package/dist/observation/ObservationOptical.js.map +1 -1
- package/dist/observation/ObservationRadar.d.ts +6 -6
- package/dist/observation/ObservationRadar.js +4 -4
- package/dist/observation/ObservationRadar.js.map +1 -1
- package/dist/observation/ObservationUtils.d.ts +2 -2
- package/dist/observation/ObservationUtils.js +2 -2
- package/dist/observation/ObservationUtils.js.map +1 -1
- package/dist/observation/PropagatorPairs.d.ts +2 -2
- package/dist/observation/PropagatorPairs.js +1 -1
- package/dist/observation/RAE.d.ts +6 -6
- package/dist/observation/RAE.js +6 -6
- package/dist/observation/RAE.js.map +1 -1
- package/dist/observation/RadecGeocentric.d.ts +6 -6
- package/dist/observation/RadecGeocentric.js +5 -5
- package/dist/observation/RadecGeocentric.js.map +1 -1
- package/dist/observation/RadecTopocentric.d.ts +6 -6
- package/dist/observation/RadecTopocentric.js +9 -7
- package/dist/observation/RadecTopocentric.js.map +1 -1
- package/dist/observation/index.d.ts +5 -5
- package/dist/observation/index.js +5 -5
- package/dist/observation/index.js.map +1 -1
- package/dist/operations/BoxMuller.d.ts +2 -2
- package/dist/operations/BoxMuller.js +2 -2
- package/dist/operations/BoxMuller.js.map +1 -1
- package/dist/operations/EulerAngles.d.ts +2 -2
- package/dist/operations/EulerAngles.js +2 -2
- package/dist/operations/EulerAngles.js.map +1 -1
- package/dist/operations/Matrix.d.ts +2 -2
- package/dist/operations/Matrix.js +2 -2
- package/dist/operations/Matrix.js.map +1 -1
- package/dist/operations/Quaternion.d.ts +2 -2
- package/dist/operations/Quaternion.js +2 -2
- package/dist/operations/Quaternion.js.map +1 -1
- package/dist/operations/Random.d.ts +1 -1
- package/dist/operations/Random.js +1 -1
- package/dist/operations/RandomGaussianSource.d.ts +2 -2
- package/dist/operations/RandomGaussianSource.js +3 -3
- package/dist/operations/RandomGaussianSource.js.map +1 -1
- package/dist/operations/Vector.d.ts +2 -2
- package/dist/operations/Vector.js +2 -2
- package/dist/operations/Vector.js.map +1 -1
- package/dist/operations/Vector3D.d.ts +5 -4
- package/dist/operations/Vector3D.js +5 -4
- package/dist/operations/Vector3D.js.map +1 -1
- package/dist/operations/index.d.ts +4 -4
- package/dist/operations/index.js +4 -4
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/operations.d.ts +5 -5
- package/dist/operations/operations.js +5 -5
- package/dist/operations/operations.js.map +1 -1
- package/dist/optimize/ChebyshevCompressor.d.ts +3 -3
- package/dist/optimize/ChebyshevCompressor.js +4 -4
- package/dist/optimize/ChebyshevCompressor.js.map +1 -1
- package/dist/optimize/DownhillSimplex.d.ts +2 -2
- package/dist/optimize/DownhillSimplex.js +2 -2
- package/dist/optimize/DownhillSimplex.js.map +1 -1
- package/dist/optimize/GoldenSection.d.ts +2 -2
- package/dist/optimize/GoldenSection.js +1 -1
- package/dist/optimize/PolynomialRegression.d.ts +2 -2
- package/dist/optimize/PolynomialRegression.js +4 -4
- package/dist/optimize/PolynomialRegression.js.map +1 -1
- package/dist/optimize/PolynomicalRegressionResult.d.ts +1 -1
- package/dist/optimize/PolynomicalRegressionResult.js +1 -1
- package/dist/optimize/SimpleLinearRegression.d.ts +1 -1
- package/dist/optimize/SimpleLinearRegression.js +1 -1
- package/dist/optimize/SimplexEntry.d.ts +1 -1
- package/dist/optimize/SimplexEntry.js +2 -2
- package/dist/optimize/SimplexEntry.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +5 -5
- package/dist/orbit_determination/BatchLeastSquaresOD.js +8 -8
- package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +3 -3
- package/dist/orbit_determination/BatchLeastSquaresResult.js +1 -1
- package/dist/orbit_determination/GaussIOD.d.ts +98 -0
- package/dist/orbit_determination/GaussIOD.js +291 -0
- package/dist/orbit_determination/GaussIOD.js.map +1 -0
- package/dist/orbit_determination/GibbsIOD.d.ts +2 -2
- package/dist/orbit_determination/GibbsIOD.js +4 -4
- package/dist/orbit_determination/GibbsIOD.js.map +1 -1
- package/dist/orbit_determination/GoodingIOD.d.ts +58 -8
- package/dist/orbit_determination/GoodingIOD.js +225 -35
- package/dist/orbit_determination/GoodingIOD.js.map +1 -1
- package/dist/orbit_determination/HerrickGibbsIOD.d.ts +2 -2
- package/dist/orbit_determination/HerrickGibbsIOD.js +2 -2
- package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -1
- package/dist/orbit_determination/LambertIOD.d.ts +2 -2
- package/dist/orbit_determination/LambertIOD.js +2 -2
- package/dist/orbit_determination/LambertIOD.js.map +1 -1
- package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +3 -3
- package/dist/orbit_determination/ModifiedGoodingIOD.js +8 -8
- package/dist/orbit_determination/ModifiedGoodingIOD.js.map +1 -1
- package/dist/orbit_determination/index.d.ts +7 -7
- package/dist/orbit_determination/index.js +7 -7
- package/dist/orbit_determination/index.js.map +1 -1
- package/dist/propagator/DormandPrince54Propagator.d.ts +2 -2
- package/dist/propagator/DormandPrince54Propagator.js +2 -2
- package/dist/propagator/DormandPrince54Propagator.js.map +1 -1
- package/dist/propagator/KeplerPropagator.d.ts +6 -6
- package/dist/propagator/KeplerPropagator.js +6 -7
- package/dist/propagator/KeplerPropagator.js.map +1 -1
- package/dist/propagator/Propagator.d.ts +5 -5
- package/dist/propagator/Propagator.js +5 -5
- package/dist/propagator/Propagator.js.map +1 -1
- package/dist/propagator/RkCheckpoint.d.ts +2 -2
- package/dist/propagator/RkCheckpoint.js +1 -1
- package/dist/propagator/RkResult.d.ts +2 -2
- package/dist/propagator/RkResult.js +1 -1
- package/dist/propagator/RungeKutta4Propagator.d.ts +6 -6
- package/dist/propagator/RungeKutta4Propagator.js +5 -5
- package/dist/propagator/RungeKutta4Propagator.js.map +1 -1
- package/dist/propagator/RungeKutta89Propagator.d.ts +2 -2
- package/dist/propagator/RungeKutta89Propagator.js +2 -2
- package/dist/propagator/RungeKutta89Propagator.js.map +1 -1
- package/dist/propagator/RungeKuttaAdaptive.d.ts +6 -6
- package/dist/propagator/RungeKuttaAdaptive.js +52 -9
- package/dist/propagator/RungeKuttaAdaptive.js.map +1 -1
- package/dist/propagator/Sgp4Propagator.d.ts +7 -7
- package/dist/propagator/Sgp4Propagator.js +4 -4
- package/dist/propagator/Sgp4Propagator.js.map +1 -1
- package/dist/propagator/index.d.ts +3 -3
- package/dist/propagator/index.js +3 -3
- package/dist/propagator/index.js.map +1 -1
- package/dist/sgp4/index.d.ts +2 -2
- package/dist/sgp4/index.js +2 -2
- package/dist/sgp4/index.js.map +1 -1
- package/dist/sgp4/sgp4.d.ts +3 -3
- package/dist/sgp4/sgp4.js +11 -5
- package/dist/sgp4/sgp4.js.map +1 -1
- package/dist/smoothing/ExponentialSmoothing.d.ts +2 -2
- package/dist/smoothing/ExponentialSmoothing.js +1 -1
- package/dist/time/Epoch.d.ts +2 -2
- package/dist/time/Epoch.js +2 -2
- package/dist/time/Epoch.js.map +1 -1
- package/dist/time/EpochGPS.d.ts +3 -3
- package/dist/time/EpochGPS.js +3 -3
- package/dist/time/EpochGPS.js.map +1 -1
- package/dist/time/EpochTAI.d.ts +2 -2
- package/dist/time/EpochTAI.js +2 -2
- package/dist/time/EpochTAI.js.map +1 -1
- package/dist/time/EpochTDB.d.ts +2 -2
- package/dist/time/EpochTDB.js +2 -2
- package/dist/time/EpochTDB.js.map +1 -1
- package/dist/time/EpochTT.d.ts +2 -2
- package/dist/time/EpochTT.js +2 -2
- package/dist/time/EpochTT.js.map +1 -1
- package/dist/time/EpochUTC.d.ts +7 -7
- package/dist/time/EpochUTC.js +9 -9
- package/dist/time/EpochUTC.js.map +1 -1
- package/dist/time/EpochWindow.d.ts +2 -2
- package/dist/time/EpochWindow.js +1 -1
- package/dist/time/TimeStamped.d.ts +2 -2
- package/dist/time/TimeStamped.js +1 -1
- package/dist/time/index.d.ts +8 -8
- package/dist/time/index.js +8 -8
- package/dist/time/index.js.map +1 -1
- package/dist/transforms/TransformCache.d.ts +1 -1
- package/dist/transforms/TransformCache.js +1 -1
- package/dist/transforms/conversions.d.ts +2 -2
- package/dist/transforms/conversions.js +2 -2
- package/dist/transforms/conversions.js.map +1 -1
- package/dist/transforms/index.d.ts +2 -2
- package/dist/transforms/index.js +2 -2
- package/dist/transforms/index.js.map +1 -1
- package/dist/transforms/transforms.d.ts +1 -1
- package/dist/transforms/transforms.js +1 -1
- package/dist/transforms/transforms.js.map +1 -1
- package/dist/types/types.d.ts +8 -3
- package/dist/types/types.js +6 -1
- package/dist/types/types.js.map +1 -1
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/create-covariance-from-tle.d.ts +1 -1
- package/dist/utils/create-covariance-from-tle.js +1 -1
- package/dist/utils/create-covariance-from-tle.js.map +1 -1
- package/dist/utils/functions.d.ts +4 -4
- package/dist/utils/functions.js +9 -4
- package/dist/utils/functions.js.map +1 -1
- package/dist/utils/index.d.ts +5 -5
- package/dist/utils/index.js +5 -5
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/jacobian.d.ts +2 -2
- package/dist/utils/jacobian.js +1 -1
- package/dist/utils/jacobian.js.map +1 -1
- package/dist/utils/linearDistance.d.ts +1 -1
- package/docs/README.md +132 -0
- package/docs/getting-started.md +792 -0
- package/docs/lambert-satellite-integration-guide.md +766 -0
- package/docs/user-guide.md +1935 -0
- package/jest.config.mjs +28 -0
- package/package.json +3 -4
- package/src/body/Celestial.ts +2 -2
- package/src/body/Earth.ts +4 -4
- package/src/body/Moon.ts +7 -7
- package/src/body/NutationAngles.ts +2 -2
- package/src/body/PrecessionAngles.ts +2 -2
- package/src/body/Sun.ts +4 -4
- package/src/body/index.ts +6 -5
- package/src/conjunction/ConjunctionAssessment.ts +417 -0
- package/src/conjunction/ConjunctionEvent.ts +149 -0
- package/src/conjunction/ProbabilityOfCollision.ts +300 -0
- package/src/conjunction/index.ts +24 -0
- package/src/coordinate/ClassicalElements.ts +16 -11
- package/src/coordinate/EquinoctialElements.ts +7 -7
- package/src/coordinate/FormatTle.ts +2 -2
- package/src/coordinate/Geodetic.ts +8 -8
- package/src/coordinate/Hill.ts +4 -4
- package/src/coordinate/ITRF.ts +6 -6
- package/src/coordinate/J2000.ts +7 -7
- package/src/coordinate/RIC.ts +4 -4
- package/src/coordinate/RelativeState.ts +5 -5
- package/src/coordinate/StateVector.ts +8 -3
- package/src/coordinate/TEME.ts +6 -6
- package/src/coordinate/Tle.ts +9 -9
- package/src/coordinate/index.ts +13 -12
- package/src/coordinate/tle-format-data.ts +1 -1
- package/src/covariance/CovarianceSample.ts +13 -13
- package/src/covariance/StateCovariance.ts +2 -2
- package/src/covariance/index.ts +3 -2
- package/src/data/DataHandler.ts +6 -6
- package/src/data/values/Egm96Data.ts +3 -3
- package/src/data/values/HpAtmosphereData.ts +3 -3
- package/src/data/values/HpAtmosphereResult.ts +2 -2
- package/src/data/values/Iau1980Data.ts +2 -2
- package/src/data/values/LeapSecond.ts +1 -1
- package/src/data/values/LeapSecondData.ts +2 -2
- package/src/data/values/egm96.ts +2 -2
- package/src/data/values/hpAtmosphere.ts +2 -2
- package/src/data/values/iau1980.ts +2 -2
- package/src/enums/AngularDiameterMethod.ts +1 -1
- package/src/enums/AngularDistanceMethod.ts +1 -1
- package/src/enums/OrbitRegime.ts +1 -1
- package/src/enums/PassType.ts +1 -1
- package/src/enums/Sgp4OpsMode.ts +1 -1
- package/src/enums/index.ts +8 -7
- package/src/fetch/horizons-constants.ts +53 -0
- package/src/fetch/horizons-interfaces.ts +38 -0
- package/src/fetch/horizons.ts +300 -0
- package/src/force/AtmosphericDrag.ts +3 -3
- package/src/force/EarthGravity.ts +3 -3
- package/src/force/Force.ts +3 -5
- package/src/force/ForceModel.ts +9 -9
- package/src/force/Gravity.ts +3 -3
- package/src/force/SolarRadiationPressure.ts +4 -4
- package/src/force/ThirdBodyGravity.ts +3 -3
- package/src/force/Thrust.ts +3 -3
- package/src/force/index.ts +2 -1
- package/src/interfaces/BaseObjectParams.ts +2 -2
- package/src/interfaces/ClassicalElementsParams.ts +2 -2
- package/src/interfaces/EquinoctialElementsParams.ts +2 -2
- package/src/interfaces/GroundPositionParams.ts +2 -2
- package/src/interfaces/RfSensorParams.ts +2 -2
- package/src/interfaces/SatelliteParams.ts +2 -2
- package/src/interfaces/SensorParams.ts +3 -3
- package/src/interfaces/StarObjectParams.ts +1 -1
- package/src/interfaces/TimeVariables.ts +1 -1
- package/src/interfaces/index.ts +10 -9
- package/src/interpolator/ChebyshevCoefficients.ts +2 -2
- package/src/interpolator/ChebyshevInterpolator.ts +4 -4
- package/src/interpolator/CubicSpline.ts +2 -2
- package/src/interpolator/CubicSplineInterpolator.ts +4 -4
- package/src/interpolator/FieldInterpolator.ts +3 -5
- package/src/interpolator/Interpolator.ts +2 -2
- package/src/interpolator/LagrangeInterpolator.ts +3 -3
- package/src/interpolator/StateInterpolator.ts +4 -6
- package/src/interpolator/VerletBlendInterpolator.ts +5 -5
- package/src/main.ts +41 -20
- package/src/maneuver/TwoBurnOrbitTransfer.ts +3 -3
- package/src/maneuver/Waypoint.ts +8 -8
- package/src/objects/BaseObject.ts +3 -3
- package/src/objects/DetailedSatellite.ts +9 -9
- package/src/objects/DetailedSensor.ts +5 -5
- package/src/objects/GroundObject.ts +9 -9
- package/src/objects/LandObject.ts +3 -3
- package/src/objects/Marker.ts +2 -2
- package/src/objects/RfSensor.ts +2 -2
- package/src/objects/Satellite.ts +21 -21
- package/src/objects/Sensor.ts +7 -7
- package/src/objects/Star.ts +3 -3
- package/src/objects/index.ts +11 -10
- package/src/observation/Observation.ts +11 -23
- package/src/observation/ObservationOptical.ts +7 -7
- package/src/observation/ObservationRadar.ts +7 -7
- package/src/observation/ObservationUtils.ts +2 -2
- package/src/observation/PropagatorPairs.ts +2 -2
- package/src/observation/RAE.ts +9 -9
- package/src/observation/RadecGeocentric.ts +9 -9
- package/src/observation/RadecTopocentric.ts +13 -10
- package/src/observation/index.ts +6 -5
- package/src/operations/BoxMuller.ts +2 -2
- package/src/operations/EulerAngles.ts +2 -2
- package/src/operations/Matrix.ts +2 -2
- package/src/operations/Quaternion.ts +2 -2
- package/src/operations/Random.ts +1 -1
- package/src/operations/RandomGaussianSource.ts +3 -3
- package/src/operations/Vector.ts +2 -2
- package/src/operations/Vector3D.ts +6 -4
- package/src/operations/index.ts +5 -4
- package/src/operations/operations.ts +6 -5
- package/src/optimize/ChebyshevCompressor.ts +5 -5
- package/src/optimize/DownhillSimplex.ts +2 -2
- package/src/optimize/GoldenSection.ts +2 -2
- package/src/optimize/PolynomialRegression.ts +4 -4
- package/src/optimize/PolynomicalRegressionResult.ts +1 -1
- package/src/optimize/SimpleLinearRegression.ts +1 -1
- package/src/optimize/SimplexEntry.ts +2 -2
- package/src/orbit_determination/BatchLeastSquaresOD.ts +10 -10
- package/src/orbit_determination/BatchLeastSquaresResult.ts +3 -3
- package/src/orbit_determination/GaussIOD.ts +393 -0
- package/src/orbit_determination/GibbsIOD.ts +4 -4
- package/src/orbit_determination/GoodingIOD.ts +458 -160
- package/src/orbit_determination/HerrickGibbsIOD.ts +2 -2
- package/src/orbit_determination/LambertIOD.ts +2 -2
- package/src/orbit_determination/ModifiedGoodingIOD.ts +33 -22
- package/src/orbit_determination/index.ts +8 -7
- package/src/propagator/DormandPrince54Propagator.ts +2 -2
- package/src/propagator/KeplerPropagator.ts +7 -8
- package/src/propagator/Propagator.ts +6 -6
- package/src/propagator/RkCheckpoint.ts +2 -2
- package/src/propagator/RkResult.ts +2 -2
- package/src/propagator/RungeKutta4Propagator.ts +6 -6
- package/src/propagator/RungeKutta89Propagator.ts +2 -2
- package/src/propagator/RungeKuttaAdaptive.ts +62 -12
- package/src/propagator/Sgp4Propagator.ts +7 -7
- package/src/propagator/index.ts +4 -3
- package/src/sgp4/index.ts +3 -2
- package/src/sgp4/sgp4.ts +6 -6
- package/src/smoothing/ExponentialSmoothing.ts +2 -2
- package/src/time/Epoch.ts +3 -3
- package/src/time/EpochGPS.ts +5 -5
- package/src/time/EpochTAI.ts +2 -2
- package/src/time/EpochTDB.ts +2 -2
- package/src/time/EpochTT.ts +2 -2
- package/src/time/EpochUTC.ts +10 -10
- package/src/time/EpochWindow.ts +2 -2
- package/src/time/TimeStamped.ts +2 -2
- package/src/time/index.ts +9 -8
- package/src/transforms/TransformCache.ts +1 -1
- package/src/transforms/conversions.ts +2 -2
- package/src/transforms/index.ts +3 -2
- package/src/transforms/transforms.ts +4 -4
- package/src/types/types.ts +8 -3
- package/src/utils/constants.ts +2 -2
- package/src/utils/create-covariance-from-tle.ts +1 -1
- package/src/utils/functions.ts +10 -5
- package/src/utils/index.ts +6 -5
- package/src/utils/jacobian.ts +2 -2
- package/src/utils/linearDistance.ts +1 -1
|
@@ -0,0 +1,1935 @@
|
|
|
1
|
+
# OOTK User Guide
|
|
2
|
+
|
|
3
|
+
**Orbital Object Toolkit (ootk)** - Comprehensive Documentation
|
|
4
|
+
|
|
5
|
+
Version: 5.1.1
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
1. [Introduction](#introduction)
|
|
12
|
+
2. [Core Concepts](#core-concepts)
|
|
13
|
+
3. [Satellite Operations](#satellite-operations)
|
|
14
|
+
4. [Sensor Operations](#sensor-operations)
|
|
15
|
+
5. [Coordinate Systems](#coordinate-systems)
|
|
16
|
+
6. [Orbit Propagation](#orbit-propagation)
|
|
17
|
+
7. [Force Models](#force-models)
|
|
18
|
+
8. [Initial Orbit Determination](#initial-orbit-determination)
|
|
19
|
+
9. [Observations](#observations)
|
|
20
|
+
10. [Time Systems](#time-systems)
|
|
21
|
+
11. [Interpolation](#interpolation)
|
|
22
|
+
12. [Mathematical Operations](#mathematical-operations)
|
|
23
|
+
13. [Optimization](#optimization)
|
|
24
|
+
14. [Covariance](#covariance)
|
|
25
|
+
15. [Celestial Bodies](#celestial-bodies)
|
|
26
|
+
16. [Maneuvers](#maneuvers)
|
|
27
|
+
17. [Advanced Topics](#advanced-topics)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Introduction
|
|
32
|
+
|
|
33
|
+
OOTK is a comprehensive TypeScript/JavaScript library for orbital mechanics calculations. Originally developed for the [KeepTrack](https://github.com/thkruz/keeptrack.space) satellite tracking application, it provides a complete toolkit for working with satellites, orbital objects, sensors, and celestial mechanics.
|
|
34
|
+
|
|
35
|
+
### What Can OOTK Do?
|
|
36
|
+
|
|
37
|
+
- **Satellite Tracking**: Parse TLE data and propagate satellite positions using SGP4 or numerical integrators
|
|
38
|
+
- **Sensor Operations**: Calculate visibility, field-of-view, and predict satellite passes
|
|
39
|
+
- **Orbit Determination**: Determine orbits from observations using multiple IOD methods
|
|
40
|
+
- **Coordinate Transformations**: Convert between ECI, ECF, geodetic, and other coordinate systems
|
|
41
|
+
- **High-Precision Propagation**: Model perturbations including gravity harmonics, third-body effects, solar radiation pressure, and atmospheric drag
|
|
42
|
+
- **Mission Planning**: Calculate orbital maneuvers, transfers, and delta-v requirements
|
|
43
|
+
- **Time Systems**: Handle multiple time systems (UTC, TAI, TT, GPS, TDB) with conversions
|
|
44
|
+
|
|
45
|
+
### Key Features
|
|
46
|
+
|
|
47
|
+
- **Type-Safe**: Written in TypeScript with comprehensive type definitions
|
|
48
|
+
- **Unit Types**: Distinct types for Degrees, Radians, Kilometers, Meters, etc.
|
|
49
|
+
- **Multiple Propagators**: SGP4, Kepler, Runge-Kutta (4th, 8/9th order), Dormand-Prince
|
|
50
|
+
- **Coordinate Systems**: J2000, TEME, ITRF, Geodetic, RIC, Hill, and more
|
|
51
|
+
- **Browser & Node.js**: Works in both environments
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Core Concepts
|
|
56
|
+
|
|
57
|
+
### Type Safety with Units
|
|
58
|
+
|
|
59
|
+
OOTK uses TypeScript's type system to enforce unit safety:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { Degrees, Radians, Kilometers, Meters } from 'ootk';
|
|
63
|
+
|
|
64
|
+
// Type-safe units prevent mixing incompatible values
|
|
65
|
+
const latitude = 41.754785 as Degrees;
|
|
66
|
+
const altitude = 0.060966 as Kilometers;
|
|
67
|
+
|
|
68
|
+
// Compilation error if you try to mix units incorrectly
|
|
69
|
+
// const wrong = latitude + altitude; // Error!
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Available Unit Types:**
|
|
73
|
+
- **Angular**: `Degrees`, `Radians`
|
|
74
|
+
- **Distance**: `Kilometers`, `Meters`
|
|
75
|
+
- **Time**: `Seconds`, `Minutes`, `Hours`, `Days`
|
|
76
|
+
- **Velocity**: `KilometersPerSecond`, `MetersPerSecond`
|
|
77
|
+
- **Angular Velocity**: `RadiansPerSecond`
|
|
78
|
+
|
|
79
|
+
### Vector Types
|
|
80
|
+
|
|
81
|
+
OOTK provides specialized vector types for different coordinate systems:
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { EciVec3, EcfVec3, LlaVec3, RaeVec3 } from 'ootk';
|
|
85
|
+
|
|
86
|
+
// ECI (Earth-Centered Inertial) vector
|
|
87
|
+
const eciPos: EciVec3 = { x: 6778.137, y: 0, z: 0 } as EciVec3<Kilometers>;
|
|
88
|
+
|
|
89
|
+
// Geodetic coordinates
|
|
90
|
+
const lla: LlaVec3 = {
|
|
91
|
+
lat: 41.754785 as Degrees,
|
|
92
|
+
lon: -70.539151 as Degrees,
|
|
93
|
+
alt: 0.060966 as Kilometers
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// Range, Azimuth, Elevation
|
|
97
|
+
const rae: RaeVec3 = {
|
|
98
|
+
rng: 1000 as Kilometers,
|
|
99
|
+
az: 180 as Degrees,
|
|
100
|
+
el: 45 as Degrees
|
|
101
|
+
};
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Enumerations
|
|
105
|
+
|
|
106
|
+
Type-safe enums for common values:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
import { OrbitRegime, SpaceObjectType, Sgp4OpsMode } from 'ootk';
|
|
110
|
+
|
|
111
|
+
const regime = OrbitRegime.LEO; // LEO, MEO, GEO, VHEO, DEEP
|
|
112
|
+
const type = SpaceObjectType.PAYLOAD;
|
|
113
|
+
const opsMode = Sgp4OpsMode.AFSPC; // AFSPC or IMPROVED
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Satellite Operations
|
|
119
|
+
|
|
120
|
+
### Creating Satellites
|
|
121
|
+
|
|
122
|
+
#### From TLE (Two-Line Elements)
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import { Satellite, TleLine1, TleLine2 } from 'ootk';
|
|
126
|
+
|
|
127
|
+
const satellite = new Satellite({
|
|
128
|
+
tle1: '1 25544U 98067A 24028.54545847 .00031576 00000-0 57240-3 0 9991' as TleLine1,
|
|
129
|
+
tle2: '2 25544 51.6418 292.2590 0002595 167.5319 252.0460 15.49326324436741' as TleLine2
|
|
130
|
+
});
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### From Orbital Elements
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
import { Satellite, ClassicalElements, Degrees, Kilometers } from 'ootk';
|
|
137
|
+
|
|
138
|
+
const elements = new ClassicalElements({
|
|
139
|
+
epoch: EpochUTC.fromDateTime(new Date()),
|
|
140
|
+
semimajorAxis: 6778.137 as Kilometers,
|
|
141
|
+
eccentricity: 0.001,
|
|
142
|
+
inclination: 51.6418 as Degrees,
|
|
143
|
+
rightAscension: 292.259 as Degrees,
|
|
144
|
+
argOfPerigee: 167.5319 as Degrees,
|
|
145
|
+
trueAnomaly: 252.046 as Degrees
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const tle = elements.toTLE({
|
|
149
|
+
intlDes: '98067A',
|
|
150
|
+
epochYear: 24,
|
|
151
|
+
epochDay: 28.54545847
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const satellite = new Satellite({ tle1: tle.line1, tle2: tle.line2 });
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### DetailedSatellite
|
|
158
|
+
|
|
159
|
+
For additional metadata:
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
import { DetailedSatellite } from 'ootk';
|
|
163
|
+
|
|
164
|
+
const satellite = new DetailedSatellite({
|
|
165
|
+
tle1: line1,
|
|
166
|
+
tle2: line2,
|
|
167
|
+
id: 25544,
|
|
168
|
+
name: 'ISS (ZARYA)',
|
|
169
|
+
country: 'US',
|
|
170
|
+
launchDate: new Date('1998-11-20'),
|
|
171
|
+
mass: 419700, // kg
|
|
172
|
+
shape: 'Composite',
|
|
173
|
+
period: 92.91, // minutes
|
|
174
|
+
apogee: 422.7, // km
|
|
175
|
+
perigee: 418.9 // km
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Getting Satellite Position
|
|
180
|
+
|
|
181
|
+
#### ECI (Earth-Centered Inertial)
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
// Current time
|
|
185
|
+
const eci = satellite.eci();
|
|
186
|
+
console.log(eci.position); // { x, y, z } in km
|
|
187
|
+
console.log(eci.velocity); // { x, y, z } in km/s
|
|
188
|
+
|
|
189
|
+
// Specific time
|
|
190
|
+
const date = new Date('2024-01-28T12:00:00Z');
|
|
191
|
+
const eciAtTime = satellite.eci(date);
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
#### Geodetic (Latitude/Longitude/Altitude)
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
const lla = satellite.lla();
|
|
198
|
+
console.log(lla.lat); // Latitude in degrees
|
|
199
|
+
console.log(lla.lon); // Longitude in degrees
|
|
200
|
+
console.log(lla.alt); // Altitude in kilometers
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### ECF (Earth-Centered Fixed)
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
const ecf = satellite.ecf();
|
|
207
|
+
console.log(ecf.position); // { x, y, z } in Earth-fixed frame
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Orbital Parameters
|
|
211
|
+
|
|
212
|
+
Access Keplerian orbital elements:
|
|
213
|
+
|
|
214
|
+
```typescript
|
|
215
|
+
console.log(satellite.inclination); // Degrees
|
|
216
|
+
console.log(satellite.eccentricity); // 0-1
|
|
217
|
+
console.log(satellite.period); // Minutes
|
|
218
|
+
console.log(satellite.apogee); // Kilometers
|
|
219
|
+
console.log(satellite.perigee); // Kilometers
|
|
220
|
+
console.log(satellite.semiMajorAxis); // Kilometers
|
|
221
|
+
console.log(satellite.semiMinorAxis); // Kilometers
|
|
222
|
+
console.log(satellite.rightAscension); // Degrees
|
|
223
|
+
console.log(satellite.argOfPerigee); // Degrees
|
|
224
|
+
console.log(satellite.meanMotion); // Revolutions per day
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Coordinate Conversions
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
// Convert to J2000 coordinate system
|
|
231
|
+
const j2000 = satellite.toJ2000(date);
|
|
232
|
+
console.log(j2000.position);
|
|
233
|
+
console.log(j2000.velocity);
|
|
234
|
+
|
|
235
|
+
// Convert to ITRF (Earth-fixed)
|
|
236
|
+
const itrf = satellite.toITRF(date);
|
|
237
|
+
|
|
238
|
+
// Get classical orbital elements
|
|
239
|
+
const elements = satellite.getClassicalElements();
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Satellite Visibility
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
// Check if satellite is in sunlight
|
|
246
|
+
const inSunlight = satellite.isInSunlight(date);
|
|
247
|
+
|
|
248
|
+
// Get illumination (0 = shadowed, 1 = fully illuminated)
|
|
249
|
+
const illumination = satellite.getIllumination(date);
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Sensor Operations
|
|
255
|
+
|
|
256
|
+
### Creating Sensors
|
|
257
|
+
|
|
258
|
+
#### Basic Sensor
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
import { Sensor, Degrees, Kilometers } from 'ootk';
|
|
262
|
+
|
|
263
|
+
const sensor = new Sensor({
|
|
264
|
+
lat: 41.754785 as Degrees,
|
|
265
|
+
lon: -70.539151 as Degrees,
|
|
266
|
+
alt: 0.060966 as Kilometers,
|
|
267
|
+
minEl: 3 as Degrees, // Minimum elevation angle
|
|
268
|
+
maxEl: 85 as Degrees, // Maximum elevation angle
|
|
269
|
+
minRng: 0 as Kilometers, // Minimum range
|
|
270
|
+
maxRng: 5556 as Kilometers // Maximum range
|
|
271
|
+
});
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
#### DetailedSensor
|
|
275
|
+
|
|
276
|
+
For ground stations with additional metadata:
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
import { DetailedSensor, SpaceObjectType } from 'ootk';
|
|
280
|
+
|
|
281
|
+
const sensor = new DetailedSensor({
|
|
282
|
+
lat: 41.754785 as Degrees,
|
|
283
|
+
lon: -70.539151 as Degrees,
|
|
284
|
+
alt: 0.060966 as Kilometers,
|
|
285
|
+
minAz: 347 as Degrees,
|
|
286
|
+
maxAz: 227 as Degrees,
|
|
287
|
+
minEl: 3 as Degrees,
|
|
288
|
+
maxEl: 85 as Degrees,
|
|
289
|
+
minRng: 0 as Kilometers,
|
|
290
|
+
maxRng: 5556 as Kilometers,
|
|
291
|
+
name: 'Cape Cod Space Force Station',
|
|
292
|
+
type: SpaceObjectType.PHASED_ARRAY_RADAR,
|
|
293
|
+
country: 'United States',
|
|
294
|
+
freqBand: 'UHF',
|
|
295
|
+
operator: 'USSF'
|
|
296
|
+
});
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
#### RF Sensor
|
|
300
|
+
|
|
301
|
+
For RF sensors with phased array capabilities:
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
import { RfSensor } from 'ootk';
|
|
305
|
+
|
|
306
|
+
const rfSensor = new RfSensor({
|
|
307
|
+
lat: 41.754785 as Degrees,
|
|
308
|
+
lon: -70.539151 as Degrees,
|
|
309
|
+
alt: 0.060966 as Kilometers,
|
|
310
|
+
minEl: 3 as Degrees,
|
|
311
|
+
maxEl: 85 as Degrees,
|
|
312
|
+
beamwidth: 2 as Degrees, // Antenna beamwidth
|
|
313
|
+
frequency: 420 // MHz
|
|
314
|
+
});
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Range, Azimuth, Elevation (RAE)
|
|
318
|
+
|
|
319
|
+
Calculate look angles from sensor to satellite:
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
const rae = sensor.rae(satellite);
|
|
323
|
+
|
|
324
|
+
console.log(rae.rng); // Range in kilometers
|
|
325
|
+
console.log(rae.az); // Azimuth in degrees (0-360)
|
|
326
|
+
console.log(rae.el); // Elevation in degrees (-90 to 90)
|
|
327
|
+
console.log(rae.rngRate); // Range rate (km/s)
|
|
328
|
+
|
|
329
|
+
// At a specific time
|
|
330
|
+
const raeAtTime = sensor.rae(satellite, date);
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### Field of View
|
|
334
|
+
|
|
335
|
+
Check if satellite is visible:
|
|
336
|
+
|
|
337
|
+
```typescript
|
|
338
|
+
// Check if satellite is in sensor's field of view
|
|
339
|
+
const isVisible = sensor.isSatInFov(satellite);
|
|
340
|
+
console.log(isVisible); // true or false
|
|
341
|
+
|
|
342
|
+
// At a specific time
|
|
343
|
+
const isVisibleAtTime = sensor.isSatInFov(satellite, date);
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Pass Predictions
|
|
347
|
+
|
|
348
|
+
Calculate when satellite will be visible:
|
|
349
|
+
|
|
350
|
+
```typescript
|
|
351
|
+
// Calculate passes over next 7 days in 30-second intervals
|
|
352
|
+
const passes = sensor.calculatePasses(30, satellite, {
|
|
353
|
+
startDate: new Date(),
|
|
354
|
+
lengthDays: 7
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
passes.forEach(pass => {
|
|
358
|
+
console.log('Rise time:', pass.rise);
|
|
359
|
+
console.log('Culmination time:', pass.culmination);
|
|
360
|
+
console.log('Set time:', pass.set);
|
|
361
|
+
console.log('Max elevation:', pass.maxEl);
|
|
362
|
+
console.log('Duration:', pass.duration); // seconds
|
|
363
|
+
});
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Sensor Position in ECI
|
|
367
|
+
|
|
368
|
+
```typescript
|
|
369
|
+
// Get sensor position in J2000 ECI coordinates
|
|
370
|
+
const j2000 = sensor.toJ2000();
|
|
371
|
+
console.log(j2000.position);
|
|
372
|
+
|
|
373
|
+
// At a specific time
|
|
374
|
+
const j2000AtTime = sensor.toJ2000(date);
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## Coordinate Systems
|
|
380
|
+
|
|
381
|
+
OOTK supports multiple coordinate systems with easy conversions between them.
|
|
382
|
+
|
|
383
|
+
### Earth-Centered Inertial (ECI)
|
|
384
|
+
|
|
385
|
+
#### J2000
|
|
386
|
+
|
|
387
|
+
Standard inertial frame at epoch J2000.0:
|
|
388
|
+
|
|
389
|
+
```typescript
|
|
390
|
+
import { J2000, Kilometers, KilometersPerSecond } from 'ootk';
|
|
391
|
+
|
|
392
|
+
const j2000 = new J2000(
|
|
393
|
+
epoch,
|
|
394
|
+
{ x: 6778.137, y: 0, z: 0 } as EciVec3<Kilometers>,
|
|
395
|
+
{ x: 0, y: 7.67, z: 0 } as EciVec3<KilometersPerSecond>
|
|
396
|
+
);
|
|
397
|
+
|
|
398
|
+
// Convert to other frames
|
|
399
|
+
const teme = j2000.toTEME();
|
|
400
|
+
const itrf = j2000.toITRF();
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
#### TEME (True Equator Mean Equinox)
|
|
404
|
+
|
|
405
|
+
Used by SGP4 propagator:
|
|
406
|
+
|
|
407
|
+
```typescript
|
|
408
|
+
import { TEME } from 'ootk';
|
|
409
|
+
|
|
410
|
+
const teme = new TEME(epoch, position, velocity);
|
|
411
|
+
|
|
412
|
+
// Convert to J2000
|
|
413
|
+
const j2000 = teme.toJ2000();
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### Earth-Centered Fixed (ECF)
|
|
417
|
+
|
|
418
|
+
#### ITRF (International Terrestrial Reference Frame)
|
|
419
|
+
|
|
420
|
+
Earth-fixed frame that rotates with Earth:
|
|
421
|
+
|
|
422
|
+
```typescript
|
|
423
|
+
import { ITRF } from 'ootk';
|
|
424
|
+
|
|
425
|
+
const itrf = new ITRF(epoch, position, velocity);
|
|
426
|
+
|
|
427
|
+
// Convert to inertial
|
|
428
|
+
const j2000 = itrf.toJ2000();
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### Geodetic Coordinates
|
|
432
|
+
|
|
433
|
+
Latitude, Longitude, Altitude:
|
|
434
|
+
|
|
435
|
+
```typescript
|
|
436
|
+
import { Geodetic } from 'ootk';
|
|
437
|
+
|
|
438
|
+
const geodetic = new Geodetic(
|
|
439
|
+
41.754785 as Degrees,
|
|
440
|
+
-70.539151 as Degrees,
|
|
441
|
+
0.060966 as Kilometers
|
|
442
|
+
);
|
|
443
|
+
|
|
444
|
+
// Convert to ECF
|
|
445
|
+
const itrf = geodetic.toITRF();
|
|
446
|
+
|
|
447
|
+
// Convert to ECI
|
|
448
|
+
const j2000 = geodetic.toJ2000(epoch);
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### Classical Orbital Elements
|
|
452
|
+
|
|
453
|
+
```typescript
|
|
454
|
+
import { ClassicalElements } from 'ootk';
|
|
455
|
+
|
|
456
|
+
const elements = new ClassicalElements({
|
|
457
|
+
epoch: epoch,
|
|
458
|
+
semimajorAxis: 6778.137 as Kilometers,
|
|
459
|
+
eccentricity: 0.001,
|
|
460
|
+
inclination: 51.6418 as Degrees,
|
|
461
|
+
rightAscension: 292.259 as Degrees,
|
|
462
|
+
argOfPerigee: 167.5319 as Degrees,
|
|
463
|
+
trueAnomaly: 252.046 as Degrees
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// Convert to position/velocity
|
|
467
|
+
const pv = elements.toPositionVelocity();
|
|
468
|
+
|
|
469
|
+
// Generate TLE
|
|
470
|
+
const tle = elements.toTLE({
|
|
471
|
+
intlDes: '98067A',
|
|
472
|
+
epochYear: 24,
|
|
473
|
+
epochDay: 28.54545847
|
|
474
|
+
});
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
### Equinoctial Elements
|
|
478
|
+
|
|
479
|
+
Non-singular orbital elements:
|
|
480
|
+
|
|
481
|
+
```typescript
|
|
482
|
+
import { EquinoctialElements } from 'ootk';
|
|
483
|
+
|
|
484
|
+
const equinoctial = new EquinoctialElements(
|
|
485
|
+
epoch,
|
|
486
|
+
a, // semi-major axis
|
|
487
|
+
h, // h = e * sin(ω + Ω)
|
|
488
|
+
k, // k = e * cos(ω + Ω)
|
|
489
|
+
p, // p = tan(i/2) * sin(Ω)
|
|
490
|
+
q, // q = tan(i/2) * cos(Ω)
|
|
491
|
+
λ // mean longitude
|
|
492
|
+
);
|
|
493
|
+
|
|
494
|
+
// Convert to classical elements
|
|
495
|
+
const classical = equinoctial.toClassicalElements();
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
### Relative Frames
|
|
499
|
+
|
|
500
|
+
#### RIC (Radial-In-track-Cross-track)
|
|
501
|
+
|
|
502
|
+
```typescript
|
|
503
|
+
import { RIC } from 'ootk';
|
|
504
|
+
|
|
505
|
+
// Create RIC frame relative to a reference satellite
|
|
506
|
+
const ric = RIC.fromJ2000(referenceState, targetState);
|
|
507
|
+
|
|
508
|
+
console.log(ric.position.x); // Radial component
|
|
509
|
+
console.log(ric.position.y); // In-track component
|
|
510
|
+
console.log(ric.position.z); // Cross-track component
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
#### Hill Frame
|
|
514
|
+
|
|
515
|
+
Similar to RIC but with different conventions:
|
|
516
|
+
|
|
517
|
+
```typescript
|
|
518
|
+
import { Hill } from 'ootk';
|
|
519
|
+
|
|
520
|
+
const hill = Hill.fromJ2000(referenceState, targetState);
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### TLE (Two-Line Element)
|
|
524
|
+
|
|
525
|
+
Parse and create TLE data:
|
|
526
|
+
|
|
527
|
+
```typescript
|
|
528
|
+
import { Tle } from 'ootk';
|
|
529
|
+
|
|
530
|
+
// Parse existing TLE
|
|
531
|
+
const tle = new Tle(line1, line2);
|
|
532
|
+
console.log(tle.inclination);
|
|
533
|
+
console.log(tle.eccentricity);
|
|
534
|
+
console.log(tle.meanMotion);
|
|
535
|
+
|
|
536
|
+
// Create from classical elements
|
|
537
|
+
const newTle = ClassicalElements.toTLE(elements, metadata);
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
## Orbit Propagation
|
|
543
|
+
|
|
544
|
+
### SGP4 Propagator
|
|
545
|
+
|
|
546
|
+
Standard propagator for TLE data:
|
|
547
|
+
|
|
548
|
+
```typescript
|
|
549
|
+
import { Satellite, Sgp4Propagator, EpochUTC } from 'ootk';
|
|
550
|
+
|
|
551
|
+
const satellite = new Satellite({ tle1, tle2 });
|
|
552
|
+
const propagator = new Sgp4Propagator(satellite);
|
|
553
|
+
|
|
554
|
+
// Propagate to a specific time
|
|
555
|
+
const futureEpoch = EpochUTC.fromDateTime(new Date('2024-12-31'));
|
|
556
|
+
const state = propagator.propagate(futureEpoch);
|
|
557
|
+
|
|
558
|
+
console.log(state.position); // TEME coordinates
|
|
559
|
+
console.log(state.velocity);
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
**SGP4 Operation Modes:**
|
|
563
|
+
|
|
564
|
+
```typescript
|
|
565
|
+
import { Sgp4OpsMode } from 'ootk';
|
|
566
|
+
|
|
567
|
+
// AFSPC mode (original)
|
|
568
|
+
const propagatorAFSPC = new Sgp4Propagator(satellite, Sgp4OpsMode.AFSPC);
|
|
569
|
+
|
|
570
|
+
// Improved mode (recommended)
|
|
571
|
+
const propagatorImproved = new Sgp4Propagator(satellite, Sgp4OpsMode.IMPROVED);
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
### Kepler Propagator
|
|
575
|
+
|
|
576
|
+
Simple two-body propagation (fastest, least accurate):
|
|
577
|
+
|
|
578
|
+
```typescript
|
|
579
|
+
import { KeplerPropagator } from 'ootk';
|
|
580
|
+
|
|
581
|
+
const initialState = satellite.toJ2000();
|
|
582
|
+
const propagator = new KeplerPropagator(initialState);
|
|
583
|
+
|
|
584
|
+
const futureState = propagator.propagate(futureEpoch);
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
### Runge-Kutta 4 Propagator
|
|
588
|
+
|
|
589
|
+
4th-order Runge-Kutta numerical integration:
|
|
590
|
+
|
|
591
|
+
```typescript
|
|
592
|
+
import { RungeKutta4Propagator, ForceModel } from 'ootk';
|
|
593
|
+
|
|
594
|
+
const forceModel = new ForceModel();
|
|
595
|
+
forceModel.setEarthGravity(4, 4); // 4x4 gravity field
|
|
596
|
+
|
|
597
|
+
const propagator = new RungeKutta4Propagator(
|
|
598
|
+
initialState,
|
|
599
|
+
forceModel,
|
|
600
|
+
{ stepSize: 60 } // 60 second steps
|
|
601
|
+
);
|
|
602
|
+
|
|
603
|
+
const futureState = propagator.propagate(futureEpoch);
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
### Runge-Kutta 89 Propagator
|
|
607
|
+
|
|
608
|
+
8/9th-order with adaptive step size (high accuracy):
|
|
609
|
+
|
|
610
|
+
```typescript
|
|
611
|
+
import { RungeKutta89Propagator } from 'ootk';
|
|
612
|
+
|
|
613
|
+
const propagator = new RungeKutta89Propagator(
|
|
614
|
+
initialState,
|
|
615
|
+
forceModel,
|
|
616
|
+
{
|
|
617
|
+
minStepSize: 0.01, // seconds
|
|
618
|
+
maxStepSize: 600, // seconds
|
|
619
|
+
tolerance: 1e-9 // error tolerance
|
|
620
|
+
}
|
|
621
|
+
);
|
|
622
|
+
|
|
623
|
+
const futureState = propagator.propagate(futureEpoch);
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
### Dormand-Prince 5(4) Propagator
|
|
627
|
+
|
|
628
|
+
Adaptive Runge-Kutta method:
|
|
629
|
+
|
|
630
|
+
```typescript
|
|
631
|
+
import { DormandPrince54Propagator } from 'ootk';
|
|
632
|
+
|
|
633
|
+
const propagator = new DormandPrince54Propagator(
|
|
634
|
+
initialState,
|
|
635
|
+
forceModel,
|
|
636
|
+
{
|
|
637
|
+
minStepSize: 0.01,
|
|
638
|
+
maxStepSize: 600,
|
|
639
|
+
tolerance: 1e-9
|
|
640
|
+
}
|
|
641
|
+
);
|
|
642
|
+
|
|
643
|
+
const futureState = propagator.propagate(futureEpoch);
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
### Propagator Comparison
|
|
647
|
+
|
|
648
|
+
| Propagator | Accuracy | Speed | Use Case |
|
|
649
|
+
|------------|----------|-------|----------|
|
|
650
|
+
| SGP4 | Good | Very Fast | TLE propagation, Earth orbits |
|
|
651
|
+
| Kepler | Low | Fastest | Quick estimates, educational |
|
|
652
|
+
| RK4 | High | Moderate | General purpose |
|
|
653
|
+
| RK89 | Very High | Slower | High-precision requirements |
|
|
654
|
+
| Dormand-Prince | High | Moderate | Balanced accuracy/speed |
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
## Force Models
|
|
659
|
+
|
|
660
|
+
For high-precision propagation, configure perturbation forces:
|
|
661
|
+
|
|
662
|
+
### Creating a Force Model
|
|
663
|
+
|
|
664
|
+
```typescript
|
|
665
|
+
import { ForceModel } from 'ootk';
|
|
666
|
+
|
|
667
|
+
const forceModel = new ForceModel();
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
### Earth Gravity
|
|
671
|
+
|
|
672
|
+
Include gravitational harmonics:
|
|
673
|
+
|
|
674
|
+
```typescript
|
|
675
|
+
// Point mass gravity (fastest)
|
|
676
|
+
forceModel.setEarthGravity(0, 0);
|
|
677
|
+
|
|
678
|
+
// J2 perturbation only
|
|
679
|
+
forceModel.setEarthGravity(2, 0);
|
|
680
|
+
|
|
681
|
+
// 8x8 gravity field (recommended for LEO)
|
|
682
|
+
forceModel.setEarthGravity(8, 8);
|
|
683
|
+
|
|
684
|
+
// 20x20 gravity field (high precision)
|
|
685
|
+
forceModel.setEarthGravity(20, 20);
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
**Degree/Order Guide:**
|
|
689
|
+
- `(0, 0)` - Point mass only
|
|
690
|
+
- `(2, 0)` - J2 oblateness
|
|
691
|
+
- `(4, 4)` - Basic harmonics
|
|
692
|
+
- `(8, 8)` - Good for most applications
|
|
693
|
+
- `(20, 20)` - High precision
|
|
694
|
+
- `(70, 70)` - Maximum precision (slow)
|
|
695
|
+
|
|
696
|
+
### Third-Body Gravity
|
|
697
|
+
|
|
698
|
+
Sun and Moon perturbations:
|
|
699
|
+
|
|
700
|
+
```typescript
|
|
701
|
+
forceModel.setThirdBodyGravity({
|
|
702
|
+
sun: true,
|
|
703
|
+
moon: true
|
|
704
|
+
});
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
### Solar Radiation Pressure
|
|
708
|
+
|
|
709
|
+
```typescript
|
|
710
|
+
// Basic SRP
|
|
711
|
+
forceModel.setSolarRadiationPressure(
|
|
712
|
+
1000, // mass in kg
|
|
713
|
+
10, // cross-sectional area in m²
|
|
714
|
+
1.5 // radiation pressure coefficient (typically 1.0-2.0)
|
|
715
|
+
);
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
### Atmospheric Drag
|
|
719
|
+
|
|
720
|
+
```typescript
|
|
721
|
+
forceModel.setAtmosphericDrag(
|
|
722
|
+
1000, // mass in kg
|
|
723
|
+
10, // cross-sectional area in m²
|
|
724
|
+
2.2 // drag coefficient (typically 2.0-2.5)
|
|
725
|
+
);
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
### Thrust
|
|
729
|
+
|
|
730
|
+
For maneuvers:
|
|
731
|
+
|
|
732
|
+
```typescript
|
|
733
|
+
import { Thrust, Vector3D } from 'ootk';
|
|
734
|
+
|
|
735
|
+
const thrust = new Thrust(
|
|
736
|
+
new Vector3D(100, 0, 0), // thrust vector in Newtons
|
|
737
|
+
startEpoch,
|
|
738
|
+
endEpoch
|
|
739
|
+
);
|
|
740
|
+
|
|
741
|
+
forceModel.addThrust(thrust);
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
### Complete Example
|
|
745
|
+
|
|
746
|
+
```typescript
|
|
747
|
+
const forceModel = new ForceModel();
|
|
748
|
+
|
|
749
|
+
// Configure all perturbations
|
|
750
|
+
forceModel.setEarthGravity(20, 20);
|
|
751
|
+
forceModel.setThirdBodyGravity({ sun: true, moon: true });
|
|
752
|
+
forceModel.setSolarRadiationPressure(500, 15, 1.5);
|
|
753
|
+
forceModel.setAtmosphericDrag(500, 15, 2.2);
|
|
754
|
+
|
|
755
|
+
// Use with propagator
|
|
756
|
+
const propagator = new RungeKutta89Propagator(
|
|
757
|
+
initialState,
|
|
758
|
+
forceModel,
|
|
759
|
+
{ tolerance: 1e-12 }
|
|
760
|
+
);
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
---
|
|
764
|
+
|
|
765
|
+
## Initial Orbit Determination
|
|
766
|
+
|
|
767
|
+
Determine orbits from observations using various IOD methods.
|
|
768
|
+
|
|
769
|
+
### Gibbsmethod
|
|
770
|
+
|
|
771
|
+
Determine orbit from 3 position vectors:
|
|
772
|
+
|
|
773
|
+
```typescript
|
|
774
|
+
import { GibbsIOD, Vector3D, EpochUTC } from 'ootk';
|
|
775
|
+
|
|
776
|
+
const iod = new GibbsIOD();
|
|
777
|
+
|
|
778
|
+
const r1 = new Vector3D(6778, 0, 0);
|
|
779
|
+
const r2 = new Vector3D(0, 6778, 0);
|
|
780
|
+
const r3 = new Vector3D(-6778, 0, 0);
|
|
781
|
+
|
|
782
|
+
const result = iod.estimate(r1, r2, r3);
|
|
783
|
+
|
|
784
|
+
console.log(result.velocity); // Determined velocity
|
|
785
|
+
console.log(result.orbit); // Orbital elements
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
### Herrick-Gibbs IOD
|
|
789
|
+
|
|
790
|
+
Improved Gibbs method using observation times:
|
|
791
|
+
|
|
792
|
+
```typescript
|
|
793
|
+
import { HerrickGibbsIOD } from 'ootk';
|
|
794
|
+
|
|
795
|
+
const iod = new HerrickGibbsIOD();
|
|
796
|
+
|
|
797
|
+
const result = iod.estimate(
|
|
798
|
+
r1, epoch1,
|
|
799
|
+
r2, epoch2,
|
|
800
|
+
r3, epoch3
|
|
801
|
+
);
|
|
802
|
+
```
|
|
803
|
+
|
|
804
|
+
### Gooding IOD
|
|
805
|
+
|
|
806
|
+
Advanced method with better handling of short arcs:
|
|
807
|
+
|
|
808
|
+
```typescript
|
|
809
|
+
import { GoodingIOD } from 'ootk';
|
|
810
|
+
|
|
811
|
+
const iod = new GoodingIOD();
|
|
812
|
+
|
|
813
|
+
const result = iod.estimate(
|
|
814
|
+
r1, epoch1,
|
|
815
|
+
r2, epoch2,
|
|
816
|
+
r3, epoch3
|
|
817
|
+
);
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
### Modified Gooding IOD
|
|
821
|
+
|
|
822
|
+
Enhanced Gooding method:
|
|
823
|
+
|
|
824
|
+
```typescript
|
|
825
|
+
import { ModifiedGoodingIOD } from 'ootk';
|
|
826
|
+
|
|
827
|
+
const iod = new ModifiedGoodingIOD();
|
|
828
|
+
|
|
829
|
+
const result = iod.estimate(
|
|
830
|
+
r1, epoch1,
|
|
831
|
+
r2, epoch2,
|
|
832
|
+
r3, epoch3
|
|
833
|
+
);
|
|
834
|
+
```
|
|
835
|
+
|
|
836
|
+
### Lambert IOD
|
|
837
|
+
|
|
838
|
+
Solve Lambert's problem (two positions, time of flight):
|
|
839
|
+
|
|
840
|
+
```typescript
|
|
841
|
+
import { LambertIOD } from 'ootk';
|
|
842
|
+
|
|
843
|
+
const iod = new LambertIOD();
|
|
844
|
+
|
|
845
|
+
const result = iod.estimate(
|
|
846
|
+
r1, epoch1,
|
|
847
|
+
r2, epoch2
|
|
848
|
+
);
|
|
849
|
+
|
|
850
|
+
console.log(result.v1); // Velocity at first position
|
|
851
|
+
console.log(result.v2); // Velocity at second position
|
|
852
|
+
```
|
|
853
|
+
|
|
854
|
+
### Batch Least Squares
|
|
855
|
+
|
|
856
|
+
Fit orbit to multiple observations:
|
|
857
|
+
|
|
858
|
+
```typescript
|
|
859
|
+
import { BatchLeastSquaresOD, ObservationOptical } from 'ootk';
|
|
860
|
+
|
|
861
|
+
const observations = [
|
|
862
|
+
new ObservationOptical(epoch1, ra1, dec1, sensor1),
|
|
863
|
+
new ObservationOptical(epoch2, ra2, dec2, sensor2),
|
|
864
|
+
new ObservationOptical(epoch3, ra3, dec3, sensor3),
|
|
865
|
+
// ... more observations
|
|
866
|
+
];
|
|
867
|
+
|
|
868
|
+
const iod = new BatchLeastSquaresOD();
|
|
869
|
+
const result = iod.estimate(observations, initialGuess);
|
|
870
|
+
|
|
871
|
+
console.log(result.state); // Final state estimate
|
|
872
|
+
console.log(result.covariance); // Uncertainty
|
|
873
|
+
console.log(result.residuals); // Observation residuals
|
|
874
|
+
```
|
|
875
|
+
|
|
876
|
+
### From Sensor Observations
|
|
877
|
+
|
|
878
|
+
Practical example using sensor angle measurements:
|
|
879
|
+
|
|
880
|
+
```typescript
|
|
881
|
+
import { Sensor, RAE } from 'ootk';
|
|
882
|
+
|
|
883
|
+
const sensor = new Sensor({ lat, lon, alt, minEl, maxEl });
|
|
884
|
+
|
|
885
|
+
// Get three observations
|
|
886
|
+
const obs1 = new RAE(epoch1, range1, azimuth1, elevation1);
|
|
887
|
+
const obs2 = new RAE(epoch2, range2, azimuth2, elevation2);
|
|
888
|
+
const obs3 = new RAE(epoch3, range3, azimuth3, elevation3);
|
|
889
|
+
|
|
890
|
+
// Convert to position vectors
|
|
891
|
+
const r1 = sensor.raeToECI(obs1);
|
|
892
|
+
const r2 = sensor.raeToECI(obs2);
|
|
893
|
+
const r3 = sensor.raeToECI(obs3);
|
|
894
|
+
|
|
895
|
+
// Run IOD
|
|
896
|
+
const iod = new GoodingIOD();
|
|
897
|
+
const orbit = iod.estimate(r1, epoch1, r2, epoch2, r3, epoch3);
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
---
|
|
901
|
+
|
|
902
|
+
## Observations
|
|
903
|
+
|
|
904
|
+
### Range, Azimuth, Elevation (RAE)
|
|
905
|
+
|
|
906
|
+
Radar or optical tracking station measurements:
|
|
907
|
+
|
|
908
|
+
```typescript
|
|
909
|
+
import { RAE, Degrees, Kilometers } from 'ootk';
|
|
910
|
+
|
|
911
|
+
const observation = new RAE(
|
|
912
|
+
epoch,
|
|
913
|
+
1000 as Kilometers, // range
|
|
914
|
+
180 as Degrees, // azimuth (0-360)
|
|
915
|
+
45 as Degrees, // elevation (-90 to 90)
|
|
916
|
+
0.5 as KilometersPerSecond // range rate (optional)
|
|
917
|
+
);
|
|
918
|
+
|
|
919
|
+
// Convert to topocentric coordinates
|
|
920
|
+
const topocentric = observation.toTopocentric(sensor);
|
|
921
|
+
|
|
922
|
+
// Convert to ECI
|
|
923
|
+
const eci = observation.toECI(sensor);
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
### Right Ascension / Declination
|
|
927
|
+
|
|
928
|
+
Optical observations in celestial coordinates:
|
|
929
|
+
|
|
930
|
+
#### Geocentric
|
|
931
|
+
|
|
932
|
+
```typescript
|
|
933
|
+
import { RadecGeocentric } from 'ootk';
|
|
934
|
+
|
|
935
|
+
const observation = new RadecGeocentric(
|
|
936
|
+
epoch,
|
|
937
|
+
15.5 as Degrees, // right ascension (0-360)
|
|
938
|
+
45.2 as Degrees, // declination (-90 to 90)
|
|
939
|
+
1000 as Kilometers // range (optional)
|
|
940
|
+
);
|
|
941
|
+
```
|
|
942
|
+
|
|
943
|
+
#### Topocentric
|
|
944
|
+
|
|
945
|
+
From a ground station:
|
|
946
|
+
|
|
947
|
+
```typescript
|
|
948
|
+
import { RadecTopocentric } from 'ootk';
|
|
949
|
+
|
|
950
|
+
const observation = new RadecTopocentric(
|
|
951
|
+
epoch,
|
|
952
|
+
ra,
|
|
953
|
+
dec,
|
|
954
|
+
sensor // observer location
|
|
955
|
+
);
|
|
956
|
+
|
|
957
|
+
// Convert to geocentric
|
|
958
|
+
const geocentric = observation.toGeocentric();
|
|
959
|
+
```
|
|
960
|
+
|
|
961
|
+
### Radar Observations
|
|
962
|
+
|
|
963
|
+
```typescript
|
|
964
|
+
import { ObservationRadar } from 'ootk';
|
|
965
|
+
|
|
966
|
+
const observation = new ObservationRadar(
|
|
967
|
+
epoch,
|
|
968
|
+
range,
|
|
969
|
+
azimuth,
|
|
970
|
+
elevation,
|
|
971
|
+
rangeRate,
|
|
972
|
+
sensor
|
|
973
|
+
);
|
|
974
|
+
```
|
|
975
|
+
|
|
976
|
+
### Optical Observations
|
|
977
|
+
|
|
978
|
+
```typescript
|
|
979
|
+
import { ObservationOptical } from 'ootk';
|
|
980
|
+
|
|
981
|
+
const observation = new ObservationOptical(
|
|
982
|
+
epoch,
|
|
983
|
+
ra,
|
|
984
|
+
dec,
|
|
985
|
+
sensor
|
|
986
|
+
);
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
---
|
|
990
|
+
|
|
991
|
+
## Time Systems
|
|
992
|
+
|
|
993
|
+
### Epoch Types
|
|
994
|
+
|
|
995
|
+
OOTK supports multiple time systems:
|
|
996
|
+
|
|
997
|
+
```typescript
|
|
998
|
+
import {
|
|
999
|
+
EpochUTC,
|
|
1000
|
+
EpochTAI,
|
|
1001
|
+
EpochTT,
|
|
1002
|
+
EpochGPS,
|
|
1003
|
+
EpochTDB
|
|
1004
|
+
} from 'ootk';
|
|
1005
|
+
|
|
1006
|
+
// UTC (Coordinated Universal Time)
|
|
1007
|
+
const utc = EpochUTC.fromDateTime(new Date('2024-01-28T12:00:00Z'));
|
|
1008
|
+
|
|
1009
|
+
// TAI (International Atomic Time)
|
|
1010
|
+
const tai = EpochTAI.fromDateTime(new Date('2024-01-28T12:00:00Z'));
|
|
1011
|
+
|
|
1012
|
+
// TT (Terrestrial Time)
|
|
1013
|
+
const tt = EpochTT.fromDateTime(new Date('2024-01-28T12:00:00Z'));
|
|
1014
|
+
|
|
1015
|
+
// GPS Time
|
|
1016
|
+
const gps = EpochGPS.fromDateTime(new Date('2024-01-28T12:00:00Z'));
|
|
1017
|
+
|
|
1018
|
+
// TDB (Barycentric Dynamical Time)
|
|
1019
|
+
const tdb = EpochTDB.fromDateTime(new Date('2024-01-28T12:00:00Z'));
|
|
1020
|
+
```
|
|
1021
|
+
|
|
1022
|
+
### Creating Epochs
|
|
1023
|
+
|
|
1024
|
+
#### From JavaScript Date
|
|
1025
|
+
|
|
1026
|
+
```typescript
|
|
1027
|
+
const epoch = EpochUTC.fromDateTime(new Date());
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
#### From Julian Date
|
|
1031
|
+
|
|
1032
|
+
```typescript
|
|
1033
|
+
const epoch = EpochUTC.fromJulianDate(2451545.0);
|
|
1034
|
+
```
|
|
1035
|
+
|
|
1036
|
+
#### From Modified Julian Date
|
|
1037
|
+
|
|
1038
|
+
```typescript
|
|
1039
|
+
const epoch = EpochUTC.fromMJD(51544.5);
|
|
1040
|
+
```
|
|
1041
|
+
|
|
1042
|
+
#### From Components
|
|
1043
|
+
|
|
1044
|
+
```typescript
|
|
1045
|
+
const epoch = EpochUTC.fromDateTimeComponents(
|
|
1046
|
+
2024, // year
|
|
1047
|
+
1, // month
|
|
1048
|
+
28, // day
|
|
1049
|
+
12, // hour
|
|
1050
|
+
0, // minute
|
|
1051
|
+
0 // second
|
|
1052
|
+
);
|
|
1053
|
+
```
|
|
1054
|
+
|
|
1055
|
+
### Time Conversions
|
|
1056
|
+
|
|
1057
|
+
```typescript
|
|
1058
|
+
const utc = EpochUTC.fromDateTime(new Date());
|
|
1059
|
+
|
|
1060
|
+
// Convert between time systems
|
|
1061
|
+
const tai = utc.toTAI();
|
|
1062
|
+
const tt = utc.toTT();
|
|
1063
|
+
const gps = utc.toGPS();
|
|
1064
|
+
const tdb = utc.toTDB();
|
|
1065
|
+
|
|
1066
|
+
// Get Julian dates
|
|
1067
|
+
console.log(utc.toJulianDate());
|
|
1068
|
+
console.log(utc.toMJD());
|
|
1069
|
+
|
|
1070
|
+
// Get as JavaScript Date
|
|
1071
|
+
console.log(utc.toDateTime());
|
|
1072
|
+
```
|
|
1073
|
+
|
|
1074
|
+
### Time Windows
|
|
1075
|
+
|
|
1076
|
+
Define time intervals:
|
|
1077
|
+
|
|
1078
|
+
```typescript
|
|
1079
|
+
import { EpochWindow } from 'ootk';
|
|
1080
|
+
|
|
1081
|
+
const window = new EpochWindow(startEpoch, endEpoch);
|
|
1082
|
+
|
|
1083
|
+
// Check if epoch is in window
|
|
1084
|
+
const isInWindow = window.contains(testEpoch);
|
|
1085
|
+
|
|
1086
|
+
// Get duration
|
|
1087
|
+
const durationSeconds = window.duration();
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
### Time Arithmetic
|
|
1091
|
+
|
|
1092
|
+
```typescript
|
|
1093
|
+
// Add seconds
|
|
1094
|
+
const future = epoch.addSeconds(3600); // +1 hour
|
|
1095
|
+
|
|
1096
|
+
// Add days
|
|
1097
|
+
const tomorrow = epoch.addDays(1);
|
|
1098
|
+
|
|
1099
|
+
// Difference between epochs
|
|
1100
|
+
const deltaSeconds = epoch2.difference(epoch1);
|
|
1101
|
+
|
|
1102
|
+
// Compare epochs
|
|
1103
|
+
const isAfter = epoch2.isAfter(epoch1);
|
|
1104
|
+
const isBefore = epoch2.isBefore(epoch1);
|
|
1105
|
+
```
|
|
1106
|
+
|
|
1107
|
+
### Greenwich Mean Sidereal Time
|
|
1108
|
+
|
|
1109
|
+
```typescript
|
|
1110
|
+
import { EpochUTC } from 'ootk';
|
|
1111
|
+
|
|
1112
|
+
const epoch = EpochUTC.fromDateTime(new Date());
|
|
1113
|
+
|
|
1114
|
+
// Get GMST in radians
|
|
1115
|
+
const gmst = epoch.gmst();
|
|
1116
|
+
|
|
1117
|
+
// Get GMST in degrees
|
|
1118
|
+
const gmstDeg = epoch.gmstDegrees();
|
|
1119
|
+
```
|
|
1120
|
+
|
|
1121
|
+
---
|
|
1122
|
+
|
|
1123
|
+
## Interpolation
|
|
1124
|
+
|
|
1125
|
+
Interpolate state vectors for smooth trajectories.
|
|
1126
|
+
|
|
1127
|
+
### Chebyshev Interpolation
|
|
1128
|
+
|
|
1129
|
+
Efficient for smooth functions:
|
|
1130
|
+
|
|
1131
|
+
```typescript
|
|
1132
|
+
import { ChebyshevInterpolator, EpochUTC } from 'ootk';
|
|
1133
|
+
|
|
1134
|
+
// Generate sample states
|
|
1135
|
+
const states = [];
|
|
1136
|
+
for (let i = 0; i < 10; i++) {
|
|
1137
|
+
const epoch = startEpoch.addSeconds(i * 60);
|
|
1138
|
+
const state = propagator.propagate(epoch);
|
|
1139
|
+
states.push({ epoch, state });
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
// Create interpolator
|
|
1143
|
+
const interpolator = new ChebyshevInterpolator(states, 8); // 8th order
|
|
1144
|
+
|
|
1145
|
+
// Interpolate at arbitrary time
|
|
1146
|
+
const interpEpoch = startEpoch.addSeconds(135); // Between samples
|
|
1147
|
+
const interpState = interpolator.interpolate(interpEpoch);
|
|
1148
|
+
```
|
|
1149
|
+
|
|
1150
|
+
### Lagrange Interpolation
|
|
1151
|
+
|
|
1152
|
+
Classic polynomial interpolation:
|
|
1153
|
+
|
|
1154
|
+
```typescript
|
|
1155
|
+
import { LagrangeInterpolator } from 'ootk';
|
|
1156
|
+
|
|
1157
|
+
const interpolator = new LagrangeInterpolator(states, 5); // 5th order
|
|
1158
|
+
const interpState = interpolator.interpolate(interpEpoch);
|
|
1159
|
+
```
|
|
1160
|
+
|
|
1161
|
+
### Cubic Spline Interpolation
|
|
1162
|
+
|
|
1163
|
+
Smooth curves through points:
|
|
1164
|
+
|
|
1165
|
+
```typescript
|
|
1166
|
+
import { CubicSplineInterpolator } from 'ootk';
|
|
1167
|
+
|
|
1168
|
+
const interpolator = new CubicSplineInterpolator(states);
|
|
1169
|
+
const interpState = interpolator.interpolate(interpEpoch);
|
|
1170
|
+
```
|
|
1171
|
+
|
|
1172
|
+
### Verlet Blend Interpolation
|
|
1173
|
+
|
|
1174
|
+
Optimized for orbital mechanics:
|
|
1175
|
+
|
|
1176
|
+
```typescript
|
|
1177
|
+
import { VerletBlendInterpolator } from 'ootk';
|
|
1178
|
+
|
|
1179
|
+
const interpolator = new VerletBlendInterpolator(states);
|
|
1180
|
+
const interpState = interpolator.interpolate(interpEpoch);
|
|
1181
|
+
```
|
|
1182
|
+
|
|
1183
|
+
### State Interpolator
|
|
1184
|
+
|
|
1185
|
+
Generic state interpolation:
|
|
1186
|
+
|
|
1187
|
+
```typescript
|
|
1188
|
+
import { StateInterpolator } from 'ootk';
|
|
1189
|
+
|
|
1190
|
+
const interpolator = new StateInterpolator(states, 'chebyshev');
|
|
1191
|
+
const interpState = interpolator.interpolate(interpEpoch);
|
|
1192
|
+
```
|
|
1193
|
+
|
|
1194
|
+
### Compression
|
|
1195
|
+
|
|
1196
|
+
Reduce ephemeris data size:
|
|
1197
|
+
|
|
1198
|
+
```typescript
|
|
1199
|
+
import { ChebyshevCompressor } from 'ootk';
|
|
1200
|
+
|
|
1201
|
+
// Generate dense ephemeris
|
|
1202
|
+
const ephemeris = [];
|
|
1203
|
+
for (let i = 0; i < 1000; i++) {
|
|
1204
|
+
ephemeris.push(propagator.propagate(epoch.addSeconds(i * 10)));
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
// Compress to coefficients
|
|
1208
|
+
const compressor = new ChebyshevCompressor(ephemeris, 12); // 12th order
|
|
1209
|
+
const coefficients = compressor.compress();
|
|
1210
|
+
|
|
1211
|
+
// Reconstruct with interpolation
|
|
1212
|
+
const reconstructed = compressor.evaluate(testEpoch);
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
---
|
|
1216
|
+
|
|
1217
|
+
## Mathematical Operations
|
|
1218
|
+
|
|
1219
|
+
### Vector3D
|
|
1220
|
+
|
|
1221
|
+
3D vector operations:
|
|
1222
|
+
|
|
1223
|
+
```typescript
|
|
1224
|
+
import { Vector3D } from 'ootk';
|
|
1225
|
+
|
|
1226
|
+
const v1 = new Vector3D(1, 2, 3);
|
|
1227
|
+
const v2 = new Vector3D(4, 5, 6);
|
|
1228
|
+
|
|
1229
|
+
// Basic operations
|
|
1230
|
+
const sum = v1.add(v2);
|
|
1231
|
+
const diff = v1.subtract(v2);
|
|
1232
|
+
const scaled = v1.scale(2.5);
|
|
1233
|
+
|
|
1234
|
+
// Dot product
|
|
1235
|
+
const dot = v1.dot(v2);
|
|
1236
|
+
|
|
1237
|
+
// Cross product
|
|
1238
|
+
const cross = v1.cross(v2);
|
|
1239
|
+
|
|
1240
|
+
// Magnitude
|
|
1241
|
+
const mag = v1.magnitude();
|
|
1242
|
+
|
|
1243
|
+
// Normalize
|
|
1244
|
+
const unit = v1.normalize();
|
|
1245
|
+
|
|
1246
|
+
// Distance
|
|
1247
|
+
const dist = v1.distance(v2);
|
|
1248
|
+
|
|
1249
|
+
// Angle between vectors
|
|
1250
|
+
const angle = v1.angle(v2); // radians
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
### Vector
|
|
1254
|
+
|
|
1255
|
+
N-dimensional vectors:
|
|
1256
|
+
|
|
1257
|
+
```typescript
|
|
1258
|
+
import { Vector } from 'ootk';
|
|
1259
|
+
|
|
1260
|
+
const v = new Vector([1, 2, 3, 4, 5]);
|
|
1261
|
+
|
|
1262
|
+
// Operations
|
|
1263
|
+
const doubled = v.scale(2);
|
|
1264
|
+
const sum = v.add(new Vector([1, 1, 1, 1, 1]));
|
|
1265
|
+
|
|
1266
|
+
// Norms
|
|
1267
|
+
const norm2 = v.norm(); // L2 norm
|
|
1268
|
+
const norm1 = v.norm(1); // L1 norm
|
|
1269
|
+
const normInf = v.norm(Infinity); // L-infinity norm
|
|
1270
|
+
```
|
|
1271
|
+
|
|
1272
|
+
### Matrix
|
|
1273
|
+
|
|
1274
|
+
Matrix operations:
|
|
1275
|
+
|
|
1276
|
+
```typescript
|
|
1277
|
+
import { Matrix } from 'ootk';
|
|
1278
|
+
|
|
1279
|
+
const m = new Matrix([
|
|
1280
|
+
[1, 2, 3],
|
|
1281
|
+
[4, 5, 6],
|
|
1282
|
+
[7, 8, 9]
|
|
1283
|
+
]);
|
|
1284
|
+
|
|
1285
|
+
// Multiply matrices
|
|
1286
|
+
const product = m.multiply(otherMatrix);
|
|
1287
|
+
|
|
1288
|
+
// Multiply by vector
|
|
1289
|
+
const result = m.multiplyVector(vector);
|
|
1290
|
+
|
|
1291
|
+
// Transpose
|
|
1292
|
+
const transposed = m.transpose();
|
|
1293
|
+
|
|
1294
|
+
// Determinant
|
|
1295
|
+
const det = m.determinant();
|
|
1296
|
+
|
|
1297
|
+
// Inverse
|
|
1298
|
+
const inverse = m.inverse();
|
|
1299
|
+
|
|
1300
|
+
// Identity matrix
|
|
1301
|
+
const identity = Matrix.identity(3);
|
|
1302
|
+
|
|
1303
|
+
// Zero matrix
|
|
1304
|
+
const zeros = Matrix.zeros(3, 3);
|
|
1305
|
+
```
|
|
1306
|
+
|
|
1307
|
+
### Quaternion
|
|
1308
|
+
|
|
1309
|
+
Rotation representation:
|
|
1310
|
+
|
|
1311
|
+
```typescript
|
|
1312
|
+
import { Quaternion, Vector3D } from 'ootk';
|
|
1313
|
+
|
|
1314
|
+
// Create from axis-angle
|
|
1315
|
+
const axis = new Vector3D(0, 0, 1);
|
|
1316
|
+
const angle = Math.PI / 4; // 45 degrees
|
|
1317
|
+
const q = Quaternion.fromAxisAngle(axis, angle);
|
|
1318
|
+
|
|
1319
|
+
// Quaternion operations
|
|
1320
|
+
const product = q1.multiply(q2);
|
|
1321
|
+
const conjugate = q.conjugate();
|
|
1322
|
+
const inverse = q.inverse();
|
|
1323
|
+
|
|
1324
|
+
// Rotate vector
|
|
1325
|
+
const rotated = q.rotateVector(vector);
|
|
1326
|
+
|
|
1327
|
+
// Convert to rotation matrix
|
|
1328
|
+
const rotMatrix = q.toRotationMatrix();
|
|
1329
|
+
|
|
1330
|
+
// Interpolation (SLERP)
|
|
1331
|
+
const interpolated = Quaternion.slerp(q1, q2, 0.5); // 50% between
|
|
1332
|
+
```
|
|
1333
|
+
|
|
1334
|
+
### Euler Angles
|
|
1335
|
+
|
|
1336
|
+
```typescript
|
|
1337
|
+
import { EulerAngles } from 'ootk';
|
|
1338
|
+
|
|
1339
|
+
const euler = new EulerAngles(
|
|
1340
|
+
0.1, // roll (radians)
|
|
1341
|
+
0.2, // pitch
|
|
1342
|
+
0.3 // yaw
|
|
1343
|
+
);
|
|
1344
|
+
|
|
1345
|
+
// Convert to quaternion
|
|
1346
|
+
const quat = euler.toQuaternion();
|
|
1347
|
+
|
|
1348
|
+
// Convert to rotation matrix
|
|
1349
|
+
const matrix = euler.toRotationMatrix();
|
|
1350
|
+
```
|
|
1351
|
+
|
|
1352
|
+
### Random Number Generation
|
|
1353
|
+
|
|
1354
|
+
```typescript
|
|
1355
|
+
import { Random } from 'ootk';
|
|
1356
|
+
|
|
1357
|
+
// Uniform random in [0, 1)
|
|
1358
|
+
const r = Random.uniform();
|
|
1359
|
+
|
|
1360
|
+
// Uniform in range
|
|
1361
|
+
const r2 = Random.uniformRange(-1, 1);
|
|
1362
|
+
|
|
1363
|
+
// Gaussian (normal) distribution
|
|
1364
|
+
const gaussian = Random.gaussian(0, 1); // mean=0, stddev=1
|
|
1365
|
+
|
|
1366
|
+
// Random unit vector
|
|
1367
|
+
const unitVec = Random.unitVector3D();
|
|
1368
|
+
```
|
|
1369
|
+
|
|
1370
|
+
### Box-Muller Transform
|
|
1371
|
+
|
|
1372
|
+
Gaussian random numbers:
|
|
1373
|
+
|
|
1374
|
+
```typescript
|
|
1375
|
+
import { BoxMuller } from 'ootk';
|
|
1376
|
+
|
|
1377
|
+
const generator = new BoxMuller();
|
|
1378
|
+
|
|
1379
|
+
// Generate pair of independent Gaussian random numbers
|
|
1380
|
+
const [z1, z2] = generator.generate();
|
|
1381
|
+
```
|
|
1382
|
+
|
|
1383
|
+
---
|
|
1384
|
+
|
|
1385
|
+
## Optimization
|
|
1386
|
+
|
|
1387
|
+
### Golden Section Search
|
|
1388
|
+
|
|
1389
|
+
1D optimization:
|
|
1390
|
+
|
|
1391
|
+
```typescript
|
|
1392
|
+
import { GoldenSection } from 'ootk';
|
|
1393
|
+
|
|
1394
|
+
// Find minimum of function
|
|
1395
|
+
const optimizer = new GoldenSection(
|
|
1396
|
+
func, // function to minimize
|
|
1397
|
+
lowerBound, // search range start
|
|
1398
|
+
upperBound, // search range end
|
|
1399
|
+
tolerance // convergence tolerance
|
|
1400
|
+
);
|
|
1401
|
+
|
|
1402
|
+
const result = optimizer.optimize();
|
|
1403
|
+
console.log(result.x); // Optimal value
|
|
1404
|
+
console.log(result.fval); // Function value at optimum
|
|
1405
|
+
console.log(result.iterations);
|
|
1406
|
+
```
|
|
1407
|
+
|
|
1408
|
+
### Downhill Simplex (Nelder-Mead)
|
|
1409
|
+
|
|
1410
|
+
Multi-dimensional optimization:
|
|
1411
|
+
|
|
1412
|
+
```typescript
|
|
1413
|
+
import { DownhillSimplex } from 'ootk';
|
|
1414
|
+
|
|
1415
|
+
// Minimize function of multiple variables
|
|
1416
|
+
const optimizer = new DownhillSimplex(
|
|
1417
|
+
func, // function to minimize
|
|
1418
|
+
initialGuess, // starting point
|
|
1419
|
+
{
|
|
1420
|
+
tolerance: 1e-6,
|
|
1421
|
+
maxIterations: 1000
|
|
1422
|
+
}
|
|
1423
|
+
);
|
|
1424
|
+
|
|
1425
|
+
const result = optimizer.optimize();
|
|
1426
|
+
console.log(result.x); // Optimal parameters
|
|
1427
|
+
console.log(result.fval); // Final function value
|
|
1428
|
+
console.log(result.converged);
|
|
1429
|
+
```
|
|
1430
|
+
|
|
1431
|
+
### Polynomial Regression
|
|
1432
|
+
|
|
1433
|
+
Fit polynomial to data:
|
|
1434
|
+
|
|
1435
|
+
```typescript
|
|
1436
|
+
import { PolynomialRegression } from 'ootk';
|
|
1437
|
+
|
|
1438
|
+
const x = [1, 2, 3, 4, 5];
|
|
1439
|
+
const y = [2.1, 3.9, 6.2, 8.1, 9.9];
|
|
1440
|
+
|
|
1441
|
+
// Fit 2nd degree polynomial
|
|
1442
|
+
const regression = new PolynomialRegression(x, y, 2);
|
|
1443
|
+
|
|
1444
|
+
// Get coefficients
|
|
1445
|
+
const coeffs = regression.getCoefficients();
|
|
1446
|
+
|
|
1447
|
+
// Predict
|
|
1448
|
+
const yPred = regression.predict(3.5);
|
|
1449
|
+
|
|
1450
|
+
// R-squared
|
|
1451
|
+
const r2 = regression.rSquared();
|
|
1452
|
+
```
|
|
1453
|
+
|
|
1454
|
+
### Simple Linear Regression
|
|
1455
|
+
|
|
1456
|
+
```typescript
|
|
1457
|
+
import { SimpleLinearRegression } from 'ootk';
|
|
1458
|
+
|
|
1459
|
+
const regression = new SimpleLinearRegression(x, y);
|
|
1460
|
+
|
|
1461
|
+
console.log(regression.slope);
|
|
1462
|
+
console.log(regression.intercept);
|
|
1463
|
+
console.log(regression.rSquared);
|
|
1464
|
+
|
|
1465
|
+
const predicted = regression.predict(newX);
|
|
1466
|
+
```
|
|
1467
|
+
|
|
1468
|
+
---
|
|
1469
|
+
|
|
1470
|
+
## Covariance
|
|
1471
|
+
|
|
1472
|
+
Track state uncertainty for orbit determination and propagation.
|
|
1473
|
+
|
|
1474
|
+
### State Covariance
|
|
1475
|
+
|
|
1476
|
+
```typescript
|
|
1477
|
+
import { StateCovariance, Matrix } from 'ootk';
|
|
1478
|
+
|
|
1479
|
+
// Create 6x6 covariance matrix (position + velocity)
|
|
1480
|
+
const covMatrix = new Matrix([
|
|
1481
|
+
[100, 0, 0, 0, 0, 0], // σ²_x
|
|
1482
|
+
[0, 100, 0, 0, 0, 0], // σ²_y
|
|
1483
|
+
[0, 0, 100, 0, 0, 0], // σ²_z
|
|
1484
|
+
[0, 0, 0, 0.01, 0, 0], // σ²_vx
|
|
1485
|
+
[0, 0, 0, 0, 0.01, 0], // σ²_vy
|
|
1486
|
+
[0, 0, 0, 0, 0, 0.01] // σ²_vz
|
|
1487
|
+
]);
|
|
1488
|
+
|
|
1489
|
+
const covariance = new StateCovariance(epoch, state, covMatrix);
|
|
1490
|
+
|
|
1491
|
+
// Propagate covariance
|
|
1492
|
+
const futureCov = covariance.propagate(futureEpoch, propagator);
|
|
1493
|
+
|
|
1494
|
+
// Get position uncertainty
|
|
1495
|
+
const posUncertainty = covariance.getPositionUncertainty(); // km
|
|
1496
|
+
|
|
1497
|
+
// Get velocity uncertainty
|
|
1498
|
+
const velUncertainty = covariance.getVelocityUncertainty(); // km/s
|
|
1499
|
+
|
|
1500
|
+
// Get standard deviations
|
|
1501
|
+
const stdDevs = covariance.getStandardDeviations();
|
|
1502
|
+
console.log('X uncertainty:', stdDevs.position.x, 'km');
|
|
1503
|
+
```
|
|
1504
|
+
|
|
1505
|
+
### Covariance from TLE
|
|
1506
|
+
|
|
1507
|
+
Estimate uncertainty from TLE:
|
|
1508
|
+
|
|
1509
|
+
```typescript
|
|
1510
|
+
import { Satellite } from 'ootk';
|
|
1511
|
+
|
|
1512
|
+
const satellite = new Satellite({ tle1, tle2 });
|
|
1513
|
+
const covariance = satellite.getCovariance();
|
|
1514
|
+
```
|
|
1515
|
+
|
|
1516
|
+
### Covariance Sampling
|
|
1517
|
+
|
|
1518
|
+
Generate samples from distribution:
|
|
1519
|
+
|
|
1520
|
+
```typescript
|
|
1521
|
+
import { CovarianceSample } from 'ootk';
|
|
1522
|
+
|
|
1523
|
+
const samples = CovarianceSample.generate(
|
|
1524
|
+
state,
|
|
1525
|
+
covariance,
|
|
1526
|
+
1000 // number of samples
|
|
1527
|
+
);
|
|
1528
|
+
|
|
1529
|
+
// Use samples for Monte Carlo analysis
|
|
1530
|
+
samples.forEach(sample => {
|
|
1531
|
+
const propagated = propagator.propagate(futureEpoch);
|
|
1532
|
+
// ... analyze
|
|
1533
|
+
});
|
|
1534
|
+
```
|
|
1535
|
+
|
|
1536
|
+
---
|
|
1537
|
+
|
|
1538
|
+
## Celestial Bodies
|
|
1539
|
+
|
|
1540
|
+
### Earth
|
|
1541
|
+
|
|
1542
|
+
Earth properties and models:
|
|
1543
|
+
|
|
1544
|
+
```typescript
|
|
1545
|
+
import { Earth } from 'ootk';
|
|
1546
|
+
|
|
1547
|
+
// Physical constants
|
|
1548
|
+
console.log(Earth.radiusEquator); // km
|
|
1549
|
+
console.log(Earth.radiusPolar); // km
|
|
1550
|
+
console.log(Earth.radiusMean); // km
|
|
1551
|
+
console.log(Earth.flattening);
|
|
1552
|
+
console.log(Earth.mu); // Gravitational parameter
|
|
1553
|
+
console.log(Earth.angularVelocity); // rad/s
|
|
1554
|
+
|
|
1555
|
+
// Gravitational harmonics
|
|
1556
|
+
console.log(Earth.j2);
|
|
1557
|
+
console.log(Earth.j3);
|
|
1558
|
+
console.log(Earth.j4);
|
|
1559
|
+
console.log(Earth.j5);
|
|
1560
|
+
|
|
1561
|
+
// Precession and nutation
|
|
1562
|
+
const precession = Earth.precession(epoch);
|
|
1563
|
+
const nutation = Earth.nutation(epoch);
|
|
1564
|
+
```
|
|
1565
|
+
|
|
1566
|
+
### Moon
|
|
1567
|
+
|
|
1568
|
+
Lunar position and properties:
|
|
1569
|
+
|
|
1570
|
+
```typescript
|
|
1571
|
+
import { Moon } from 'ootk';
|
|
1572
|
+
|
|
1573
|
+
// Moon position in ECI
|
|
1574
|
+
const moonPos = Moon.position(epoch);
|
|
1575
|
+
console.log(moonPos); // { x, y, z } in km
|
|
1576
|
+
|
|
1577
|
+
// Moon velocity
|
|
1578
|
+
const moonVel = Moon.velocity(epoch);
|
|
1579
|
+
|
|
1580
|
+
// Illumination angles
|
|
1581
|
+
const illum = Moon.illumination(epoch, observerPos);
|
|
1582
|
+
console.log(illum.phase); // 0-1 (0=new, 0.5=full)
|
|
1583
|
+
console.log(illum.angle); // Phase angle
|
|
1584
|
+
console.log(illum.fraction); // Illuminated fraction
|
|
1585
|
+
|
|
1586
|
+
// Physical constants
|
|
1587
|
+
console.log(Moon.radius);
|
|
1588
|
+
console.log(Moon.mu);
|
|
1589
|
+
```
|
|
1590
|
+
|
|
1591
|
+
### Sun
|
|
1592
|
+
|
|
1593
|
+
Solar position and calculations:
|
|
1594
|
+
|
|
1595
|
+
```typescript
|
|
1596
|
+
import { Sun } from 'ootk';
|
|
1597
|
+
|
|
1598
|
+
// Sun position in ECI
|
|
1599
|
+
const sunPos = Sun.position(epoch);
|
|
1600
|
+
console.log(sunPos); // { x, y, z } in km
|
|
1601
|
+
|
|
1602
|
+
// Sun velocity
|
|
1603
|
+
const sunVel = Sun.velocity(epoch);
|
|
1604
|
+
|
|
1605
|
+
// Check if position is in Earth's shadow
|
|
1606
|
+
const inShadow = Sun.isInEarthShadow(satellitePos, epoch);
|
|
1607
|
+
|
|
1608
|
+
// Eclipse calculations
|
|
1609
|
+
const eclipse = Sun.getEclipse(satellitePos, epoch);
|
|
1610
|
+
console.log(eclipse.umbra); // In umbra (total shadow)
|
|
1611
|
+
console.log(eclipse.penumbra); // In penumbra (partial shadow)
|
|
1612
|
+
console.log(eclipse.sunlit); // In sunlight
|
|
1613
|
+
|
|
1614
|
+
// Solar radiation pressure magnitude
|
|
1615
|
+
const srp = Sun.radiationPressure(
|
|
1616
|
+
area, // m²
|
|
1617
|
+
mass, // kg
|
|
1618
|
+
coeff // radiation coefficient
|
|
1619
|
+
);
|
|
1620
|
+
```
|
|
1621
|
+
|
|
1622
|
+
---
|
|
1623
|
+
|
|
1624
|
+
## Maneuvers
|
|
1625
|
+
|
|
1626
|
+
Plan and execute orbital maneuvers.
|
|
1627
|
+
|
|
1628
|
+
### Hohmann Transfer
|
|
1629
|
+
|
|
1630
|
+
Classic two-burn transfer:
|
|
1631
|
+
|
|
1632
|
+
```typescript
|
|
1633
|
+
import { TwoBurnOrbitTransfer, Kilometers } from 'ootk';
|
|
1634
|
+
|
|
1635
|
+
// Transfer from LEO to GEO
|
|
1636
|
+
const r1 = 6778 as Kilometers; // LEO radius
|
|
1637
|
+
const r2 = 42164 as Kilometers; // GEO radius
|
|
1638
|
+
|
|
1639
|
+
const transfer = TwoBurnOrbitTransfer.hohmannTransfer(r1, r2);
|
|
1640
|
+
|
|
1641
|
+
console.log(transfer.deltaV1); // First burn Δv (km/s)
|
|
1642
|
+
console.log(transfer.deltaV2); // Second burn Δv
|
|
1643
|
+
console.log(transfer.totalDeltaV); // Total Δv required
|
|
1644
|
+
console.log(transfer.transferTime); // Transfer duration (seconds)
|
|
1645
|
+
|
|
1646
|
+
// Convert to maneuver objects
|
|
1647
|
+
const maneuvers = transfer.toManeuvers(startEpoch);
|
|
1648
|
+
```
|
|
1649
|
+
|
|
1650
|
+
### Bi-elliptic Transfer
|
|
1651
|
+
|
|
1652
|
+
Three-burn transfer (sometimes more efficient):
|
|
1653
|
+
|
|
1654
|
+
```typescript
|
|
1655
|
+
const transfer = TwoBurnOrbitTransfer.biellipticTransfer(
|
|
1656
|
+
r1, // Initial radius
|
|
1657
|
+
r2, // Final radius
|
|
1658
|
+
rb // Apoapsis of first transfer ellipse
|
|
1659
|
+
);
|
|
1660
|
+
```
|
|
1661
|
+
|
|
1662
|
+
### Maneuver Object
|
|
1663
|
+
|
|
1664
|
+
Individual maneuver:
|
|
1665
|
+
|
|
1666
|
+
```typescript
|
|
1667
|
+
import { Maneuver, Vector3D } from 'ootk';
|
|
1668
|
+
|
|
1669
|
+
const maneuver = new Maneuver({
|
|
1670
|
+
epoch: burnEpoch,
|
|
1671
|
+
deltaV: new Vector3D(0.5, 0.1, 0), // Δv vector in km/s
|
|
1672
|
+
duration: 60, // Burn duration in seconds
|
|
1673
|
+
direction: 'prograde' // or 'retrograde', 'normal', 'radial'
|
|
1674
|
+
});
|
|
1675
|
+
|
|
1676
|
+
// Apply to state
|
|
1677
|
+
const newState = maneuver.apply(currentState);
|
|
1678
|
+
```
|
|
1679
|
+
|
|
1680
|
+
### Plane Change
|
|
1681
|
+
|
|
1682
|
+
```typescript
|
|
1683
|
+
import { planeChange } from 'ootk';
|
|
1684
|
+
|
|
1685
|
+
// Calculate Δv for plane change
|
|
1686
|
+
const deltaV = planeChange(
|
|
1687
|
+
velocity, // Current velocity (km/s)
|
|
1688
|
+
angleChange // Angle to change (radians)
|
|
1689
|
+
);
|
|
1690
|
+
```
|
|
1691
|
+
|
|
1692
|
+
### Inclination Change
|
|
1693
|
+
|
|
1694
|
+
```typescript
|
|
1695
|
+
const deltaV = inclinationChange(
|
|
1696
|
+
velocity,
|
|
1697
|
+
currentInclination,
|
|
1698
|
+
targetInclination
|
|
1699
|
+
);
|
|
1700
|
+
```
|
|
1701
|
+
|
|
1702
|
+
---
|
|
1703
|
+
|
|
1704
|
+
## Advanced Topics
|
|
1705
|
+
|
|
1706
|
+
### Custom Propagators
|
|
1707
|
+
|
|
1708
|
+
Create custom propagator:
|
|
1709
|
+
|
|
1710
|
+
```typescript
|
|
1711
|
+
import { Propagator, J2000, EpochUTC } from 'ootk';
|
|
1712
|
+
|
|
1713
|
+
class MyPropagator extends Propagator {
|
|
1714
|
+
propagate(epoch: EpochUTC): J2000 {
|
|
1715
|
+
// Your custom propagation logic
|
|
1716
|
+
return new J2000(epoch, position, velocity);
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
```
|
|
1720
|
+
|
|
1721
|
+
### Gravity Field Models
|
|
1722
|
+
|
|
1723
|
+
Use custom gravity coefficients:
|
|
1724
|
+
|
|
1725
|
+
```typescript
|
|
1726
|
+
import { EarthGravity } from 'ootk';
|
|
1727
|
+
|
|
1728
|
+
const gravity = new EarthGravity(20, 20); // 20x20 field
|
|
1729
|
+
|
|
1730
|
+
// Set custom coefficients
|
|
1731
|
+
gravity.setCoefficient(2, 0, customJ2);
|
|
1732
|
+
gravity.setCoefficient(3, 0, customJ3);
|
|
1733
|
+
```
|
|
1734
|
+
|
|
1735
|
+
### Ephemeris Generation
|
|
1736
|
+
|
|
1737
|
+
Generate ephemeris table:
|
|
1738
|
+
|
|
1739
|
+
```typescript
|
|
1740
|
+
const startEpoch = EpochUTC.fromDateTime(new Date());
|
|
1741
|
+
const ephemeris = [];
|
|
1742
|
+
|
|
1743
|
+
for (let i = 0; i < 1440; i++) { // 24 hours, 1-minute intervals
|
|
1744
|
+
const epoch = startEpoch.addMinutes(i);
|
|
1745
|
+
const state = propagator.propagate(epoch);
|
|
1746
|
+
|
|
1747
|
+
ephemeris.push({
|
|
1748
|
+
epoch: epoch.toDateTime(),
|
|
1749
|
+
position: state.position,
|
|
1750
|
+
velocity: state.velocity,
|
|
1751
|
+
lla: state.toGeodetic()
|
|
1752
|
+
});
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
// Save or use ephemeris
|
|
1756
|
+
```
|
|
1757
|
+
|
|
1758
|
+
### Sensor Network
|
|
1759
|
+
|
|
1760
|
+
Multiple sensor visibility:
|
|
1761
|
+
|
|
1762
|
+
```typescript
|
|
1763
|
+
const sensors = [sensor1, sensor2, sensor3];
|
|
1764
|
+
|
|
1765
|
+
const visibility = sensors.map(sensor => ({
|
|
1766
|
+
sensor: sensor.name,
|
|
1767
|
+
visible: sensor.isSatInFov(satellite),
|
|
1768
|
+
rae: sensor.rae(satellite)
|
|
1769
|
+
}));
|
|
1770
|
+
|
|
1771
|
+
// Find which sensors can see satellite
|
|
1772
|
+
const visibleFrom = visibility.filter(v => v.visible);
|
|
1773
|
+
```
|
|
1774
|
+
|
|
1775
|
+
### Collision Detection
|
|
1776
|
+
|
|
1777
|
+
Check for close approaches:
|
|
1778
|
+
|
|
1779
|
+
```typescript
|
|
1780
|
+
// Propagate both objects
|
|
1781
|
+
const state1 = satellite1.toJ2000(epoch);
|
|
1782
|
+
const state2 = satellite2.toJ2000(epoch);
|
|
1783
|
+
|
|
1784
|
+
// Calculate distance
|
|
1785
|
+
const distance = state1.position.distance(state2.position);
|
|
1786
|
+
|
|
1787
|
+
if (distance < threshold) {
|
|
1788
|
+
console.warn('Close approach detected!');
|
|
1789
|
+
console.log('Distance:', distance, 'km');
|
|
1790
|
+
console.log('Relative velocity:',
|
|
1791
|
+
state1.velocity.subtract(state2.velocity).magnitude());
|
|
1792
|
+
}
|
|
1793
|
+
```
|
|
1794
|
+
|
|
1795
|
+
### Catalog Management
|
|
1796
|
+
|
|
1797
|
+
Work with satellite catalogs:
|
|
1798
|
+
|
|
1799
|
+
```typescript
|
|
1800
|
+
import { Satellite } from 'ootk';
|
|
1801
|
+
|
|
1802
|
+
const catalog = [];
|
|
1803
|
+
|
|
1804
|
+
// Load TLEs
|
|
1805
|
+
tleData.forEach(tle => {
|
|
1806
|
+
const sat = new Satellite({
|
|
1807
|
+
tle1: tle.line1,
|
|
1808
|
+
tle2: tle.line2
|
|
1809
|
+
});
|
|
1810
|
+
catalog.push(sat);
|
|
1811
|
+
});
|
|
1812
|
+
|
|
1813
|
+
// Find satellites by criteria
|
|
1814
|
+
const leoSats = catalog.filter(sat =>
|
|
1815
|
+
sat.apogee < 2000 && sat.perigee > 200
|
|
1816
|
+
);
|
|
1817
|
+
|
|
1818
|
+
const highInclination = catalog.filter(sat =>
|
|
1819
|
+
sat.inclination > 80
|
|
1820
|
+
);
|
|
1821
|
+
```
|
|
1822
|
+
|
|
1823
|
+
### State Vector Manipulation
|
|
1824
|
+
|
|
1825
|
+
```typescript
|
|
1826
|
+
import { StateVector } from 'ootk';
|
|
1827
|
+
|
|
1828
|
+
const state = new StateVector(epoch, position, velocity);
|
|
1829
|
+
|
|
1830
|
+
// Transform coordinate systems
|
|
1831
|
+
const j2000 = state.toJ2000();
|
|
1832
|
+
const itrf = state.toITRF();
|
|
1833
|
+
|
|
1834
|
+
// Get orbital elements
|
|
1835
|
+
const elements = state.toClassicalElements();
|
|
1836
|
+
|
|
1837
|
+
// Add relative motion
|
|
1838
|
+
const ricDelta = { x: 10, y: 0, z: 0 }; // 10 km radial
|
|
1839
|
+
const newState = state.addRIC(ricDelta);
|
|
1840
|
+
```
|
|
1841
|
+
|
|
1842
|
+
### Performance Optimization
|
|
1843
|
+
|
|
1844
|
+
Tips for optimal performance:
|
|
1845
|
+
|
|
1846
|
+
```typescript
|
|
1847
|
+
// 1. Reuse propagators
|
|
1848
|
+
const propagator = new Sgp4Propagator(satellite);
|
|
1849
|
+
for (let i = 0; i < 1000; i++) {
|
|
1850
|
+
const state = propagator.propagate(epochs[i]); // Fast
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
// 2. Batch operations
|
|
1854
|
+
const states = epochs.map(epoch => propagator.propagate(epoch));
|
|
1855
|
+
|
|
1856
|
+
// 3. Use appropriate propagator
|
|
1857
|
+
// - SGP4 for TLE data (fastest)
|
|
1858
|
+
// - Kepler for quick estimates
|
|
1859
|
+
// - RK4 for balanced precision/speed
|
|
1860
|
+
// - RK89 only when high precision needed
|
|
1861
|
+
|
|
1862
|
+
// 4. Reduce gravity field degree for distant objects
|
|
1863
|
+
const forceModel = distance > 10000
|
|
1864
|
+
? new ForceModel().setEarthGravity(4, 4)
|
|
1865
|
+
: new ForceModel().setEarthGravity(20, 20);
|
|
1866
|
+
|
|
1867
|
+
// 5. Cache calculations
|
|
1868
|
+
const cached = new Map();
|
|
1869
|
+
function getState(satellite, epoch) {
|
|
1870
|
+
const key = `${satellite.id}-${epoch.toJulianDate()}`;
|
|
1871
|
+
if (!cached.has(key)) {
|
|
1872
|
+
cached.set(key, satellite.eci(epoch.toDateTime()));
|
|
1873
|
+
}
|
|
1874
|
+
return cached.get(key);
|
|
1875
|
+
}
|
|
1876
|
+
```
|
|
1877
|
+
|
|
1878
|
+
---
|
|
1879
|
+
|
|
1880
|
+
## Appendix: Quick Reference
|
|
1881
|
+
|
|
1882
|
+
### Common Conversions
|
|
1883
|
+
|
|
1884
|
+
```typescript
|
|
1885
|
+
import { DEG2RAD, RAD2DEG, MINUTES_PER_DAY } from 'ootk';
|
|
1886
|
+
|
|
1887
|
+
const radians = degrees * DEG2RAD;
|
|
1888
|
+
const degrees = radians * RAD2DEG;
|
|
1889
|
+
|
|
1890
|
+
// Mean motion to period
|
|
1891
|
+
const period = MINUTES_PER_DAY / meanMotion;
|
|
1892
|
+
|
|
1893
|
+
// Period to semi-major axis
|
|
1894
|
+
const a = Math.cbrt((Earth.mu * (period * 60)**2) / (4 * Math.PI**2));
|
|
1895
|
+
```
|
|
1896
|
+
|
|
1897
|
+
### Useful Constants
|
|
1898
|
+
|
|
1899
|
+
```typescript
|
|
1900
|
+
import { Earth } from 'ootk';
|
|
1901
|
+
|
|
1902
|
+
Earth.radiusEquator; // 6378.137 km
|
|
1903
|
+
Earth.radiusMean; // 6371.0 km
|
|
1904
|
+
Earth.mu; // 398600.4418 km³/s²
|
|
1905
|
+
Earth.j2; // 0.00108263
|
|
1906
|
+
Earth.angularVelocity; // 7.2921159e-5 rad/s
|
|
1907
|
+
```
|
|
1908
|
+
|
|
1909
|
+
### Type Casting
|
|
1910
|
+
|
|
1911
|
+
```typescript
|
|
1912
|
+
// Always cast numeric literals to appropriate types
|
|
1913
|
+
const lat = 41.754785 as Degrees;
|
|
1914
|
+
const alt = 400 as Kilometers;
|
|
1915
|
+
const vel = 7.8 as KilometersPerSecond;
|
|
1916
|
+
```
|
|
1917
|
+
|
|
1918
|
+
---
|
|
1919
|
+
|
|
1920
|
+
## Support and Resources
|
|
1921
|
+
|
|
1922
|
+
- **GitHub**: https://github.com/thkruz/ootk
|
|
1923
|
+
- **Issues**: https://github.com/thkruz/ootk/issues
|
|
1924
|
+
- **NPM**: https://www.npmjs.com/package/ootk
|
|
1925
|
+
- **Examples**: `/examples` directory in repository
|
|
1926
|
+
|
|
1927
|
+
For questions or contributions, please open an issue on GitHub.
|
|
1928
|
+
|
|
1929
|
+
---
|
|
1930
|
+
|
|
1931
|
+
**License**: AGPL-3.0
|
|
1932
|
+
|
|
1933
|
+
**Author**: Theodore Kruczek
|
|
1934
|
+
|
|
1935
|
+
**Version**: 5.1.1
|