ootk 4.0.8 → 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/CHANGELOG.md +9 -2
- 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 +3 -1
- package/dist/objects/DetailedSatellite.js +4 -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 +5 -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,98 @@
|
|
|
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 { DEG2RAD, Degrees, PI, RAD2DEG, Radians } from '../main.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Converts radians to degrees.
|
|
28
|
+
* @param radians The value in radians to be converted.
|
|
29
|
+
* @returns The value in degrees.
|
|
30
|
+
*/
|
|
31
|
+
export function rad2deg(radians: Radians): Degrees {
|
|
32
|
+
return <Degrees>((radians * 180) / PI);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Converts degrees to radians.
|
|
37
|
+
* @param degrees The value in degrees to be converted.
|
|
38
|
+
* @returns The value in radians.
|
|
39
|
+
*/
|
|
40
|
+
export function deg2rad(degrees: Degrees): Radians {
|
|
41
|
+
return <Radians>((degrees * PI) / 180.0);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Converts radians to degrees latitude.
|
|
46
|
+
* @param radians The radians value to convert.
|
|
47
|
+
* @returns The corresponding degrees latitude.
|
|
48
|
+
* @throws RangeError if the radians value is outside the range [-PI/2; PI/2].
|
|
49
|
+
*/
|
|
50
|
+
export function getDegLat(radians: Radians): Degrees {
|
|
51
|
+
if (radians < -PI / 2 || radians > PI / 2) {
|
|
52
|
+
throw new RangeError('Latitude radians must be in range [-PI/2; PI/2].');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (radians * RAD2DEG) as Degrees;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Converts radians to degrees for longitude.
|
|
60
|
+
* @param radians The value in radians to be converted.
|
|
61
|
+
* @returns The converted value in degrees.
|
|
62
|
+
* @throws {RangeError} If the input radians is not within the range [-PI; PI].
|
|
63
|
+
*/
|
|
64
|
+
export function getDegLon(radians: Radians): Degrees {
|
|
65
|
+
if (radians < -PI || radians > PI) {
|
|
66
|
+
throw new RangeError('Longitude radians must be in range [-PI; PI].');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return (radians * RAD2DEG) as Degrees;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Converts degrees to radians for latitude.
|
|
74
|
+
* @param degrees The degrees value to convert.
|
|
75
|
+
* @returns The equivalent radians value.
|
|
76
|
+
* @throws {RangeError} If the degrees value is not within the range [-90, 90].
|
|
77
|
+
*/
|
|
78
|
+
export function getRadLat(degrees: Degrees): Radians {
|
|
79
|
+
if (degrees < -90 || degrees > 90) {
|
|
80
|
+
throw new RangeError('Latitude degrees must be in range [-90; 90].');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return (degrees * DEG2RAD) as Radians;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Converts degrees to radians.
|
|
88
|
+
* @param degrees The value in degrees to be converted.
|
|
89
|
+
* @returns The value in radians.
|
|
90
|
+
* @throws {RangeError} If the input degrees are not within the range [-180; 180].
|
|
91
|
+
*/
|
|
92
|
+
export function getRadLon(degrees: Degrees): Radians {
|
|
93
|
+
if (degrees < -180 || degrees > 180) {
|
|
94
|
+
throw new RangeError('Longitude degrees must be in range [-180; 180].');
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return (degrees * DEG2RAD) as Radians;
|
|
98
|
+
}
|
package/src/transforms/index.ts
CHANGED
|
@@ -1,5 +1,481 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
DEG2RAD,
|
|
3
|
+
Degrees,
|
|
4
|
+
Earth,
|
|
5
|
+
EcefVec3,
|
|
6
|
+
EcfVec3,
|
|
7
|
+
EciVec3,
|
|
8
|
+
EnuVec3,
|
|
9
|
+
GreenwichMeanSiderealTime,
|
|
10
|
+
Kilometers,
|
|
11
|
+
LlaVec3,
|
|
12
|
+
MILLISECONDS_TO_DAYS,
|
|
13
|
+
PI,
|
|
14
|
+
RAD2DEG,
|
|
15
|
+
Radians,
|
|
16
|
+
RaeVec3,
|
|
17
|
+
Sensor,
|
|
18
|
+
SezVec3,
|
|
19
|
+
Sgp4,
|
|
20
|
+
TAU,
|
|
21
|
+
RfVec3,
|
|
22
|
+
RuvVec3,
|
|
23
|
+
RfSensor,
|
|
24
|
+
} from '../main.js';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Converts ECF to ECI coordinates.
|
|
28
|
+
*
|
|
29
|
+
* [X] [C -S 0][X]
|
|
30
|
+
* [Y] = [S C 0][Y]
|
|
31
|
+
* [Z]eci [0 0 1][Z]ecf
|
|
32
|
+
* @param ecf takes xyz coordinates
|
|
33
|
+
* @param gmst takes a number in gmst time
|
|
34
|
+
* @returns array containing eci coordinates
|
|
35
|
+
*/
|
|
36
|
+
export function ecf2eci<T extends number>(ecf: EcfVec3<T>, gmst: number): EciVec3<T> {
|
|
37
|
+
const X = (ecf.x * Math.cos(gmst) - ecf.y * Math.sin(gmst)) as T;
|
|
38
|
+
const Y = (ecf.x * Math.sin(gmst) + ecf.y * Math.cos(gmst)) as T;
|
|
39
|
+
const Z = ecf.z;
|
|
40
|
+
|
|
41
|
+
return { x: X, y: Y, z: Z };
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Converts ECEF coordinates to ENU coordinates.
|
|
46
|
+
* @param ecf - The ECEF coordinates.
|
|
47
|
+
* @param lla - The LLA coordinates.
|
|
48
|
+
* @returns The ENU coordinates.
|
|
49
|
+
*/
|
|
50
|
+
export function ecf2enu<T extends number>(ecf: EcefVec3<T>, lla: LlaVec3): EnuVec3<T> {
|
|
51
|
+
const { lat, lon } = lla;
|
|
52
|
+
const { x, y, z } = ecf;
|
|
53
|
+
const e = (-Math.sin(lon) * x + Math.cos(lon) * y) as T;
|
|
54
|
+
const n = (-Math.sin(lat) * Math.cos(lon) * x - Math.sin(lat) * Math.sin(lon) * y + Math.cos(lat) * z) as T;
|
|
55
|
+
const u = (Math.cos(lat) * Math.cos(lon) * x + Math.cos(lat) * Math.sin(lon) * y + Math.sin(lat) * z) as T;
|
|
56
|
+
|
|
57
|
+
return { x: e, y: n, z: u };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Converts ECI to ECF coordinates.
|
|
62
|
+
*
|
|
63
|
+
* [X] [C -S 0][X]
|
|
64
|
+
* [Y] = [S C 0][Y]
|
|
65
|
+
* [Z]eci [0 0 1][Z]ecf
|
|
66
|
+
*
|
|
67
|
+
* Inverse:
|
|
68
|
+
* [X] [C S 0][X]
|
|
69
|
+
* [Y] = [-S C 0][Y]
|
|
70
|
+
* [Z]ecf [0 0 1][Z]eci
|
|
71
|
+
* @param eci takes xyz coordinates
|
|
72
|
+
* @param gmst takes a number in gmst time
|
|
73
|
+
* @returns array containing ecf coordinates
|
|
74
|
+
*/
|
|
75
|
+
export function eci2ecf<T extends number>(eci: EciVec3<T>, gmst: number): EcfVec3<T> {
|
|
76
|
+
const x = <T>(eci.x * Math.cos(gmst) + eci.y * Math.sin(gmst));
|
|
77
|
+
const y = <T>(eci.x * -Math.sin(gmst) + eci.y * Math.cos(gmst));
|
|
78
|
+
const z = eci.z;
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
x,
|
|
82
|
+
y,
|
|
83
|
+
z,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* EciToGeodetic converts eci coordinates to lla coordinates
|
|
89
|
+
* @variation cached - results are cached
|
|
90
|
+
* @param eci takes xyz coordinates
|
|
91
|
+
* @param gmst takes a number in gmst time
|
|
92
|
+
* @returns array containing lla coordinates
|
|
93
|
+
*/
|
|
94
|
+
export function eci2lla(eci: EciVec3, gmst: number): LlaVec3<Degrees, Kilometers> {
|
|
95
|
+
// http://www.celestrak.com/columns/v02n03/
|
|
96
|
+
const a = 6378.137;
|
|
97
|
+
const b = 6356.7523142;
|
|
98
|
+
const R = Math.sqrt(eci.x * eci.x + eci.y * eci.y);
|
|
99
|
+
const f = (a - b) / a;
|
|
100
|
+
const e2 = 2 * f - f * f;
|
|
101
|
+
|
|
102
|
+
let lon = Math.atan2(eci.y, eci.x) - gmst;
|
|
103
|
+
|
|
104
|
+
while (lon < -PI) {
|
|
105
|
+
lon += TAU;
|
|
106
|
+
}
|
|
107
|
+
while (lon > PI) {
|
|
108
|
+
lon -= TAU;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const kmax = 20;
|
|
112
|
+
let k = 0;
|
|
113
|
+
let lat = Math.atan2(eci.z, Math.sqrt(eci.x * eci.x + eci.y * eci.y));
|
|
114
|
+
let C = 0;
|
|
115
|
+
|
|
116
|
+
while (k < kmax) {
|
|
117
|
+
C = 1 / Math.sqrt(1 - e2 * (Math.sin(lat) * Math.sin(lat)));
|
|
118
|
+
lat = Math.atan2(eci.z + a * C * e2 * Math.sin(lat), R);
|
|
119
|
+
k += 1;
|
|
120
|
+
}
|
|
121
|
+
const alt = R / Math.cos(lat) - a * C;
|
|
122
|
+
|
|
123
|
+
lon = (lon * RAD2DEG) as Degrees;
|
|
124
|
+
lat = (lat * RAD2DEG) as Degrees;
|
|
125
|
+
|
|
126
|
+
return { lon: <Degrees>lon, lat: <Degrees>lat, alt: <Kilometers>alt };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Converts geodetic coordinates (longitude, latitude, altitude) to Earth-Centered Earth-Fixed (ECF) coordinates.
|
|
131
|
+
* @param lla The geodetic coordinates in radians and meters.
|
|
132
|
+
* @returns The ECF coordinates in meters.
|
|
133
|
+
*/
|
|
134
|
+
export function llaRad2ecf<AltitudeUnits extends number>(lla: LlaVec3<Radians, AltitudeUnits>): EcfVec3<AltitudeUnits> {
|
|
135
|
+
const { lon, lat, alt } = lla;
|
|
136
|
+
|
|
137
|
+
const a = 6378.137;
|
|
138
|
+
const b = 6356.7523142;
|
|
139
|
+
const f = (a - b) / a;
|
|
140
|
+
const e2 = 2 * f - f * f;
|
|
141
|
+
const normal = a / Math.sqrt(1 - e2 * Math.sin(lat) ** 2);
|
|
142
|
+
|
|
143
|
+
const x = (normal + alt) * Math.cos(lat) * Math.cos(lon);
|
|
144
|
+
const y = (normal + alt) * Math.cos(lat) * Math.sin(lon);
|
|
145
|
+
const z = (normal * (1 - e2) + alt) * Math.sin(lat);
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
x: <AltitudeUnits>x,
|
|
149
|
+
y: <AltitudeUnits>y,
|
|
150
|
+
z: <AltitudeUnits>z,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Converts geodetic coordinates (longitude, latitude, altitude) to Earth-Centered Earth-Fixed (ECF) coordinates.
|
|
156
|
+
* @param lla The geodetic coordinates in degrees and meters.
|
|
157
|
+
* @returns The ECF coordinates in meters.
|
|
158
|
+
*/
|
|
159
|
+
export function lla2ecf<AltitudeUnits extends number>(lla: LlaVec3<Degrees, AltitudeUnits>): EcfVec3<AltitudeUnits> {
|
|
160
|
+
const { lon, lat, alt } = lla;
|
|
161
|
+
|
|
162
|
+
const lonRad = lon * DEG2RAD;
|
|
163
|
+
const latRad = lat * DEG2RAD;
|
|
164
|
+
|
|
165
|
+
return llaRad2ecf({
|
|
166
|
+
lon: lonRad as Radians,
|
|
167
|
+
lat: latRad as Radians,
|
|
168
|
+
alt,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Converts geodetic coordinates (latitude, longitude, altitude) to Earth-centered inertial (ECI) coordinates.
|
|
174
|
+
* @variation cached - results are cached
|
|
175
|
+
* @param lla The geodetic coordinates in radians and meters.
|
|
176
|
+
* @param gmst The Greenwich Mean Sidereal Time in seconds.
|
|
177
|
+
* @returns The ECI coordinates in meters.
|
|
178
|
+
*/
|
|
179
|
+
export function lla2eci(lla: LlaVec3<Radians, Kilometers>, gmst: GreenwichMeanSiderealTime): EciVec3<Kilometers> {
|
|
180
|
+
const { lat, lon, alt } = lla;
|
|
181
|
+
|
|
182
|
+
const cosLat = Math.cos(lat);
|
|
183
|
+
const sinLat = Math.sin(lat);
|
|
184
|
+
const cosLon = Math.cos(lon + gmst);
|
|
185
|
+
const sinLon = Math.sin(lon + gmst);
|
|
186
|
+
const x = (Earth.radiusMean + alt) * cosLat * cosLon;
|
|
187
|
+
const y = (Earth.radiusMean + alt) * cosLat * sinLon;
|
|
188
|
+
const z = (Earth.radiusMean + alt) * sinLat;
|
|
189
|
+
|
|
190
|
+
return { x, y, z } as EciVec3<Kilometers>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Calculates Geodetic Lat Lon Alt to ECEF coordinates.
|
|
195
|
+
* @deprecated This needs to be validated.
|
|
196
|
+
* @param lla The geodetic coordinates in degrees and meters.
|
|
197
|
+
* @returns The ECEF coordinates in meters.
|
|
198
|
+
*/
|
|
199
|
+
export function lla2ecef<D extends number>(lla: LlaVec3<Degrees, D>): EcefVec3<D> {
|
|
200
|
+
const { lat, lon, alt } = lla;
|
|
201
|
+
const a = 6378.137; // semi-major axis length in meters according to the WGS84
|
|
202
|
+
const b = 6356.752314245; // semi-minor axis length in meters according to the WGS84
|
|
203
|
+
const e = Math.sqrt(1 - b ** 2 / a ** 2); // eccentricity
|
|
204
|
+
const N = a / Math.sqrt(1 - e ** 2 * Math.sin(lat) ** 2); // radius of curvature in the prime vertical
|
|
205
|
+
const x = ((N + alt) * Math.cos(lat) * Math.cos(lon)) as D;
|
|
206
|
+
const y = ((N + alt) * Math.cos(lat) * Math.sin(lon)) as D;
|
|
207
|
+
const z = ((N * (1 - e ** 2) + alt) * Math.sin(lat)) as D;
|
|
208
|
+
|
|
209
|
+
return { x, y, z };
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Converts LLA to SEZ coordinates.
|
|
214
|
+
* @see http://www.celestrak.com/columns/v02n02/
|
|
215
|
+
* @param lla The LLA coordinates.
|
|
216
|
+
* @param ecf The ECF coordinates.
|
|
217
|
+
* @returns The SEZ coordinates.
|
|
218
|
+
*/
|
|
219
|
+
export function lla2sez<D extends number>(lla: LlaVec3<Radians, D>, ecf: EcfVec3<D>): SezVec3<D> {
|
|
220
|
+
const lon = lla.lon;
|
|
221
|
+
const lat = lla.lat;
|
|
222
|
+
|
|
223
|
+
const observerEcf = llaRad2ecf({
|
|
224
|
+
lat,
|
|
225
|
+
lon,
|
|
226
|
+
alt: <Kilometers>0,
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
const rx = ecf.x - observerEcf.x;
|
|
230
|
+
const ry = ecf.y - observerEcf.y;
|
|
231
|
+
const rz = ecf.z - observerEcf.z;
|
|
232
|
+
|
|
233
|
+
// Top is short for topocentric
|
|
234
|
+
const south = Math.sin(lat) * Math.cos(lon) * rx + Math.sin(lat) * Math.sin(lon) * ry - Math.cos(lat) * rz;
|
|
235
|
+
|
|
236
|
+
const east = -Math.sin(lon) * rx + Math.cos(lon) * ry;
|
|
237
|
+
|
|
238
|
+
const zenith = Math.cos(lat) * Math.cos(lon) * rx + Math.cos(lat) * Math.sin(lon) * ry + Math.sin(lat) * rz;
|
|
239
|
+
|
|
240
|
+
return { s: <D>south, e: <D>east, z: <D>zenith };
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Converts a vector in Right Ascension, Elevation, and Range (RAE) coordinate system
|
|
245
|
+
* to a vector in South, East, and Zenith (SEZ) coordinate system.
|
|
246
|
+
* @param rae The vector in RAE coordinate system.
|
|
247
|
+
* @returns The vector in SEZ coordinate system.
|
|
248
|
+
*/
|
|
249
|
+
export function rae2sez<D extends number>(rae: RaeVec3<D, Radians>): SezVec3<D> {
|
|
250
|
+
const south = -rae.rng * Math.cos(rae.el) * Math.cos(rae.az);
|
|
251
|
+
const east = rae.rng * Math.cos(rae.el) * Math.sin(rae.az);
|
|
252
|
+
const zenith = rae.rng * Math.sin(rae.el);
|
|
253
|
+
|
|
254
|
+
return {
|
|
255
|
+
s: <D>south,
|
|
256
|
+
e: <D>east,
|
|
257
|
+
z: <D>zenith,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Converts a vector in Right Ascension, Elevation, and Range (RAE) coordinate system
|
|
263
|
+
* to Earth-Centered Fixed (ECF) coordinate system.
|
|
264
|
+
* @template D - The dimension of the RAE vector.
|
|
265
|
+
* @template A - The dimension of the LLA vector.
|
|
266
|
+
* @param rae - The vector in RAE coordinate system.
|
|
267
|
+
* @param lla - The vector in LLA coordinate system.
|
|
268
|
+
* @returns The vector in ECF coordinate system.
|
|
269
|
+
*/
|
|
270
|
+
export function rae2ecf<D extends number>(rae: RaeVec3<D, Degrees>, lla: LlaVec3<Degrees, D>): EcfVec3<D> {
|
|
271
|
+
const llaRad = {
|
|
272
|
+
lat: (lla.lat * DEG2RAD) as Radians,
|
|
273
|
+
lon: (lla.lon * DEG2RAD) as Radians,
|
|
274
|
+
alt: lla.alt,
|
|
275
|
+
};
|
|
276
|
+
const raeRad = {
|
|
277
|
+
az: (rae.az * DEG2RAD) as Radians,
|
|
278
|
+
el: (rae.el * DEG2RAD) as Radians,
|
|
279
|
+
rng: rae.rng,
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
const obsEcf = llaRad2ecf(llaRad);
|
|
283
|
+
const sez = rae2sez(raeRad);
|
|
284
|
+
|
|
285
|
+
// Some needed calculations
|
|
286
|
+
const slat = Math.sin(llaRad.lat);
|
|
287
|
+
const slon = Math.sin(llaRad.lon);
|
|
288
|
+
const clat = Math.cos(llaRad.lat);
|
|
289
|
+
const clon = Math.cos(llaRad.lon);
|
|
290
|
+
|
|
291
|
+
const x = slat * clon * sez.s + -slon * sez.e + clat * clon * sez.z + obsEcf.x;
|
|
292
|
+
const y = slat * slon * sez.s + clon * sez.e + clat * slon * sez.z + obsEcf.y;
|
|
293
|
+
const z = -clat * sez.s + slat * sez.z + obsEcf.z;
|
|
294
|
+
|
|
295
|
+
return { x, y, z } as EcfVec3<D>;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Converts a vector from RAE (Range, Azimuth, Elevation) coordinates to ECI (Earth-Centered Inertial) coordinates.
|
|
300
|
+
* @variation cached - results are cached
|
|
301
|
+
* @param rae The vector in RAE coordinates.
|
|
302
|
+
* @param lla The vector in LLA (Latitude, Longitude, Altitude) coordinates.
|
|
303
|
+
* @param gmst The Greenwich Mean Sidereal Time.
|
|
304
|
+
* @returns The vector in ECI coordinates.
|
|
305
|
+
*/
|
|
306
|
+
export function rae2eci<D extends number>(
|
|
307
|
+
rae: RaeVec3<D, Degrees>,
|
|
308
|
+
lla: LlaVec3<Degrees, D>,
|
|
309
|
+
gmst: number,
|
|
310
|
+
): EciVec3<D> {
|
|
311
|
+
const ecf = rae2ecf(rae, lla);
|
|
312
|
+
const eci = ecf2eci(ecf, gmst);
|
|
313
|
+
|
|
314
|
+
return eci;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Converts a vector in RAE (Range, Azimuth, Elevation) coordinates to ENU (East, North, Up) coordinates.
|
|
319
|
+
* @param rae - The vector in RAE coordinates.
|
|
320
|
+
* @returns The vector in ENU coordinates.
|
|
321
|
+
*/
|
|
322
|
+
export function rae2enu(rae: RaeVec3): EnuVec3<Kilometers> {
|
|
323
|
+
const e = (rae.rng * Math.cos(rae.el) * Math.sin(rae.az)) as Kilometers;
|
|
324
|
+
const n = (rae.rng * Math.cos(rae.el) * Math.cos(rae.az)) as Kilometers;
|
|
325
|
+
const u = (rae.rng * Math.sin(rae.el)) as Kilometers;
|
|
326
|
+
|
|
327
|
+
return { x: e, y: n, z: u };
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Converts South, East, and Zenith (SEZ) coordinates to Right Ascension, Elevation, and Range (RAE) coordinates.
|
|
332
|
+
* @param sez The SEZ coordinates.
|
|
333
|
+
* @returns Rng, Az, El array
|
|
334
|
+
*/
|
|
335
|
+
export function sez2rae<D extends number>(sez: SezVec3<D>): RaeVec3<D, Radians> {
|
|
336
|
+
const rng = <D>Math.sqrt(sez.s * sez.s + sez.e * sez.e + sez.z * sez.z);
|
|
337
|
+
const el = <Radians>Math.asin(sez.z / rng);
|
|
338
|
+
const az = <Radians>(Math.atan2(-sez.e, sez.s) + PI);
|
|
339
|
+
|
|
340
|
+
return { rng, az, el };
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Converts Earth-Centered Fixed (ECF) coordinates to Right Ascension (RA),
|
|
345
|
+
* Elevation (E), and Azimuth (A) coordinates.
|
|
346
|
+
* @param lla The Latitude, Longitude, and Altitude (LLA) coordinates.
|
|
347
|
+
* @param ecf The Earth-Centered Fixed (ECF) coordinates.
|
|
348
|
+
* @returns The Right Ascension (RA), Elevation (E), and Azimuth (A) coordinates.
|
|
349
|
+
*/
|
|
350
|
+
export function ecfRad2rae<D extends number>(lla: LlaVec3<Radians, D>, ecf: EcfVec3<D>): RaeVec3<D, Degrees> {
|
|
351
|
+
const sezCoords = lla2sez(lla, ecf);
|
|
352
|
+
const rae = sez2rae(sezCoords);
|
|
353
|
+
|
|
354
|
+
return { rng: rae.rng, az: (rae.az * RAD2DEG) as Degrees, el: (rae.el * RAD2DEG) as Degrees };
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Converts Earth-Centered Fixed (ECF) coordinates to Right Ascension (RA),
|
|
359
|
+
* Elevation (E), and Azimuth (A) coordinates.
|
|
360
|
+
* @variation cached - results are cached
|
|
361
|
+
* @param lla The Latitude, Longitude, and Altitude (LLA) coordinates.
|
|
362
|
+
* @param ecf The Earth-Centered Fixed (ECF) coordinates.
|
|
363
|
+
* @returns The Right Ascension (RA), Elevation (E), and Azimuth (A) coordinates.
|
|
364
|
+
*/
|
|
365
|
+
export function ecf2rae<D extends number>(lla: LlaVec3<Degrees, D>, ecf: EcfVec3<D>): RaeVec3<D, Degrees> {
|
|
366
|
+
const { lat, lon } = lla;
|
|
367
|
+
const latRad = (lat * DEG2RAD) as Radians;
|
|
368
|
+
const lonRad = (lon * DEG2RAD) as Radians;
|
|
369
|
+
const rae = ecfRad2rae({ lat: latRad, lon: lonRad, alt: lla.alt }, ecf);
|
|
370
|
+
|
|
371
|
+
return rae;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export const jday = (year?: number, mon?: number, day?: number, hr?: number, minute?: number, sec?: number) => {
|
|
375
|
+
if (typeof year === 'undefined') {
|
|
376
|
+
const now = new Date();
|
|
377
|
+
const jDayStart = new Date(now.getUTCFullYear(), 0, 0);
|
|
378
|
+
const jDayDiff = now.getDate() - jDayStart.getDate();
|
|
379
|
+
|
|
380
|
+
return Math.floor(jDayDiff / MILLISECONDS_TO_DAYS);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
if (
|
|
384
|
+
typeof mon === 'undefined' ||
|
|
385
|
+
typeof day === 'undefined' ||
|
|
386
|
+
typeof hr === 'undefined' ||
|
|
387
|
+
typeof minute === 'undefined' ||
|
|
388
|
+
typeof sec === 'undefined'
|
|
389
|
+
) {
|
|
390
|
+
throw new Error('Invalid date');
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
return (
|
|
394
|
+
367.0 * year -
|
|
395
|
+
Math.floor(7 * (year + Math.floor((mon + 9) / 12.0)) * 0.25) +
|
|
396
|
+
Math.floor((275 * mon) / 9.0) +
|
|
397
|
+
day +
|
|
398
|
+
1721013.5 +
|
|
399
|
+
((sec / 60.0 + minute) / 60.0 + hr) / 24.0
|
|
400
|
+
);
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Calculates the Greenwich Mean Sidereal Time (GMST) for a given date.
|
|
405
|
+
* @param date - The date for which to calculate the GMST.
|
|
406
|
+
* @returns An object containing the GMST value and the Julian date.
|
|
407
|
+
*/
|
|
408
|
+
export function calcGmst(date: Date): { gmst: GreenwichMeanSiderealTime; j: number } {
|
|
409
|
+
const j =
|
|
410
|
+
jday(
|
|
411
|
+
date.getUTCFullYear(),
|
|
412
|
+
date.getUTCMonth() + 1,
|
|
413
|
+
date.getUTCDate(),
|
|
414
|
+
date.getUTCHours(),
|
|
415
|
+
date.getUTCMinutes(),
|
|
416
|
+
date.getUTCSeconds(),
|
|
417
|
+
) +
|
|
418
|
+
date.getUTCMilliseconds() * MILLISECONDS_TO_DAYS;
|
|
419
|
+
|
|
420
|
+
const gmst = Sgp4.gstime(j);
|
|
421
|
+
|
|
422
|
+
return { gmst, j };
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Converts ECI coordinates to RAE (Right Ascension, Azimuth, Elevation) coordinates.
|
|
427
|
+
* @variation cached - results are cached
|
|
428
|
+
* @param now - Current date and time.
|
|
429
|
+
* @param eci - ECI coordinates of the satellite.
|
|
430
|
+
* @param sensor - Sensor object containing observer's geodetic coordinates.
|
|
431
|
+
* @returns Object containing azimuth, elevation and range in degrees and kilometers respectively.
|
|
432
|
+
*/
|
|
433
|
+
export function eci2rae(now: Date, eci: EciVec3<Kilometers>, sensor: Sensor): RaeVec3<Kilometers, Degrees> {
|
|
434
|
+
now = new Date(now);
|
|
435
|
+
const { gmst } = calcGmst(now);
|
|
436
|
+
|
|
437
|
+
const positionEcf = eci2ecf(eci, gmst);
|
|
438
|
+
const lla = {
|
|
439
|
+
lat: (sensor.lat * DEG2RAD) as Radians,
|
|
440
|
+
lon: (sensor.lon * DEG2RAD) as Radians,
|
|
441
|
+
alt: sensor.alt,
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
const rae = ecfRad2rae(lla, positionEcf);
|
|
445
|
+
|
|
446
|
+
return rae;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* Calculates the inertial azimuth of a satellite given its latitude and inclination.
|
|
451
|
+
* @param lat - The latitude of the satellite in degrees.
|
|
452
|
+
* @param inc - The inclination of the satellite in degrees.
|
|
453
|
+
* @returns The inertial azimuth of the satellite in degrees.
|
|
454
|
+
*/
|
|
455
|
+
export function calcInertAz(lat: Degrees, inc: Degrees): Degrees {
|
|
456
|
+
const phi = lat * DEG2RAD;
|
|
457
|
+
const i = inc * DEG2RAD;
|
|
458
|
+
|
|
459
|
+
const az = Math.asin(Math.cos(i) / Math.cos(phi));
|
|
460
|
+
|
|
461
|
+
return <Degrees>(az * RAD2DEG);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Calculates the inclination angle of a satellite from its launch azimuth and latitude.
|
|
466
|
+
* @param lat - The latitude of the observer in degrees.
|
|
467
|
+
* @param az - The launch azimuth angle of the satellite in degrees clockwise from north.
|
|
468
|
+
* @returns The inclination angle of the satellite in degrees.
|
|
469
|
+
*/
|
|
470
|
+
export function calcIncFromAz(lat: number, az: number): number {
|
|
471
|
+
const phi = lat * DEG2RAD;
|
|
472
|
+
const beta = az * DEG2RAD;
|
|
473
|
+
|
|
474
|
+
const inc = Math.acos(Math.sin(beta) * Math.cos(phi));
|
|
475
|
+
|
|
476
|
+
return <Degrees>(inc * RAD2DEG);
|
|
477
|
+
}
|
|
478
|
+
|
|
3
479
|
|
|
4
480
|
/**
|
|
5
481
|
* Converts Azimuth and Elevation to U and V.
|