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,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
|
+
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
|
+
*
|
|
6
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
7
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
8
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
11
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
* See the GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
import { Matrix } from '../operations/Matrix.js';
|
|
18
|
+
/**
|
|
19
|
+
* Represents the result of a conjunction assessment between two space objects.
|
|
20
|
+
* Contains all relevant information about the close approach event.
|
|
21
|
+
*/
|
|
22
|
+
export class ConjunctionEvent {
|
|
23
|
+
tca;
|
|
24
|
+
primaryState;
|
|
25
|
+
secondaryState;
|
|
26
|
+
relativeState;
|
|
27
|
+
missDistance;
|
|
28
|
+
radialDistance;
|
|
29
|
+
intrackDistance;
|
|
30
|
+
crosstrackDistance;
|
|
31
|
+
relativeVelocity;
|
|
32
|
+
combinedCovariance;
|
|
33
|
+
probabilityOfCollision;
|
|
34
|
+
primaryRadius;
|
|
35
|
+
secondaryRadius;
|
|
36
|
+
constructor(
|
|
37
|
+
/** Time of Closest Approach (TCA) */
|
|
38
|
+
tca,
|
|
39
|
+
/** Primary object state at TCA in J2000 frame */
|
|
40
|
+
primaryState,
|
|
41
|
+
/** Secondary object state at TCA in J2000 frame */
|
|
42
|
+
secondaryState,
|
|
43
|
+
/** Relative state in RIC frame (relative to primary) */
|
|
44
|
+
relativeState,
|
|
45
|
+
/** Total miss distance at TCA (km) */
|
|
46
|
+
missDistance,
|
|
47
|
+
/** Radial component of miss distance (km) */
|
|
48
|
+
radialDistance,
|
|
49
|
+
/** Intrack component of miss distance (km) */
|
|
50
|
+
intrackDistance,
|
|
51
|
+
/** Crosstrack component of miss distance (km) */
|
|
52
|
+
crosstrackDistance,
|
|
53
|
+
/** Relative velocity magnitude at TCA (km/s) */
|
|
54
|
+
relativeVelocity,
|
|
55
|
+
/** Combined position covariance matrix in RIC frame (optional) */
|
|
56
|
+
combinedCovariance,
|
|
57
|
+
/** Probability of collision (optional, 0-1) */
|
|
58
|
+
probabilityOfCollision,
|
|
59
|
+
/** Hard body radius for primary object (km, optional) */
|
|
60
|
+
primaryRadius,
|
|
61
|
+
/** Hard body radius for secondary object (km, optional) */
|
|
62
|
+
secondaryRadius) {
|
|
63
|
+
this.tca = tca;
|
|
64
|
+
this.primaryState = primaryState;
|
|
65
|
+
this.secondaryState = secondaryState;
|
|
66
|
+
this.relativeState = relativeState;
|
|
67
|
+
this.missDistance = missDistance;
|
|
68
|
+
this.radialDistance = radialDistance;
|
|
69
|
+
this.intrackDistance = intrackDistance;
|
|
70
|
+
this.crosstrackDistance = crosstrackDistance;
|
|
71
|
+
this.relativeVelocity = relativeVelocity;
|
|
72
|
+
this.combinedCovariance = combinedCovariance;
|
|
73
|
+
this.probabilityOfCollision = probabilityOfCollision;
|
|
74
|
+
this.primaryRadius = primaryRadius;
|
|
75
|
+
this.secondaryRadius = secondaryRadius;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns a formatted string representation of the conjunction event.
|
|
79
|
+
* @returns A multi-line string with conjunction details.
|
|
80
|
+
*/
|
|
81
|
+
toString() {
|
|
82
|
+
const lines = [
|
|
83
|
+
'[Conjunction Event]',
|
|
84
|
+
` TCA: ${this.tca.toString()}`,
|
|
85
|
+
` Miss Distance: ${this.missDistance.toFixed(6)} km`,
|
|
86
|
+
` Radial: ${this.radialDistance.toFixed(6)} km`,
|
|
87
|
+
` Intrack: ${this.intrackDistance.toFixed(6)} km`,
|
|
88
|
+
` Crosstrack: ${this.crosstrackDistance.toFixed(6)} km`,
|
|
89
|
+
` Relative Velocity: ${this.relativeVelocity.toFixed(6)} km/s`,
|
|
90
|
+
];
|
|
91
|
+
if (this.probabilityOfCollision !== undefined) {
|
|
92
|
+
lines.push(` Probability of Collision: ${this.probabilityOfCollision.toExponential(6)}`);
|
|
93
|
+
}
|
|
94
|
+
if (this.primaryRadius !== undefined && this.secondaryRadius !== undefined) {
|
|
95
|
+
const combinedRadius = this.primaryRadius + this.secondaryRadius;
|
|
96
|
+
lines.push(` Combined Hard Body Radius: ${combinedRadius.toFixed(3)} km`);
|
|
97
|
+
}
|
|
98
|
+
return lines.join('\n');
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Checks if this is a high-risk conjunction based on miss distance and Pc.
|
|
102
|
+
* @param distanceThreshold Miss distance threshold in km (default: 1.0 km)
|
|
103
|
+
* @param pcThreshold Probability of collision threshold (default: 1e-4)
|
|
104
|
+
* @returns True if the conjunction exceeds risk thresholds.
|
|
105
|
+
*/
|
|
106
|
+
isHighRisk(distanceThreshold = 1.0, pcThreshold = 1e-4) {
|
|
107
|
+
const distanceRisk = this.missDistance < distanceThreshold;
|
|
108
|
+
const pcRisk = this.probabilityOfCollision !== undefined && this.probabilityOfCollision > pcThreshold;
|
|
109
|
+
return distanceRisk || pcRisk;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Gets the Mahalanobis distance if covariance is available.
|
|
113
|
+
* This is the miss distance normalized by the combined covariance.
|
|
114
|
+
* @returns The Mahalanobis distance (unitless), or undefined if no covariance.
|
|
115
|
+
*/
|
|
116
|
+
getMahalanobisDistance() {
|
|
117
|
+
if (!this.combinedCovariance) {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
// Extract position-only covariance (first 3x3 block)
|
|
121
|
+
const posCovariance = this.extractPositionCovariance(this.combinedCovariance.matrix);
|
|
122
|
+
const relativePosition = [
|
|
123
|
+
this.relativeState.position.x,
|
|
124
|
+
this.relativeState.position.y,
|
|
125
|
+
this.relativeState.position.z,
|
|
126
|
+
];
|
|
127
|
+
try {
|
|
128
|
+
// Compute Mahalanobis distance: sqrt(r^T * C^-1 * r)
|
|
129
|
+
const covInv = posCovariance.inverse();
|
|
130
|
+
const temp = covInv.multiplyVector(relativePosition);
|
|
131
|
+
let mahalanobis = 0;
|
|
132
|
+
for (let i = 0; i < 3; i++) {
|
|
133
|
+
mahalanobis += relativePosition[i] * temp[i];
|
|
134
|
+
}
|
|
135
|
+
return Math.sqrt(mahalanobis);
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
// Covariance may be singular
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Extracts the 3x3 position covariance from a 6x6 state covariance matrix.
|
|
144
|
+
* @param stateCov 6x6 state covariance matrix
|
|
145
|
+
* @returns 3x3 position covariance matrix
|
|
146
|
+
*/
|
|
147
|
+
extractPositionCovariance(stateCov) {
|
|
148
|
+
const elements = [
|
|
149
|
+
[stateCov.elements[0][0], stateCov.elements[0][1], stateCov.elements[0][2]],
|
|
150
|
+
[stateCov.elements[1][0], stateCov.elements[1][1], stateCov.elements[1][2]],
|
|
151
|
+
[stateCov.elements[2][0], stateCov.elements[2][1], stateCov.elements[2][2]],
|
|
152
|
+
];
|
|
153
|
+
return new Matrix(elements);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=ConjunctionEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConjunctionEvent.js","sourceRoot":"","sources":["../../src/conjunction/ConjunctionEvent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAGlB;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;IAEA;IA1BT;IACE,qCAAqC;IAC9B,GAAa;IACpB,iDAAiD;IAC1C,YAAmB;IAC1B,mDAAmD;IAC5C,cAAqB;IAC5B,wDAAwD;IACjD,aAAkB;IACzB,sCAAsC;IAC/B,YAAwB;IAC/B,6CAA6C;IACtC,cAA0B;IACjC,8CAA8C;IACvC,eAA2B;IAClC,iDAAiD;IAC1C,kBAA8B;IACrC,gDAAgD;IACzC,gBAAqC;IAC5C,kEAAkE;IAC3D,kBAAoC;IAC3C,+CAA+C;IACxC,sBAA+B;IACtC,yDAAyD;IAClD,aAA0B;IACjC,2DAA2D;IACpD,eAA4B;QAxB5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C,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAC/C,CAAC;YAED,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,6BAA6B;YAC7B,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED;;;;OAIG;IACK,yBAAyB,CAAC,QAAgB;QAChD,MAAM,QAAQ,GAAG;YACf,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3E,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3E,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5E,CAAC;QAEF,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
|
+
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
|
+
*
|
|
6
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
7
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
8
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
11
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
* See the GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
import { Vector3D } from '../operations/Vector3D.js';
|
|
18
|
+
import type { StateCovariance } from '../covariance/StateCovariance.js';
|
|
19
|
+
import type { Kilometers } from '../main.js';
|
|
20
|
+
/**
|
|
21
|
+
* Probability of Collision calculator using Chan's 2D method.
|
|
22
|
+
*
|
|
23
|
+
* This implementation projects the combined covariance matrix onto the
|
|
24
|
+
* encounter plane (B-plane) perpendicular to the relative velocity vector,
|
|
25
|
+
* then computes the probability that the relative position lies within
|
|
26
|
+
* the combined hard body radius.
|
|
27
|
+
*
|
|
28
|
+
* Reference: Chan, F. K. (2008). "Spacecraft Collision Probability"
|
|
29
|
+
*/
|
|
30
|
+
export declare class ProbabilityOfCollision {
|
|
31
|
+
/**
|
|
32
|
+
* Computes probability of collision using Chan's 2D method.
|
|
33
|
+
*
|
|
34
|
+
* @param relativePosition Relative position vector in RIC frame (km)
|
|
35
|
+
* @param relativeVelocity Relative velocity vector in RIC frame (km/s)
|
|
36
|
+
* @param combinedCovariance Combined position covariance in RIC frame (6x6)
|
|
37
|
+
* @param combinedRadius Combined hard body radius (km)
|
|
38
|
+
* @returns Probability of collision (0 to 1)
|
|
39
|
+
*/
|
|
40
|
+
static calculate(relativePosition: Vector3D<Kilometers>, relativeVelocity: Vector3D, combinedCovariance: StateCovariance, combinedRadius: Kilometers): number;
|
|
41
|
+
/**
|
|
42
|
+
* Calculates 2D probability of collision in the encounter plane.
|
|
43
|
+
*
|
|
44
|
+
* Uses the analytical solution for 2D Gaussian probability within a circle.
|
|
45
|
+
*
|
|
46
|
+
* @param x X-coordinate in encounter plane (km)
|
|
47
|
+
* @param y Y-coordinate in encounter plane (km)
|
|
48
|
+
* @param cov2D 2x2 covariance matrix in encounter plane
|
|
49
|
+
* @param radius Combined hard body radius (km)
|
|
50
|
+
* @returns Probability of collision (0 to 1)
|
|
51
|
+
*/
|
|
52
|
+
private static calculatePc2D;
|
|
53
|
+
/**
|
|
54
|
+
* Chan's analytical approximation for 2D Pc.
|
|
55
|
+
*
|
|
56
|
+
* Reference: Chan, F. K. (2008). "Spacecraft Collision Probability"
|
|
57
|
+
*
|
|
58
|
+
* @param mahalanobisDistance Mahalanobis distance (sqrt of d2)
|
|
59
|
+
* @param radius Combined hard body radius
|
|
60
|
+
* @param sigma1 Larger semi-axis of covariance ellipse
|
|
61
|
+
* @param sigma2 Smaller semi-axis of covariance ellipse
|
|
62
|
+
* @returns Probability of collision (0 to 1)
|
|
63
|
+
*/
|
|
64
|
+
private static chanPc2D;
|
|
65
|
+
/**
|
|
66
|
+
* Approximates the complementary error function erfc(x).
|
|
67
|
+
*
|
|
68
|
+
* Uses Abramowitz and Stegun approximation (formula 7.1.26).
|
|
69
|
+
*
|
|
70
|
+
* @param x Input value
|
|
71
|
+
* @returns erfc(x)
|
|
72
|
+
*/
|
|
73
|
+
private static approximateErfc;
|
|
74
|
+
/**
|
|
75
|
+
* Fallback 3D probability calculation for cases with very low relative velocity.
|
|
76
|
+
*
|
|
77
|
+
* Uses simple spherical approximation.
|
|
78
|
+
*
|
|
79
|
+
* @param relativePosition Relative position vector
|
|
80
|
+
* @param posCovariance 3x3 position covariance matrix
|
|
81
|
+
* @param combinedRadius Combined hard body radius
|
|
82
|
+
* @returns Probability of collision (0 to 1)
|
|
83
|
+
*/
|
|
84
|
+
private static calculate3D;
|
|
85
|
+
/**
|
|
86
|
+
* Combines two covariance matrices (primary and secondary).
|
|
87
|
+
*
|
|
88
|
+
* The combined covariance is simply the sum of the two covariances,
|
|
89
|
+
* assuming they are independent.
|
|
90
|
+
*
|
|
91
|
+
* @param primaryCov Primary object covariance
|
|
92
|
+
* @param secondaryCov Secondary object covariance
|
|
93
|
+
* @returns Combined covariance
|
|
94
|
+
*/
|
|
95
|
+
static combineCovarianceMatrices(primaryCov: StateCovariance, secondaryCov: StateCovariance): StateCovariance;
|
|
96
|
+
/**
|
|
97
|
+
* Extracts the 3x3 position covariance from a 6x6 state covariance matrix.
|
|
98
|
+
* @param stateCov 6x6 state covariance matrix
|
|
99
|
+
* @returns 3x3 position covariance matrix
|
|
100
|
+
*/
|
|
101
|
+
private static extractPositionCovariance;
|
|
102
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
|
+
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
|
+
*
|
|
6
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
7
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
8
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
11
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
* See the GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
import { Matrix } from '../operations/Matrix.js';
|
|
18
|
+
import { Vector3D } from '../operations/Vector3D.js';
|
|
19
|
+
/**
|
|
20
|
+
* Probability of Collision calculator using Chan's 2D method.
|
|
21
|
+
*
|
|
22
|
+
* This implementation projects the combined covariance matrix onto the
|
|
23
|
+
* encounter plane (B-plane) perpendicular to the relative velocity vector,
|
|
24
|
+
* then computes the probability that the relative position lies within
|
|
25
|
+
* the combined hard body radius.
|
|
26
|
+
*
|
|
27
|
+
* Reference: Chan, F. K. (2008). "Spacecraft Collision Probability"
|
|
28
|
+
*/
|
|
29
|
+
export class ProbabilityOfCollision {
|
|
30
|
+
/**
|
|
31
|
+
* Computes probability of collision using Chan's 2D method.
|
|
32
|
+
*
|
|
33
|
+
* @param relativePosition Relative position vector in RIC frame (km)
|
|
34
|
+
* @param relativeVelocity Relative velocity vector in RIC frame (km/s)
|
|
35
|
+
* @param combinedCovariance Combined position covariance in RIC frame (6x6)
|
|
36
|
+
* @param combinedRadius Combined hard body radius (km)
|
|
37
|
+
* @returns Probability of collision (0 to 1)
|
|
38
|
+
*/
|
|
39
|
+
static calculate(relativePosition, relativeVelocity, combinedCovariance, combinedRadius) {
|
|
40
|
+
// Extract position covariance (first 3x3 block)
|
|
41
|
+
const posCovariance = this.extractPositionCovariance(combinedCovariance.matrix);
|
|
42
|
+
// Create encounter plane coordinate system
|
|
43
|
+
// z-axis: along relative velocity (perpendicular to encounter plane)
|
|
44
|
+
// x-axis and y-axis: in the encounter plane
|
|
45
|
+
const vMag = relativeVelocity.magnitude();
|
|
46
|
+
if (vMag < 1e-9) {
|
|
47
|
+
// Nearly zero relative velocity - use 3D method or return conservative estimate
|
|
48
|
+
return this.calculate3D(relativePosition, posCovariance, combinedRadius);
|
|
49
|
+
}
|
|
50
|
+
const zAxis = relativeVelocity.scale(1.0 / vMag);
|
|
51
|
+
// Choose x-axis perpendicular to z-axis
|
|
52
|
+
let xAxis;
|
|
53
|
+
if (Math.abs(zAxis.z) < 0.9) {
|
|
54
|
+
// z-axis is not close to [0,0,1], use cross product with [0,0,1]
|
|
55
|
+
xAxis = new Vector3D(0, 0, 1).cross(zAxis).normalize();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
// z-axis is close to [0,0,1], use cross product with [1,0,0]
|
|
59
|
+
xAxis = new Vector3D(1, 0, 0).cross(zAxis).normalize();
|
|
60
|
+
}
|
|
61
|
+
const yAxis = zAxis.cross(xAxis).normalize();
|
|
62
|
+
// Rotation matrix from RIC to encounter plane frame
|
|
63
|
+
const rotMatrix = new Matrix([
|
|
64
|
+
[xAxis.x, xAxis.y, xAxis.z],
|
|
65
|
+
[yAxis.x, yAxis.y, yAxis.z],
|
|
66
|
+
[zAxis.x, zAxis.y, zAxis.z],
|
|
67
|
+
]);
|
|
68
|
+
// Transform position to encounter plane frame
|
|
69
|
+
const posEncounter = rotMatrix.multiplyVector3D(relativePosition);
|
|
70
|
+
// Project position onto encounter plane (drop z-component)
|
|
71
|
+
const x = posEncounter.x;
|
|
72
|
+
const y = posEncounter.y;
|
|
73
|
+
// Transform covariance to encounter plane frame: C_enc = R * C * R^T
|
|
74
|
+
const covEncounter = rotMatrix.multiply(posCovariance).multiply(rotMatrix.transpose());
|
|
75
|
+
// Extract 2D covariance in encounter plane (top-left 2x2 block)
|
|
76
|
+
const cov2D = new Matrix([
|
|
77
|
+
[covEncounter.elements[0][0], covEncounter.elements[0][1]],
|
|
78
|
+
[covEncounter.elements[1][0], covEncounter.elements[1][1]],
|
|
79
|
+
]);
|
|
80
|
+
// Compute Pc using 2D method
|
|
81
|
+
return this.calculatePc2D(x, y, cov2D, combinedRadius);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Calculates 2D probability of collision in the encounter plane.
|
|
85
|
+
*
|
|
86
|
+
* Uses the analytical solution for 2D Gaussian probability within a circle.
|
|
87
|
+
*
|
|
88
|
+
* @param x X-coordinate in encounter plane (km)
|
|
89
|
+
* @param y Y-coordinate in encounter plane (km)
|
|
90
|
+
* @param cov2D 2x2 covariance matrix in encounter plane
|
|
91
|
+
* @param radius Combined hard body radius (km)
|
|
92
|
+
* @returns Probability of collision (0 to 1)
|
|
93
|
+
*/
|
|
94
|
+
static calculatePc2D(x, y, cov2D, radius) {
|
|
95
|
+
// Compute determinant and trace
|
|
96
|
+
const c11 = cov2D.elements[0][0];
|
|
97
|
+
const c12 = cov2D.elements[0][1];
|
|
98
|
+
const c22 = cov2D.elements[1][1];
|
|
99
|
+
const det = c11 * c22 - c12 * c12;
|
|
100
|
+
if (det <= 0) {
|
|
101
|
+
// Singular or invalid covariance
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
// Compute Mahalanobis distance squared: d^2 = r^T * C^-1 * r
|
|
105
|
+
const covInv11 = c22 / det;
|
|
106
|
+
const covInv12 = -c12 / det;
|
|
107
|
+
const covInv22 = c11 / det;
|
|
108
|
+
const d2 = x * (covInv11 * x + covInv12 * y) + y * (covInv12 * x + covInv22 * y);
|
|
109
|
+
// Compute eigenvalues for ellipse semi-axes
|
|
110
|
+
const trace = c11 + c22;
|
|
111
|
+
const discriminant = Math.sqrt((c11 - c22) ** 2 + 4 * c12 * c12);
|
|
112
|
+
const lambda1 = (trace + discriminant) / 2;
|
|
113
|
+
const lambda2 = (trace - discriminant) / 2;
|
|
114
|
+
const sigma1 = Math.sqrt(Math.max(lambda1, 0));
|
|
115
|
+
const sigma2 = Math.sqrt(Math.max(lambda2, 0));
|
|
116
|
+
// Use Chan's analytical approximation
|
|
117
|
+
return this.chanPc2D(Math.sqrt(d2), radius, sigma1, sigma2);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Chan's analytical approximation for 2D Pc.
|
|
121
|
+
*
|
|
122
|
+
* Reference: Chan, F. K. (2008). "Spacecraft Collision Probability"
|
|
123
|
+
*
|
|
124
|
+
* @param mahalanobisDistance Mahalanobis distance (sqrt of d2)
|
|
125
|
+
* @param radius Combined hard body radius
|
|
126
|
+
* @param sigma1 Larger semi-axis of covariance ellipse
|
|
127
|
+
* @param sigma2 Smaller semi-axis of covariance ellipse
|
|
128
|
+
* @returns Probability of collision (0 to 1)
|
|
129
|
+
*/
|
|
130
|
+
static chanPc2D(mahalanobisDistance, radius, sigma1, sigma2) {
|
|
131
|
+
// Effective radius in Mahalanobis space
|
|
132
|
+
const sigmaMean = Math.sqrt(sigma1 * sigma2);
|
|
133
|
+
if (sigmaMean < 1e-12) {
|
|
134
|
+
return 0;
|
|
135
|
+
}
|
|
136
|
+
const eta = radius / sigmaMean;
|
|
137
|
+
// If miss distance is much larger than combined size, Pc is negligible
|
|
138
|
+
if (mahalanobisDistance > eta + 10) {
|
|
139
|
+
return 0;
|
|
140
|
+
}
|
|
141
|
+
// If objects are overlapping at nominal position
|
|
142
|
+
if (mahalanobisDistance * sigmaMean < radius) {
|
|
143
|
+
// Use complementary error function approximation
|
|
144
|
+
const zeta = mahalanobisDistance;
|
|
145
|
+
return Math.exp(-0.5 * zeta * zeta) * (1 - this.approximateErfc(eta / Math.sqrt(2))) / 2;
|
|
146
|
+
}
|
|
147
|
+
// General case: use Chan's approximation
|
|
148
|
+
const u = mahalanobisDistance;
|
|
149
|
+
const gamma = sigma1 / sigma2;
|
|
150
|
+
// Foster's approximation (simplified Chan method)
|
|
151
|
+
const pc = (eta * eta) / (2 * (u * u + eta * eta)) * Math.exp(-0.5 * u * u);
|
|
152
|
+
return Math.min(Math.max(pc, 0), 1); // Clamp to [0, 1]
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Approximates the complementary error function erfc(x).
|
|
156
|
+
*
|
|
157
|
+
* Uses Abramowitz and Stegun approximation (formula 7.1.26).
|
|
158
|
+
*
|
|
159
|
+
* @param x Input value
|
|
160
|
+
* @returns erfc(x)
|
|
161
|
+
*/
|
|
162
|
+
static approximateErfc(x) {
|
|
163
|
+
if (x < 0) {
|
|
164
|
+
return 2 - this.approximateErfc(-x);
|
|
165
|
+
}
|
|
166
|
+
// Constants for Abramowitz and Stegun approximation
|
|
167
|
+
const p = 0.3275911;
|
|
168
|
+
const a1 = 0.254829592;
|
|
169
|
+
const a2 = -0.284496736;
|
|
170
|
+
const a3 = 1.421413741;
|
|
171
|
+
const a4 = -1.453152027;
|
|
172
|
+
const a5 = 1.061405429;
|
|
173
|
+
const t = 1.0 / (1.0 + p * x);
|
|
174
|
+
const t2 = t * t;
|
|
175
|
+
const t3 = t2 * t;
|
|
176
|
+
const t4 = t3 * t;
|
|
177
|
+
const t5 = t4 * t;
|
|
178
|
+
return (a1 * t + a2 * t2 + a3 * t3 + a4 * t4 + a5 * t5) * Math.exp(-x * x);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Fallback 3D probability calculation for cases with very low relative velocity.
|
|
182
|
+
*
|
|
183
|
+
* Uses simple spherical approximation.
|
|
184
|
+
*
|
|
185
|
+
* @param relativePosition Relative position vector
|
|
186
|
+
* @param posCovariance 3x3 position covariance matrix
|
|
187
|
+
* @param combinedRadius Combined hard body radius
|
|
188
|
+
* @returns Probability of collision (0 to 1)
|
|
189
|
+
*/
|
|
190
|
+
static calculate3D(relativePosition, posCovariance, combinedRadius) {
|
|
191
|
+
const r = relativePosition.magnitude();
|
|
192
|
+
// Compute average variance (trace / 3)
|
|
193
|
+
const avgVariance = (posCovariance.elements[0][0] + posCovariance.elements[1][1] + posCovariance.elements[2][2]) / 3;
|
|
194
|
+
const sigma = Math.sqrt(avgVariance);
|
|
195
|
+
if (sigma < 1e-12) {
|
|
196
|
+
return r < combinedRadius ? 1.0 : 0.0;
|
|
197
|
+
}
|
|
198
|
+
// Use Gaussian CDF approximation
|
|
199
|
+
const z = (r - combinedRadius) / sigma;
|
|
200
|
+
if (z < -3) {
|
|
201
|
+
return 1.0;
|
|
202
|
+
}
|
|
203
|
+
if (z > 3) {
|
|
204
|
+
return 0.0;
|
|
205
|
+
}
|
|
206
|
+
// Approximate using complementary error function
|
|
207
|
+
return 0.5 * this.approximateErfc(z / Math.sqrt(2));
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Combines two covariance matrices (primary and secondary).
|
|
211
|
+
*
|
|
212
|
+
* The combined covariance is simply the sum of the two covariances,
|
|
213
|
+
* assuming they are independent.
|
|
214
|
+
*
|
|
215
|
+
* @param primaryCov Primary object covariance
|
|
216
|
+
* @param secondaryCov Secondary object covariance
|
|
217
|
+
* @returns Combined covariance
|
|
218
|
+
*/
|
|
219
|
+
static combineCovarianceMatrices(primaryCov, secondaryCov) {
|
|
220
|
+
const combinedMatrix = primaryCov.matrix.add(secondaryCov.matrix);
|
|
221
|
+
return {
|
|
222
|
+
matrix: combinedMatrix,
|
|
223
|
+
frame: primaryCov.frame,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Extracts the 3x3 position covariance from a 6x6 state covariance matrix.
|
|
228
|
+
* @param stateCov 6x6 state covariance matrix
|
|
229
|
+
* @returns 3x3 position covariance matrix
|
|
230
|
+
*/
|
|
231
|
+
static extractPositionCovariance(stateCov) {
|
|
232
|
+
const elements = [
|
|
233
|
+
[stateCov.elements[0][0], stateCov.elements[0][1], stateCov.elements[0][2]],
|
|
234
|
+
[stateCov.elements[1][0], stateCov.elements[1][1], stateCov.elements[1][2]],
|
|
235
|
+
[stateCov.elements[2][0], stateCov.elements[2][1], stateCov.elements[2][2]],
|
|
236
|
+
];
|
|
237
|
+
return new Matrix(elements);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=ProbabilityOfCollision.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProbabilityOfCollision.js","sourceRoot":"","sources":["../../src/conjunction/ProbabilityOfCollision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAIrD;;;;;;;;;GASG;AACH,MAAM,OAAO,sBAAsB;IACjC;;;;;;;;OAQG;IACH,MAAM,CAAC,SAAS,CACd,gBAAsC,EACtC,gBAA0B,EAC1B,kBAAmC,EACnC,cAA0B;QAE1B,gDAAgD;QAChD,MAAM,aAAa,GAAG,IAAI,CAAC,yBAAyB,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAEhF,2CAA2C;QAC3C,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AC,CAAC,CAAC,CAAC;YAC3E,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5E,CAAC;QAEF,OAAO,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
|
+
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
|
+
*
|
|
6
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
7
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
8
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
11
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
* See the GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
export { ConjunctionEvent } from './ConjunctionEvent.js';
|
|
18
|
+
export { ProbabilityOfCollision } from './ProbabilityOfCollision.js';
|
|
19
|
+
export { ConjunctionAssessment, type SpaceObject, type ConjunctionAssessmentOptions, } from './ConjunctionAssessment.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
|
+
* @license AGPL-3.0-or-later
|
|
4
|
+
* @copyright (c) 2025 Kruczek Labs LLC
|
|
5
|
+
*
|
|
6
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
7
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
8
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
11
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
* See the GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
15
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
export { ConjunctionEvent } from './ConjunctionEvent.js';
|
|
18
|
+
export { ProbabilityOfCollision } from './ProbabilityOfCollision.js';
|
|
19
|
+
export { ConjunctionAssessment, } from './ConjunctionAssessment.js';
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/conjunction/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACL,qBAAqB,GAGtB,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
|
|
4
4
|
* with satellites and other orbital objects.
|
|
5
5
|
* @license AGPL-3.0-or-later
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
* You should have received a copy of the GNU Affero General Public License along with
|
|
21
21
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
22
|
*/
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
23
|
+
import { OrbitRegime } from '../enums/OrbitRegime';
|
|
24
|
+
import { ClassicalElementsParams } from '../interfaces/ClassicalElementsParams';
|
|
25
|
+
import { Degrees, Kilometers, Minutes, PositionVelocity, Radians } from '../main';
|
|
26
|
+
import { EpochUTC } from '../time/EpochUTC';
|
|
27
|
+
import { EquinoctialElements } from './EquinoctialElements';
|
|
28
|
+
import { StateVector } from './StateVector';
|
|
29
29
|
/**
|
|
30
30
|
* The ClassicalElements class represents the classical orbital elements of an object.
|
|
31
31
|
* @example
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @author
|
|
2
|
+
* @author Theodore Kruczek
|
|
3
3
|
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
|
|
4
4
|
* with satellites and other orbital objects.
|
|
5
5
|
* @license AGPL-3.0-or-later
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
* You should have received a copy of the GNU Affero General Public License along with
|
|
21
21
|
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
22
|
*/
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
23
|
+
import { OrbitRegime } from '../enums/OrbitRegime';
|
|
24
|
+
import { Earth, } from '../main';
|
|
25
|
+
import { Vector3D } from '../operations/Vector3D';
|
|
26
|
+
import { earthGravityParam, MINUTES_PER_DAY, RAD2DEG, sec2min, TAU } from '../utils/constants';
|
|
27
|
+
import { clamp, matchHalfPlane, newtonNu } from '../utils/functions';
|
|
28
|
+
import { EquinoctialElements } from './EquinoctialElements';
|
|
29
29
|
/**
|
|
30
30
|
* The ClassicalElements class represents the classical orbital elements of an object.
|
|
31
31
|
* @example
|