ootk 4.0.9 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -15
- package/dist/body/Celestial.d.ts +96 -0
- package/dist/body/Celestial.js +124 -0
- package/dist/body/Celestial.js.map +1 -0
- package/dist/body/Earth.d.ts +68 -0
- package/dist/body/Earth.js +198 -0
- package/dist/body/Earth.js.map +1 -0
- package/dist/body/Moon.d.ts +137 -0
- package/dist/body/Moon.js +464 -0
- package/dist/body/Moon.js.map +1 -0
- package/dist/body/NutationAngles.d.ts +38 -0
- package/dist/body/NutationAngles.js +24 -0
- package/dist/body/NutationAngles.js.map +1 -0
- package/dist/body/PrecessionAngles.d.ts +29 -0
- package/dist/body/PrecessionAngles.js +24 -0
- package/dist/body/PrecessionAngles.js.map +1 -0
- package/dist/body/Sun.d.ts +305 -0
- package/dist/body/Sun.js +548 -0
- package/dist/body/Sun.js.map +1 -0
- package/dist/body/index.d.ts +26 -0
- package/dist/body/index.js +27 -0
- package/dist/body/index.js.map +1 -0
- package/dist/coordinate/ClassicalElements.d.ts +132 -0
- package/dist/coordinate/ClassicalElements.js +279 -0
- package/dist/coordinate/ClassicalElements.js.map +1 -0
- package/dist/coordinate/EquinoctialElements.d.ts +114 -0
- package/dist/coordinate/EquinoctialElements.js +172 -0
- package/dist/coordinate/EquinoctialElements.js.map +1 -0
- package/dist/coordinate/FormatTle.d.ts +95 -0
- package/dist/coordinate/FormatTle.js +184 -0
- package/dist/coordinate/FormatTle.js.map +1 -0
- package/dist/coordinate/Geodetic.d.ts +110 -0
- package/dist/coordinate/Geodetic.js +163 -0
- package/dist/coordinate/Geodetic.js.map +1 -0
- package/dist/coordinate/Hill.d.ts +1 -1
- package/dist/coordinate/Hill.js +1 -1
- package/dist/coordinate/Hill.js.map +1 -1
- package/dist/coordinate/ITRF.d.ts +75 -0
- package/dist/coordinate/ITRF.js +135 -0
- package/dist/coordinate/ITRF.js.map +1 -0
- package/dist/coordinate/J2000.d.ts +65 -0
- package/dist/coordinate/J2000.js +120 -0
- package/dist/coordinate/J2000.js.map +1 -0
- package/dist/coordinate/RIC.d.ts +64 -0
- package/dist/coordinate/RIC.js +79 -0
- package/dist/coordinate/RIC.js.map +1 -0
- package/dist/coordinate/RelativeState.d.ts +70 -0
- package/dist/coordinate/RelativeState.js +79 -0
- package/dist/coordinate/RelativeState.js.map +1 -0
- package/dist/coordinate/StateVector.d.ts +76 -0
- package/dist/coordinate/StateVector.js +97 -0
- package/dist/coordinate/StateVector.js.map +1 -0
- package/dist/coordinate/TEME.d.ts +57 -0
- package/dist/coordinate/TEME.js +89 -0
- package/dist/coordinate/TEME.js.map +1 -0
- package/dist/coordinate/Tle.d.ts +430 -0
- package/dist/coordinate/Tle.js +865 -0
- package/dist/coordinate/Tle.js.map +1 -0
- package/dist/coordinate/index.d.ts +11 -0
- package/dist/coordinate/index.js +12 -0
- package/dist/coordinate/index.js.map +1 -1
- package/dist/coordinate/tle-format-data.d.ts +41 -0
- package/dist/coordinate/tle-format-data.js +46 -0
- package/dist/coordinate/tle-format-data.js.map +1 -0
- package/dist/covariance/CovarianceSample.d.ts +1 -1
- package/dist/covariance/CovarianceSample.js +1 -1
- package/dist/covariance/CovarianceSample.js.map +1 -1
- package/dist/covariance/StateCovariance.d.ts +1 -1
- package/dist/covariance/StateCovariance.js +1 -1
- package/dist/covariance/StateCovariance.js.map +1 -1
- package/dist/data/DataHandler.d.ts +66 -0
- package/dist/data/DataHandler.js +80 -0
- package/dist/data/DataHandler.js.map +1 -0
- package/dist/data/values/Egm96Data.d.ts +37 -0
- package/dist/data/values/Egm96Data.js +63 -0
- package/dist/data/values/Egm96Data.js.map +1 -0
- package/dist/data/values/HpAtmosphereData.d.ts +33 -0
- package/dist/data/values/HpAtmosphereData.js +58 -0
- package/dist/data/values/HpAtmosphereData.js.map +1 -0
- package/dist/data/values/HpAtmosphereResult.d.ts +29 -0
- package/dist/data/values/HpAtmosphereResult.js +38 -0
- package/dist/data/values/HpAtmosphereResult.js.map +1 -0
- package/dist/data/values/Iau1980Data.d.ts +36 -0
- package/dist/data/values/Iau1980Data.js +52 -0
- package/dist/data/values/Iau1980Data.js.map +1 -0
- package/dist/data/values/LeapSecond.d.ts +27 -0
- package/dist/data/values/LeapSecond.js +35 -0
- package/dist/data/values/LeapSecond.js.map +1 -0
- package/dist/data/values/LeapSecondData.d.ts +41 -0
- package/dist/data/values/LeapSecondData.js +103 -0
- package/dist/data/values/LeapSecondData.js.map +1 -0
- package/dist/data/values/egm96.d.ts +24 -0
- package/dist/data/values/egm96.js +726 -0
- package/dist/data/values/egm96.js.map +1 -0
- package/dist/data/values/hpAtmosphere.d.ts +24 -0
- package/dist/data/values/hpAtmosphere.js +76 -0
- package/dist/data/values/hpAtmosphere.js.map +1 -0
- package/dist/data/values/iau1980.d.ts +24 -0
- package/dist/data/values/iau1980.js +30 -0
- package/dist/data/values/iau1980.js.map +1 -0
- package/dist/enums/AngularDiameterMethod.d.ts +27 -0
- package/dist/enums/AngularDiameterMethod.js +29 -0
- package/dist/enums/AngularDiameterMethod.js.map +1 -0
- package/dist/enums/AngularDistanceMethod.d.ts +27 -0
- package/dist/enums/AngularDistanceMethod.js +29 -0
- package/dist/enums/AngularDistanceMethod.js.map +1 -0
- package/dist/enums/OrbitRegime.d.ts +30 -0
- package/dist/enums/OrbitRegime.js +32 -0
- package/dist/enums/OrbitRegime.js.map +1 -0
- package/dist/enums/PassType.d.ts +28 -0
- package/dist/enums/PassType.js +30 -0
- package/dist/enums/PassType.js.map +1 -0
- package/dist/enums/Sgp4OpsMode.d.ts +26 -0
- package/dist/enums/Sgp4OpsMode.js +28 -0
- package/dist/enums/Sgp4OpsMode.js.map +1 -0
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/index.js +5 -0
- package/dist/enums/index.js.map +1 -1
- package/dist/force/AtmosphericDrag.d.ts +1 -1
- package/dist/force/AtmosphericDrag.js +1 -1
- package/dist/force/AtmosphericDrag.js.map +1 -1
- package/dist/force/EarthGravity.d.ts +1 -1
- package/dist/force/EarthGravity.js +1 -1
- package/dist/force/EarthGravity.js.map +1 -1
- package/dist/force/Force.d.ts +1 -1
- package/dist/force/ForceModel.d.ts +1 -1
- package/dist/force/ForceModel.js +1 -1
- package/dist/force/ForceModel.js.map +1 -1
- package/dist/force/Gravity.d.ts +1 -1
- package/dist/force/Gravity.js +1 -1
- package/dist/force/Gravity.js.map +1 -1
- package/dist/force/SolarRadiationPressure.d.ts +1 -1
- package/dist/force/SolarRadiationPressure.js +1 -1
- package/dist/force/SolarRadiationPressure.js.map +1 -1
- package/dist/force/ThirdBodyGravity.d.ts +1 -1
- package/dist/force/ThirdBodyGravity.js +1 -1
- package/dist/force/ThirdBodyGravity.js.map +1 -1
- package/dist/force/Thrust.d.ts +1 -1
- package/dist/force/Thrust.js +1 -1
- package/dist/force/Thrust.js.map +1 -1
- package/dist/interfaces/BaseObjectParams.d.ts +31 -0
- package/dist/interfaces/BaseObjectParams.js +24 -0
- package/dist/interfaces/BaseObjectParams.js.map +1 -0
- package/dist/interfaces/ClassicalElementsParams.d.ts +33 -0
- package/dist/interfaces/ClassicalElementsParams.js +24 -0
- package/dist/interfaces/ClassicalElementsParams.js.map +1 -0
- package/dist/interfaces/EquinoctialElementsParams.d.ts +35 -0
- package/dist/interfaces/EquinoctialElementsParams.js +24 -0
- package/dist/interfaces/EquinoctialElementsParams.js.map +1 -0
- package/dist/interfaces/GroundPositionParams.d.ts +28 -0
- package/dist/interfaces/GroundPositionParams.js +24 -0
- package/dist/interfaces/GroundPositionParams.js.map +1 -0
- package/dist/interfaces/OmmFormat.d.ts +62 -0
- package/dist/interfaces/OmmFormat.js +2 -0
- package/dist/interfaces/OmmFormat.js.map +1 -0
- package/dist/interfaces/OptionsParams.d.ts +3 -0
- package/dist/interfaces/OptionsParams.js +2 -0
- package/dist/interfaces/OptionsParams.js.map +1 -0
- package/dist/interfaces/RfSensorParams.d.ts +1 -1
- package/dist/interfaces/SatelliteParams.d.ts +18 -0
- package/dist/interfaces/SatelliteParams.js +2 -0
- package/dist/interfaces/SatelliteParams.js.map +1 -0
- package/dist/interfaces/SensorParams.d.ts +38 -0
- package/dist/interfaces/SensorParams.js +2 -0
- package/dist/interfaces/SensorParams.js.map +1 -0
- package/dist/interfaces/StarObjectParams.d.ts +10 -0
- package/dist/interfaces/StarObjectParams.js +2 -0
- package/dist/interfaces/StarObjectParams.js.map +1 -0
- package/dist/interfaces/TimeVariables.d.ts +6 -0
- package/dist/interfaces/TimeVariables.js +2 -0
- package/dist/interfaces/TimeVariables.js.map +1 -0
- package/dist/interfaces/index.d.ts +8 -0
- package/dist/interpolator/ChebyshevCoefficients.d.ts +1 -1
- package/dist/interpolator/ChebyshevCoefficients.js +1 -1
- package/dist/interpolator/ChebyshevCoefficients.js.map +1 -1
- package/dist/interpolator/ChebyshevInterpolator.d.ts +1 -1
- package/dist/interpolator/ChebyshevInterpolator.js +1 -1
- package/dist/interpolator/ChebyshevInterpolator.js.map +1 -1
- package/dist/interpolator/CubicSpline.d.ts +1 -1
- package/dist/interpolator/CubicSplineInterpolator.d.ts +1 -1
- package/dist/interpolator/CubicSplineInterpolator.js +1 -1
- package/dist/interpolator/CubicSplineInterpolator.js.map +1 -1
- package/dist/interpolator/Interpolator.d.ts +1 -1
- package/dist/interpolator/Interpolator.js +1 -1
- package/dist/interpolator/Interpolator.js.map +1 -1
- package/dist/interpolator/LagrangeInterpolator.d.ts +1 -1
- package/dist/interpolator/LagrangeInterpolator.js +1 -1
- package/dist/interpolator/LagrangeInterpolator.js.map +1 -1
- package/dist/interpolator/StateInterpolator.d.ts +1 -1
- package/dist/interpolator/VerletBlendInterpolator.d.ts +1 -1
- package/dist/interpolator/VerletBlendInterpolator.js +1 -1
- package/dist/interpolator/VerletBlendInterpolator.js.map +1 -1
- package/dist/main.d.ts +11 -3
- package/dist/main.js +11 -3
- package/dist/main.js.map +1 -1
- package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +1 -1
- package/dist/maneuver/TwoBurnOrbitTransfer.js +1 -1
- package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -1
- package/dist/maneuver/Waypoint.d.ts +1 -1
- package/dist/maneuver/Waypoint.js +1 -1
- package/dist/maneuver/Waypoint.js.map +1 -1
- package/dist/objects/BaseObject.d.ts +74 -0
- package/dist/objects/BaseObject.js +151 -0
- package/dist/objects/BaseObject.js.map +1 -0
- package/dist/objects/DetailedSatellite.d.ts +2 -1
- package/dist/objects/DetailedSatellite.js +2 -2
- package/dist/objects/DetailedSatellite.js.map +1 -1
- package/dist/objects/DetailedSensor.d.ts +2 -1
- package/dist/objects/DetailedSensor.js +1 -1
- package/dist/objects/DetailedSensor.js.map +1 -1
- package/dist/objects/GroundObject.d.ts +85 -0
- package/dist/objects/GroundObject.js +143 -0
- package/dist/objects/GroundObject.js.map +1 -0
- package/dist/objects/LandObject.d.ts +2 -1
- package/dist/objects/LandObject.js +1 -1
- package/dist/objects/LandObject.js.map +1 -1
- package/dist/objects/Marker.d.ts +1 -1
- package/dist/objects/Marker.js +1 -1
- package/dist/objects/Marker.js.map +1 -1
- package/dist/objects/RfSensor.d.ts +1 -2
- package/dist/objects/RfSensor.js +1 -2
- package/dist/objects/RfSensor.js.map +1 -1
- package/dist/objects/Satellite.d.ts +226 -0
- package/dist/objects/Satellite.js +443 -0
- package/dist/objects/Satellite.js.map +1 -0
- package/dist/objects/Sensor.d.ts +100 -0
- package/dist/objects/Sensor.js +239 -0
- package/dist/objects/Sensor.js.map +1 -0
- package/dist/objects/Star.d.ts +36 -0
- package/dist/objects/Star.js +59 -0
- package/dist/objects/Star.js.map +1 -0
- package/dist/objects/index.d.ts +5 -0
- package/dist/objects/index.js +5 -0
- package/dist/objects/index.js.map +1 -1
- package/dist/observation/Observation.d.ts +1 -1
- package/dist/observation/ObservationOptical.d.ts +1 -1
- package/dist/observation/ObservationOptical.js +1 -1
- package/dist/observation/ObservationOptical.js.map +1 -1
- package/dist/observation/ObservationRadar.d.ts +1 -1
- package/dist/observation/ObservationRadar.js +1 -1
- package/dist/observation/ObservationRadar.js.map +1 -1
- package/dist/observation/ObservationUtils.d.ts +3 -1
- package/dist/observation/ObservationUtils.js +15 -1
- package/dist/observation/ObservationUtils.js.map +1 -1
- package/dist/observation/RAE.d.ts +111 -0
- package/dist/observation/RAE.js +215 -0
- package/dist/observation/RAE.js.map +1 -0
- package/dist/observation/RadecGeocentric.d.ts +111 -0
- package/dist/observation/RadecGeocentric.js +169 -0
- package/dist/observation/RadecGeocentric.js.map +1 -0
- package/dist/observation/RadecTopocentric.d.ts +123 -0
- package/dist/observation/RadecTopocentric.js +196 -0
- package/dist/observation/RadecTopocentric.js.map +1 -0
- package/dist/observation/index.d.ts +26 -0
- package/dist/observation/index.js +27 -0
- package/dist/observation/index.js.map +1 -0
- package/dist/operations/BoxMuller.d.ts +1 -1
- package/dist/operations/BoxMuller.js +1 -1
- package/dist/operations/BoxMuller.js.map +1 -1
- package/dist/operations/EulerAngles.d.ts +1 -1
- package/dist/operations/EulerAngles.js +1 -1
- package/dist/operations/EulerAngles.js.map +1 -1
- package/dist/operations/Matrix.d.ts +170 -0
- package/dist/operations/Matrix.js +405 -0
- package/dist/operations/Matrix.js.map +1 -0
- package/dist/operations/Quaternion.d.ts +1 -1
- package/dist/operations/Quaternion.js +1 -1
- package/dist/operations/Quaternion.js.map +1 -1
- package/dist/operations/Random.d.ts +40 -0
- package/dist/operations/Random.js +50 -0
- package/dist/operations/Random.js.map +1 -0
- package/dist/operations/RandomGaussianSource.d.ts +1 -1
- package/dist/operations/RandomGaussianSource.js +1 -1
- package/dist/operations/RandomGaussianSource.js.map +1 -1
- package/dist/operations/Vector.d.ts +262 -0
- package/dist/operations/Vector.js +415 -0
- package/dist/operations/Vector.js.map +1 -0
- package/dist/operations/Vector3D.d.ts +86 -0
- package/dist/operations/Vector3D.js +241 -0
- package/dist/operations/Vector3D.js.map +1 -0
- package/dist/operations/operations.d.ts +26 -0
- package/dist/operations/operations.js +27 -0
- package/dist/operations/operations.js.map +1 -0
- package/dist/optimize/ChebyshevCompressor.js +1 -1
- package/dist/optimize/ChebyshevCompressor.js.map +1 -1
- package/dist/optimize/PolynomialRegression.js +1 -1
- package/dist/optimize/PolynomialRegression.js.map +1 -1
- package/dist/optimize/SimplexEntry.js +1 -1
- package/dist/optimize/SimplexEntry.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +1 -1
- package/dist/orbit_determination/BatchLeastSquaresOD.js +1 -1
- package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +1 -1
- package/dist/orbit_determination/GibbsIOD.d.ts +1 -1
- package/dist/orbit_determination/GibbsIOD.js +1 -1
- package/dist/orbit_determination/GibbsIOD.js.map +1 -1
- package/dist/orbit_determination/GoodingIOD.d.ts +1 -1
- package/dist/orbit_determination/GoodingIOD.js +1 -1
- package/dist/orbit_determination/GoodingIOD.js.map +1 -1
- package/dist/orbit_determination/HerrickGibbsIOD.d.ts +1 -1
- package/dist/orbit_determination/HerrickGibbsIOD.js +1 -1
- package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -1
- package/dist/orbit_determination/LambertIOD.d.ts +1 -1
- package/dist/orbit_determination/LambertIOD.js +1 -1
- package/dist/orbit_determination/LambertIOD.js.map +1 -1
- package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +1 -1
- package/dist/orbit_determination/ModifiedGoodingIOD.js +1 -1
- package/dist/orbit_determination/ModifiedGoodingIOD.js.map +1 -1
- package/dist/orbit_determination/index.d.ts +7 -0
- package/dist/orbit_determination/index.js +8 -0
- package/dist/orbit_determination/index.js.map +1 -0
- package/dist/propagator/KeplerPropagator.d.ts +1 -1
- package/dist/propagator/KeplerPropagator.js +1 -1
- package/dist/propagator/KeplerPropagator.js.map +1 -1
- package/dist/propagator/Propagator.d.ts +1 -1
- package/dist/propagator/Propagator.js +1 -1
- package/dist/propagator/Propagator.js.map +1 -1
- package/dist/propagator/RkCheckpoint.d.ts +1 -1
- package/dist/propagator/RkResult.d.ts +1 -1
- package/dist/propagator/RungeKutta4Propagator.d.ts +1 -1
- package/dist/propagator/RungeKutta4Propagator.js +1 -1
- package/dist/propagator/RungeKutta4Propagator.js.map +1 -1
- package/dist/propagator/RungeKuttaAdaptive.d.ts +1 -1
- package/dist/propagator/RungeKuttaAdaptive.js +1 -1
- package/dist/propagator/RungeKuttaAdaptive.js.map +1 -1
- package/dist/propagator/Sgp4Propagator.d.ts +1 -1
- package/dist/sgp4/index.d.ts +23 -0
- package/dist/sgp4/index.js +24 -0
- package/dist/sgp4/index.js.map +1 -0
- package/dist/sgp4/sgp4-error.d.ts +22 -0
- package/dist/sgp4/sgp4-error.js +44 -0
- package/dist/sgp4/sgp4-error.js.map +1 -0
- package/dist/sgp4/sgp4.d.ts +102 -0
- package/dist/sgp4/sgp4.js +3167 -0
- package/dist/sgp4/sgp4.js.map +1 -0
- package/dist/smoothing/ExponentialSmoothing.d.ts +1 -1
- package/dist/time/Epoch.d.ts +44 -0
- package/dist/time/Epoch.js +109 -0
- package/dist/time/Epoch.js.map +1 -0
- package/dist/time/EpochGPS.d.ts +42 -0
- package/dist/time/EpochGPS.js +70 -0
- package/dist/time/EpochGPS.js.map +1 -0
- package/dist/time/EpochTAI.d.ts +26 -0
- package/dist/time/EpochTAI.js +27 -0
- package/dist/time/EpochTAI.js.map +1 -0
- package/dist/time/EpochTDB.d.ts +26 -0
- package/dist/time/EpochTDB.js +27 -0
- package/dist/time/EpochTDB.js.map +1 -0
- package/dist/time/EpochTT.d.ts +26 -0
- package/dist/time/EpochTT.js +27 -0
- package/dist/time/EpochTT.js.map +1 -0
- package/dist/time/EpochUTC.d.ts +59 -0
- package/dist/time/EpochUTC.js +137 -0
- package/dist/time/EpochUTC.js.map +1 -0
- package/dist/time/EpochWindow.d.ts +28 -0
- package/dist/time/EpochWindow.js +31 -0
- package/dist/time/EpochWindow.js.map +1 -0
- package/dist/time/TimeStamped.d.ts +43 -0
- package/dist/time/TimeStamped.js +46 -0
- package/dist/time/TimeStamped.js.map +1 -0
- package/dist/time/index.d.ts +30 -0
- package/dist/time/index.js +31 -0
- package/dist/time/index.js.map +1 -0
- package/dist/transforms/TransformCache.d.ts +27 -0
- package/dist/transforms/TransformCache.js +41 -0
- package/dist/transforms/TransformCache.js.map +1 -0
- package/dist/transforms/conversions.d.ts +63 -0
- package/dist/transforms/conversions.js +88 -0
- package/dist/transforms/conversions.js.map +1 -0
- package/dist/transforms/index.d.ts +1 -0
- package/dist/transforms/index.js +1 -0
- package/dist/transforms/index.js.map +1 -1
- package/dist/transforms/transforms.d.ts +166 -2
- package/dist/transforms/transforms.js +372 -1
- package/dist/transforms/transforms.js.map +1 -1
- package/dist/types/types.d.ts +674 -2
- package/dist/types/types.js +36 -0
- package/dist/types/types.js.map +1 -1
- package/dist/utils/constants.d.ts +80 -0
- package/dist/utils/constants.js +87 -0
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/functions.d.ts +228 -0
- package/dist/utils/functions.js +476 -0
- package/dist/utils/functions.js.map +1 -1
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/jacobian.d.ts +1 -1
- package/dist/utils/jacobian.js +1 -1
- package/dist/utils/jacobian.js.map +1 -1
- package/dist/utils/linearDistance.d.ts +8 -0
- package/dist/utils/linearDistance.js +10 -0
- package/dist/utils/linearDistance.js.map +1 -0
- package/package.json +4 -7
- package/src/body/Celestial.ts +134 -0
- package/src/body/Earth.ts +260 -0
- package/src/body/Moon.ts +556 -0
- package/src/body/NutationAngles.ts +40 -0
- package/src/body/PrecessionAngles.ts +31 -0
- package/src/body/Sun.ts +669 -0
- package/src/body/index.ts +27 -0
- package/src/body/suncalc.LICENSE.md +18 -0
- package/src/coordinate/ClassicalElements.ts +326 -0
- package/src/coordinate/EquinoctialElements.ts +189 -0
- package/src/coordinate/FormatTle.ts +214 -0
- package/src/coordinate/Geodetic.ts +186 -0
- package/src/coordinate/Hill.ts +1 -1
- package/src/coordinate/ITRF.ts +146 -0
- package/src/coordinate/J2000.ts +130 -0
- package/src/coordinate/RIC.ts +87 -0
- package/src/coordinate/RelativeState.ts +101 -0
- package/src/coordinate/StateVector.ts +122 -0
- package/src/coordinate/TEME.ts +97 -0
- package/src/coordinate/Tle.ts +1024 -0
- package/src/coordinate/index.ts +12 -0
- package/src/coordinate/tle-format-data.ts +47 -0
- package/src/covariance/CovarianceSample.ts +1 -1
- package/src/covariance/StateCovariance.ts +1 -1
- package/src/data/DataHandler.ts +88 -0
- package/src/data/values/Egm96Data.ts +75 -0
- package/src/data/values/HpAtmosphereData.ts +76 -0
- package/src/data/values/HpAtmosphereResult.ts +41 -0
- package/src/data/values/Iau1980Data.ts +63 -0
- package/src/data/values/LeapSecond.ts +37 -0
- package/src/data/values/LeapSecondData.ts +113 -0
- package/src/data/values/egm96.ts +728 -0
- package/src/data/values/hpAtmosphere.ts +79 -0
- package/src/data/values/iau1980.ts +32 -0
- package/src/enums/AngularDiameterMethod.ts +28 -0
- package/src/enums/AngularDistanceMethod.ts +28 -0
- package/src/enums/OrbitRegime.ts +31 -0
- package/src/enums/PassType.ts +29 -0
- package/src/enums/Sgp4OpsMode.ts +27 -0
- package/src/enums/index.ts +5 -0
- package/src/force/AtmosphericDrag.ts +1 -1
- package/src/force/EarthGravity.ts +1 -1
- package/src/force/Force.ts +1 -1
- package/src/force/ForceModel.ts +1 -1
- package/src/force/Gravity.ts +1 -1
- package/src/force/SolarRadiationPressure.ts +1 -1
- package/src/force/ThirdBodyGravity.ts +1 -1
- package/src/force/Thrust.ts +1 -1
- package/src/interfaces/BaseObjectParams.ts +33 -0
- package/src/interfaces/ClassicalElementsParams.ts +35 -0
- package/src/interfaces/EquinoctialElementsParams.ts +37 -0
- package/src/interfaces/GroundPositionParams.ts +30 -0
- package/src/interfaces/OmmFormat.ts +63 -0
- package/src/interfaces/OptionsParams.ts +3 -0
- package/src/interfaces/RfSensorParams.ts +1 -1
- package/src/interfaces/SatelliteParams.ts +20 -0
- package/src/interfaces/SensorParams.ts +39 -0
- package/src/interfaces/StarObjectParams.ts +11 -0
- package/src/interfaces/TimeVariables.ts +7 -0
- package/src/interfaces/index.ts +8 -0
- package/src/interpolator/ChebyshevCoefficients.ts +1 -1
- package/src/interpolator/ChebyshevInterpolator.ts +1 -1
- package/src/interpolator/CubicSpline.ts +1 -1
- package/src/interpolator/CubicSplineInterpolator.ts +1 -1
- package/src/interpolator/Interpolator.ts +1 -1
- package/src/interpolator/LagrangeInterpolator.ts +1 -1
- package/src/interpolator/StateInterpolator.ts +1 -1
- package/src/interpolator/VerletBlendInterpolator.ts +1 -1
- package/src/main.ts +11 -3
- package/src/maneuver/TwoBurnOrbitTransfer.ts +1 -1
- package/src/maneuver/Waypoint.ts +1 -1
- package/src/objects/BaseObject.ts +171 -0
- package/src/objects/DetailedSatellite.ts +3 -3
- package/src/objects/DetailedSensor.ts +2 -1
- package/src/objects/GroundObject.ts +176 -0
- package/src/objects/LandObject.ts +2 -1
- package/src/objects/Marker.ts +1 -1
- package/src/objects/RfSensor.ts +1 -2
- package/src/objects/Satellite.ts +552 -0
- package/src/objects/Sensor.ts +280 -0
- package/src/objects/Star.ts +96 -0
- package/src/objects/index.ts +5 -0
- package/src/observation/Observation.ts +1 -1
- package/src/observation/ObservationOptical.ts +1 -1
- package/src/observation/ObservationRadar.ts +1 -1
- package/src/observation/ObservationUtils.ts +30 -1
- package/src/observation/RAE.ts +262 -0
- package/src/observation/RadecGeocentric.ts +206 -0
- package/src/observation/RadecTopocentric.ts +241 -0
- package/src/observation/index.ts +27 -0
- package/src/operations/BoxMuller.ts +1 -1
- package/src/operations/EulerAngles.ts +1 -1
- package/src/operations/Matrix.ts +473 -0
- package/src/operations/Quaternion.ts +1 -1
- package/src/operations/Random.ts +54 -0
- package/src/operations/RandomGaussianSource.ts +1 -1
- package/src/operations/Vector.ts +484 -0
- package/src/operations/Vector3D.ts +289 -0
- package/src/operations/operations.ts +27 -0
- package/src/optimize/ChebyshevCompressor.ts +1 -1
- package/src/optimize/PolynomialRegression.ts +1 -1
- package/src/optimize/SimplexEntry.ts +1 -1
- package/src/orbit_determination/BatchLeastSquaresOD.ts +1 -1
- package/src/orbit_determination/BatchLeastSquaresResult.ts +1 -1
- package/src/orbit_determination/GibbsIOD.ts +3 -1
- package/src/orbit_determination/GoodingIOD.ts +1 -1
- package/src/orbit_determination/HerrickGibbsIOD.ts +1 -1
- package/src/orbit_determination/LambertIOD.ts +1 -1
- package/src/orbit_determination/ModifiedGoodingIOD.ts +1 -1
- package/src/orbit_determination/index.ts +7 -0
- package/src/propagator/KeplerPropagator.ts +1 -1
- package/src/propagator/Propagator.ts +1 -1
- package/src/propagator/RkCheckpoint.ts +1 -1
- package/src/propagator/RkResult.ts +1 -1
- package/src/propagator/RungeKutta4Propagator.ts +1 -1
- package/src/propagator/RungeKuttaAdaptive.ts +1 -1
- package/src/propagator/Sgp4Propagator.ts +1 -1
- package/src/sgp4/index.ts +24 -0
- package/src/sgp4/sgp4-error.ts +53 -0
- package/src/sgp4/sgp4.LICENSE.md +28 -0
- package/src/sgp4/sgp4.ts +3986 -0
- package/src/smoothing/ExponentialSmoothing.ts +1 -1
- package/src/time/Epoch.ts +128 -0
- package/src/time/EpochGPS.ts +76 -0
- package/src/time/EpochTAI.ts +27 -0
- package/src/time/EpochTDB.ts +27 -0
- package/src/time/EpochTT.ts +27 -0
- package/src/time/EpochUTC.ts +188 -0
- package/src/time/EpochWindow.ts +33 -0
- package/src/time/TimeStamped.ts +50 -0
- package/src/time/index.ts +31 -0
- package/src/transforms/TransformCache.ts +46 -0
- package/src/transforms/conversions.ts +98 -0
- package/src/transforms/index.ts +1 -0
- package/src/transforms/transforms.ts +478 -2
- package/src/types/types.ts +721 -2
- package/src/utils/constants.ts +113 -0
- package/src/utils/functions.ts +562 -0
- package/src/utils/index.ts +3 -1
- package/src/utils/jacobian.ts +1 -1
- package/src/utils/linearDistance.ts +11 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Copyright (c) 2014, Vladimir Agafonkin All rights reserved.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
|
|
4
|
+
following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
|
|
7
|
+
disclaimer.
|
|
8
|
+
|
|
9
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
|
|
10
|
+
disclaimer in the documentation and/or other materials provided with the distribution.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
13
|
+
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
14
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
15
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
16
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
17
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
18
|
+
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @copyright (c) 2022-2025 Theodore Kruczek Permission is
|
|
5
|
+
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
|
+
* software and associated documentation files (the "Software"), to deal in the
|
|
7
|
+
* Software without restriction, including without limitation the rights to use,
|
|
8
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
* the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
* so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
|
13
|
+
* all copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { Minutes, PositionVelocity, Degrees, Kilometers, Radians, Seconds, KilometersPerSecond, Earth }
|
|
25
|
+
from '../main.js';
|
|
26
|
+
import { Vector3D } from '../operations/Vector3D.js';
|
|
27
|
+
import { EpochUTC } from '../time/EpochUTC.js';
|
|
28
|
+
import { earthGravityParam, MINUTES_PER_DAY, RAD2DEG, sec2min, TAU } from '../utils/constants.js';
|
|
29
|
+
import { clamp, matchHalfPlane, newtonNu } from '../utils/functions.js';
|
|
30
|
+
import { EquinoctialElements } from './EquinoctialElements.js';
|
|
31
|
+
import { OrbitRegime } from '../enums/OrbitRegime.js';
|
|
32
|
+
import { StateVector } from './StateVector.js';
|
|
33
|
+
import { ClassicalElementsParams } from '../interfaces/ClassicalElementsParams.js';
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The ClassicalElements class represents the classical orbital elements of an object.
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const epoch = EpochUTC.fromDateTime(new Date('2024-01-14T14:39:39.914Z'));
|
|
40
|
+
* const elements = new ClassicalElements({
|
|
41
|
+
* epoch,
|
|
42
|
+
* semimajorAxis: 6943.547853722985 as Kilometers,
|
|
43
|
+
* eccentricity: 0.0011235968124658146,
|
|
44
|
+
* inclination: 0.7509087232045765 as Radians,
|
|
45
|
+
* rightAscension: 0.028239555738616327 as Radians,
|
|
46
|
+
* argPerigee: 2.5386411901807353 as Radians,
|
|
47
|
+
* trueAnomaly: 0.5931399364974058 as Radians,
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export class ClassicalElements {
|
|
52
|
+
epoch: EpochUTC;
|
|
53
|
+
semimajorAxis: Kilometers;
|
|
54
|
+
eccentricity: number;
|
|
55
|
+
inclination: Radians;
|
|
56
|
+
rightAscension: Radians;
|
|
57
|
+
argPerigee: Radians;
|
|
58
|
+
trueAnomaly: Radians;
|
|
59
|
+
/** Gravitational parameter in km³/s². */
|
|
60
|
+
mu: number;
|
|
61
|
+
|
|
62
|
+
constructor({
|
|
63
|
+
epoch,
|
|
64
|
+
semimajorAxis,
|
|
65
|
+
eccentricity,
|
|
66
|
+
inclination,
|
|
67
|
+
rightAscension,
|
|
68
|
+
argPerigee,
|
|
69
|
+
trueAnomaly,
|
|
70
|
+
mu = earthGravityParam,
|
|
71
|
+
}: ClassicalElementsParams) {
|
|
72
|
+
this.epoch = epoch;
|
|
73
|
+
this.semimajorAxis = semimajorAxis;
|
|
74
|
+
this.eccentricity = eccentricity;
|
|
75
|
+
this.inclination = inclination;
|
|
76
|
+
this.rightAscension = rightAscension;
|
|
77
|
+
this.argPerigee = argPerigee;
|
|
78
|
+
this.trueAnomaly = trueAnomaly;
|
|
79
|
+
this.mu = mu;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Creates a new instance of ClassicalElements from a StateVector.
|
|
84
|
+
* @param state The StateVector to convert.
|
|
85
|
+
* @param mu The gravitational parameter of the central body. Default value is Earth's gravitational parameter.
|
|
86
|
+
* @returns A new instance of ClassicalElements.
|
|
87
|
+
* @throws Error if the StateVector is not in an inertial frame.
|
|
88
|
+
*/
|
|
89
|
+
static fromStateVector(state: StateVector, mu = earthGravityParam): ClassicalElements {
|
|
90
|
+
if (!state.inertial) {
|
|
91
|
+
throw new Error('State vector must be in inertial frame (like J2000).');
|
|
92
|
+
}
|
|
93
|
+
const pos = state.position;
|
|
94
|
+
const vel = state.velocity;
|
|
95
|
+
const a = state.semimajorAxis;
|
|
96
|
+
const eVecA = pos.scale(vel.magnitude() ** 2 - mu / pos.magnitude() as KilometersPerSecond);
|
|
97
|
+
const eVecB = vel.scale(pos.dot(vel));
|
|
98
|
+
const eVec = eVecA.subtract(eVecB).scale(1 / mu);
|
|
99
|
+
const e = eVec.magnitude();
|
|
100
|
+
const h = pos.cross(vel);
|
|
101
|
+
const i = Math.acos(clamp(h.z / h.magnitude(), -1.0, 1.0)) as Radians;
|
|
102
|
+
const n = Vector3D.zAxis.cross(h);
|
|
103
|
+
let o = Math.acos(clamp(n.x / n.magnitude(), -1.0, 1.0)) as Radians;
|
|
104
|
+
|
|
105
|
+
if (n.y < 0) {
|
|
106
|
+
o = TAU - o as Radians;
|
|
107
|
+
}
|
|
108
|
+
let w = n.angle(eVec);
|
|
109
|
+
|
|
110
|
+
if (eVec.z < 0) {
|
|
111
|
+
w = TAU - w as Radians;
|
|
112
|
+
}
|
|
113
|
+
let v = eVec.angle(pos);
|
|
114
|
+
|
|
115
|
+
if (pos.dot(vel) < 0) {
|
|
116
|
+
v = TAU - v as Radians;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return new ClassicalElements({
|
|
120
|
+
epoch: state.epoch,
|
|
121
|
+
semimajorAxis: a,
|
|
122
|
+
eccentricity: e,
|
|
123
|
+
inclination: i,
|
|
124
|
+
rightAscension: o,
|
|
125
|
+
argPerigee: w,
|
|
126
|
+
trueAnomaly: v,
|
|
127
|
+
mu,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Gets the inclination in degrees.
|
|
133
|
+
* @returns The inclination in degrees.
|
|
134
|
+
*/
|
|
135
|
+
get inclinationDegrees(): Degrees {
|
|
136
|
+
return (this.inclination * RAD2DEG) as Degrees;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Gets the right ascension in degrees.
|
|
141
|
+
* @returns The right ascension in degrees.
|
|
142
|
+
*/
|
|
143
|
+
get rightAscensionDegrees(): Degrees {
|
|
144
|
+
return (this.rightAscension * RAD2DEG) as Degrees;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Gets the argument of perigee in degrees.
|
|
149
|
+
* @returns The argument of perigee in degrees.
|
|
150
|
+
*/
|
|
151
|
+
get argPerigeeDegrees(): Degrees {
|
|
152
|
+
return (this.argPerigee * RAD2DEG) as Degrees;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Gets the true anomaly in degrees.
|
|
157
|
+
* @returns The true anomaly in degrees.
|
|
158
|
+
*/
|
|
159
|
+
get trueAnomalyDegrees(): Degrees {
|
|
160
|
+
return (this.trueAnomaly * RAD2DEG) as Degrees;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Gets the apogee of the classical elements. It is measured from the surface of the earth.
|
|
165
|
+
* @returns The apogee in kilometers.
|
|
166
|
+
*/
|
|
167
|
+
get apogee(): Kilometers {
|
|
168
|
+
return (this.semimajorAxis * (1.0 + this.eccentricity) - Earth.radiusMean) as Kilometers;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Gets the perigee of the classical elements. The perigee is the point in an
|
|
173
|
+
* orbit that is closest to the surface of the earth.
|
|
174
|
+
* @returns The perigee distance in kilometers.
|
|
175
|
+
*/
|
|
176
|
+
get perigee(): number {
|
|
177
|
+
return (this.semimajorAxis * (1.0 - this.eccentricity) - Earth.radiusMean) as Kilometers;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
toString(): string {
|
|
181
|
+
return [
|
|
182
|
+
'[ClassicalElements]',
|
|
183
|
+
` Epoch: ${this.epoch}`,
|
|
184
|
+
` Semimajor Axis (a): ${this.semimajorAxis.toFixed(4)} km`,
|
|
185
|
+
` Eccentricity (e): ${this.eccentricity.toFixed(7)}`,
|
|
186
|
+
` Inclination (i): ${this.inclinationDegrees.toFixed(4)}°`,
|
|
187
|
+
` Right Ascension (Ω): ${this.rightAscensionDegrees.toFixed(4)}°`,
|
|
188
|
+
` Argument of Perigee (ω): ${this.argPerigeeDegrees.toFixed(4)}°`,
|
|
189
|
+
` True Anomaly (ν): ${this.trueAnomalyDegrees.toFixed(4)}°`,
|
|
190
|
+
].join('\n');
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Calculates the mean motion of the celestial object.
|
|
195
|
+
* @returns The mean motion in radians.
|
|
196
|
+
*/
|
|
197
|
+
get meanMotion(): Radians {
|
|
198
|
+
return Math.sqrt(this.mu / this.semimajorAxis ** 3) as Radians;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Calculates the period of the orbit.
|
|
203
|
+
* @returns The period in seconds.
|
|
204
|
+
*/
|
|
205
|
+
get period(): Minutes {
|
|
206
|
+
const periodSec = (TAU * Math.sqrt(this.semimajorAxis ** 3 / this.mu)) as Seconds;
|
|
207
|
+
|
|
208
|
+
return (periodSec / 60) as Minutes;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Compute the number of revolutions completed per day for this orbit.
|
|
213
|
+
* @returns The number of revolutions per day.
|
|
214
|
+
*/
|
|
215
|
+
get revsPerDay(): number {
|
|
216
|
+
return MINUTES_PER_DAY / this.period;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Returns the orbit regime based on the classical elements.
|
|
221
|
+
* @returns The orbit regime.
|
|
222
|
+
*/
|
|
223
|
+
getOrbitRegime(): OrbitRegime {
|
|
224
|
+
const n = this.revsPerDay;
|
|
225
|
+
const p = this.period * sec2min;
|
|
226
|
+
|
|
227
|
+
if (n >= 0.99 && n <= 1.01 && this.eccentricity < 0.01) {
|
|
228
|
+
return OrbitRegime.GEO;
|
|
229
|
+
}
|
|
230
|
+
if (p >= 600 && p <= 800 && this.eccentricity <= 0.25) {
|
|
231
|
+
return OrbitRegime.MEO;
|
|
232
|
+
}
|
|
233
|
+
if (n >= 11.25 && this.eccentricity <= 0.25) {
|
|
234
|
+
return OrbitRegime.LEO;
|
|
235
|
+
}
|
|
236
|
+
if (this.eccentricity > 0.25) {
|
|
237
|
+
return OrbitRegime.HEO;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
return OrbitRegime.OTHER;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Converts the classical orbital elements to position and velocity vectors.
|
|
245
|
+
* @returns An object containing the position and velocity vectors.
|
|
246
|
+
*/
|
|
247
|
+
toPositionVelocity(): PositionVelocity {
|
|
248
|
+
const rVec = new Vector3D(Math.cos(this.trueAnomaly), Math.sin(this.trueAnomaly), 0.0);
|
|
249
|
+
const rPQW = rVec.scale(
|
|
250
|
+
(this.semimajorAxis * (1.0 - this.eccentricity ** 2)) / (1.0 + this.eccentricity * Math.cos(this.trueAnomaly)),
|
|
251
|
+
);
|
|
252
|
+
const vVec = new Vector3D(-Math.sin(this.trueAnomaly), this.eccentricity + Math.cos(this.trueAnomaly), 0.0);
|
|
253
|
+
const vPQW = vVec.scale(Math.sqrt(this.mu / (this.semimajorAxis * (1 - this.eccentricity ** 2))));
|
|
254
|
+
const position = rPQW
|
|
255
|
+
.rotZ(-this.argPerigee as Radians)
|
|
256
|
+
.rotX(-this.inclination)
|
|
257
|
+
.rotZ(-this.rightAscension as Radians) as Vector3D<Kilometers>;
|
|
258
|
+
const velocity = vPQW
|
|
259
|
+
.rotZ(-this.argPerigee as Radians)
|
|
260
|
+
.rotX(-this.inclination)
|
|
261
|
+
.rotZ(-this.rightAscension as Radians) as Vector3D<KilometersPerSecond>;
|
|
262
|
+
|
|
263
|
+
return { position, velocity };
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Converts the classical elements to equinoctial elements.
|
|
268
|
+
* @returns The equinoctial elements.
|
|
269
|
+
*/
|
|
270
|
+
toEquinoctialElements(): EquinoctialElements {
|
|
271
|
+
const I = this.inclination > Math.PI / 2 ? -1 : 1;
|
|
272
|
+
const h = this.eccentricity * Math.sin(this.argPerigee + I * this.rightAscension);
|
|
273
|
+
const k = this.eccentricity * Math.cos(this.argPerigee + I * this.rightAscension);
|
|
274
|
+
const meanAnomaly = newtonNu(this.eccentricity, this.trueAnomaly).m;
|
|
275
|
+
const lambda = (meanAnomaly + this.argPerigee + I * this.rightAscension) as Radians;
|
|
276
|
+
const a = this.semimajorAxis;
|
|
277
|
+
const p = Math.tan(0.5 * this.inclination) ** I * Math.sin(this.rightAscension);
|
|
278
|
+
const q = Math.tan(0.5 * this.inclination) ** I * Math.cos(this.rightAscension);
|
|
279
|
+
|
|
280
|
+
return new EquinoctialElements({ epoch: this.epoch, k, h, lambda, a, p, q, mu: this.mu, I });
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Propagates the classical elements to a given epoch.
|
|
285
|
+
* @param propEpoch - The epoch to propagate the classical elements to.
|
|
286
|
+
* @returns The classical elements at the propagated epoch.
|
|
287
|
+
*/
|
|
288
|
+
propagate(propEpoch: EpochUTC): ClassicalElements {
|
|
289
|
+
const t = this.epoch;
|
|
290
|
+
const n = this.meanMotion;
|
|
291
|
+
const delta = propEpoch.difference(t);
|
|
292
|
+
const cosV = Math.cos(this.trueAnomaly);
|
|
293
|
+
let eaInit = Math.acos(clamp((this.eccentricity + cosV) / (1 + this.eccentricity * cosV), -1, 1));
|
|
294
|
+
|
|
295
|
+
eaInit = matchHalfPlane(eaInit, this.trueAnomaly);
|
|
296
|
+
let maInit = eaInit - this.eccentricity * Math.sin(eaInit);
|
|
297
|
+
|
|
298
|
+
maInit = matchHalfPlane(maInit, eaInit);
|
|
299
|
+
const maFinal = (maInit + n * delta) % TAU;
|
|
300
|
+
let eaFinal = maFinal;
|
|
301
|
+
|
|
302
|
+
for (let iter = 0; iter < 32; iter++) {
|
|
303
|
+
const eaTemp = maFinal + this.eccentricity * Math.sin(eaFinal);
|
|
304
|
+
|
|
305
|
+
if (Math.abs(eaTemp - eaFinal) < 1e-12) {
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
eaFinal = eaTemp;
|
|
309
|
+
}
|
|
310
|
+
const cosEaFinal = Math.cos(eaFinal);
|
|
311
|
+
let vFinal = clamp(Math.acos((cosEaFinal - this.eccentricity) / (1 - this.eccentricity * cosEaFinal)), -1, 1);
|
|
312
|
+
|
|
313
|
+
vFinal = matchHalfPlane(vFinal, eaFinal);
|
|
314
|
+
|
|
315
|
+
return new ClassicalElements({
|
|
316
|
+
epoch: propEpoch,
|
|
317
|
+
semimajorAxis: this.semimajorAxis,
|
|
318
|
+
eccentricity: this.eccentricity,
|
|
319
|
+
inclination: this.inclination,
|
|
320
|
+
rightAscension: this.rightAscension,
|
|
321
|
+
argPerigee: this.argPerigee,
|
|
322
|
+
trueAnomaly: vFinal as Radians,
|
|
323
|
+
mu: this.mu,
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Theodore Kruczek.
|
|
3
|
+
* @license MIT
|
|
4
|
+
* @copyright (c) 2022-2025 Theodore Kruczek Permission is
|
|
5
|
+
* hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
|
+
* software and associated documentation files (the "Software"), to deal in the
|
|
7
|
+
* Software without restriction, including without limitation the rights to use,
|
|
8
|
+
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
* the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
* so, subject to the following conditions:
|
|
11
|
+
*
|
|
12
|
+
* The above copyright notice and this permission notice shall be included in
|
|
13
|
+
* all copies or substantial portions of the Software.
|
|
14
|
+
*
|
|
15
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
* SOFTWARE.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { Minutes, PositionVelocity, Kilometers, Radians, Seconds } from '../main.js';
|
|
25
|
+
import { EpochUTC } from '../time/EpochUTC.js';
|
|
26
|
+
import { earthGravityParam, MINUTES_PER_DAY, TAU } from '../utils/constants.js';
|
|
27
|
+
import { newtonM } from '../utils/functions.js';
|
|
28
|
+
import { ClassicalElements } from './ClassicalElements.js';
|
|
29
|
+
import { EquinoctialElementsParams } from '../interfaces/EquinoctialElementsParams.js';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Equinoctial elements are a set of orbital elements used to describe the
|
|
33
|
+
* orbits of celestial bodies, such as satellites around a planet. They provide
|
|
34
|
+
* an alternative to the traditional Keplerian elements and are especially
|
|
35
|
+
* useful for avoiding singularities and numerical issues in certain types of
|
|
36
|
+
* orbits.
|
|
37
|
+
*
|
|
38
|
+
* Unlike Keplerian elements, equinoctial elements don't suffer from
|
|
39
|
+
* singularities at zero eccentricity (circular orbits) or zero inclination
|
|
40
|
+
* (equatorial orbits). This makes them more reliable for numerical simulations
|
|
41
|
+
* and analytical studies, especially in these edge cases.
|
|
42
|
+
* @see https://faculty.nps.edu/dad/orbital/th0.pdf
|
|
43
|
+
*/
|
|
44
|
+
export class EquinoctialElements {
|
|
45
|
+
epoch: EpochUTC;
|
|
46
|
+
/** The semi-major axis of the orbit in kilometers. */
|
|
47
|
+
a: Kilometers;
|
|
48
|
+
/** The h component of the eccentricity vector. */
|
|
49
|
+
h: number;
|
|
50
|
+
/** The k component of the eccentricity vector. */
|
|
51
|
+
k: number;
|
|
52
|
+
/** The p component of the ascending node vector. */
|
|
53
|
+
p: number;
|
|
54
|
+
/** The q component of the ascending node vector. */
|
|
55
|
+
q: number;
|
|
56
|
+
/** The mean longitude of the orbit in radians. */
|
|
57
|
+
lambda: Radians;
|
|
58
|
+
/** The gravitational parameter of the central body in km³/s². */
|
|
59
|
+
mu: number;
|
|
60
|
+
/** The retrograde factor. 1 for prograde orbits, -1 for retrograde orbits. */
|
|
61
|
+
I: 1 | -1;
|
|
62
|
+
constructor({ epoch, h, k, lambda, a, p, q, mu, I }: EquinoctialElementsParams) {
|
|
63
|
+
this.epoch = epoch;
|
|
64
|
+
this.h = h;
|
|
65
|
+
this.k = k;
|
|
66
|
+
this.lambda = lambda;
|
|
67
|
+
this.a = a;
|
|
68
|
+
this.p = p;
|
|
69
|
+
this.q = q;
|
|
70
|
+
this.mu = mu ?? earthGravityParam;
|
|
71
|
+
this.I = I ?? 1;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Returns a string representation of the EquinoctialElements object.
|
|
76
|
+
* @returns A string representation of the EquinoctialElements object.
|
|
77
|
+
*/
|
|
78
|
+
toString(): string {
|
|
79
|
+
return [
|
|
80
|
+
'[EquinoctialElements]',
|
|
81
|
+
` Epoch: ${this.epoch}`,
|
|
82
|
+
` a: ${this.a} km`,
|
|
83
|
+
` h: ${this.h}`,
|
|
84
|
+
` k: ${this.k}`,
|
|
85
|
+
` p: ${this.p}`,
|
|
86
|
+
` q: ${this.q}`,
|
|
87
|
+
` lambda: ${this.lambda} rad`,
|
|
88
|
+
].join('\n');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Gets the semimajor axis.
|
|
93
|
+
* @returns The semimajor axis in kilometers.
|
|
94
|
+
*/
|
|
95
|
+
get semimajorAxis(): Kilometers {
|
|
96
|
+
return this.a;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Gets the mean longitude.
|
|
101
|
+
* @returns The mean longitude in radians.
|
|
102
|
+
*/
|
|
103
|
+
get meanLongitude(): Radians {
|
|
104
|
+
return this.lambda;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Calculates the mean motion of the celestial object.
|
|
109
|
+
* @returns The mean motion in units of radians per second.
|
|
110
|
+
*/
|
|
111
|
+
get meanMotion(): number {
|
|
112
|
+
return Math.sqrt(this.mu / this.a ** 3);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Gets the retrograde factor.
|
|
117
|
+
* @returns The retrograde factor.
|
|
118
|
+
*/
|
|
119
|
+
get retrogradeFactor(): number {
|
|
120
|
+
return this.I;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Checks if the orbit is prograde.
|
|
125
|
+
* @returns True if the orbit is prograde, false otherwise.
|
|
126
|
+
*/
|
|
127
|
+
isPrograde(): boolean {
|
|
128
|
+
return this.I === 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Checks if the orbit is retrograde.
|
|
133
|
+
* @returns True if the orbit is retrograde, false otherwise.
|
|
134
|
+
*/
|
|
135
|
+
isRetrograde(): boolean {
|
|
136
|
+
return this.I === -1;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Gets the period of the orbit.
|
|
141
|
+
* @returns The period in minutes.
|
|
142
|
+
*/
|
|
143
|
+
get period(): Minutes {
|
|
144
|
+
const periodSec = (TAU * Math.sqrt(this.semimajorAxis ** 3 / this.mu)) as Seconds;
|
|
145
|
+
|
|
146
|
+
return (periodSec / 60) as Minutes;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Gets the number of revolutions per day.
|
|
151
|
+
* @returns The number of revolutions per day.
|
|
152
|
+
*/
|
|
153
|
+
get revsPerDay(): number {
|
|
154
|
+
return MINUTES_PER_DAY / this.period;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Converts the equinoctial elements to classical elements.
|
|
159
|
+
* @returns The classical elements.
|
|
160
|
+
*/
|
|
161
|
+
toClassicalElements(): ClassicalElements {
|
|
162
|
+
const a = this.semimajorAxis;
|
|
163
|
+
const e = Math.sqrt(this.k * this.k + this.h * this.h);
|
|
164
|
+
const i = Math.PI * ((1.0 - this.I) * 0.5) + 2.0 * this.I * Math.atan(Math.sqrt(this.p * this.p + this.q * this.q));
|
|
165
|
+
const o = Math.atan2(this.p, this.q);
|
|
166
|
+
const w = Math.atan2(this.h, this.k) - this.I * Math.atan2(this.p, this.q);
|
|
167
|
+
const m = this.lambda - this.I * o - w;
|
|
168
|
+
const v = newtonM(e, m).nu;
|
|
169
|
+
|
|
170
|
+
return new ClassicalElements({
|
|
171
|
+
epoch: this.epoch,
|
|
172
|
+
semimajorAxis: a,
|
|
173
|
+
eccentricity: e,
|
|
174
|
+
inclination: i as Radians,
|
|
175
|
+
rightAscension: o as Radians,
|
|
176
|
+
argPerigee: w as Radians,
|
|
177
|
+
trueAnomaly: v as Radians,
|
|
178
|
+
mu: this.mu,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Converts the equinoctial elements to position and velocity.
|
|
184
|
+
* @returns The position and velocity in classical elements.
|
|
185
|
+
*/
|
|
186
|
+
toPositionVelocity(): PositionVelocity {
|
|
187
|
+
return this.toClassicalElements().toPositionVelocity();
|
|
188
|
+
}
|
|
189
|
+
}
|