ootk 4.0.9 → 5.1.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 +301 -0
- package/dist/body/Sun.js +544 -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 +2 -2
- package/dist/coordinate/Hill.js +2 -2
- package/dist/coordinate/Hill.js.map +1 -1
- package/dist/coordinate/ITRF.d.ts +75 -0
- package/dist/coordinate/ITRF.js +134 -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 +429 -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 +11 -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 +9 -6
- package/dist/covariance/CovarianceSample.js +92 -18
- package/dist/covariance/CovarianceSample.js.map +1 -1
- package/dist/covariance/StateCovariance.d.ts +2 -2
- package/dist/covariance/StateCovariance.js +2 -2
- package/dist/covariance/StateCovariance.js.map +1 -1
- package/dist/covariance/index.d.ts +2 -0
- package/dist/covariance/index.js +3 -0
- package/dist/covariance/index.js.map +1 -0
- 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 +2 -2
- package/dist/force/AtmosphericDrag.js +3 -6
- package/dist/force/AtmosphericDrag.js.map +1 -1
- package/dist/force/EarthGravity.d.ts +2 -2
- package/dist/force/EarthGravity.js +2 -2
- package/dist/force/EarthGravity.js.map +1 -1
- package/dist/force/Force.d.ts +2 -2
- package/dist/force/Force.js +1 -1
- package/dist/force/ForceModel.d.ts +2 -2
- package/dist/force/ForceModel.js +2 -2
- package/dist/force/ForceModel.js.map +1 -1
- package/dist/force/Gravity.d.ts +2 -2
- package/dist/force/Gravity.js +2 -2
- package/dist/force/Gravity.js.map +1 -1
- package/dist/force/SolarRadiationPressure.d.ts +2 -2
- package/dist/force/SolarRadiationPressure.js +2 -2
- package/dist/force/SolarRadiationPressure.js.map +1 -1
- package/dist/force/ThirdBodyGravity.d.ts +2 -2
- package/dist/force/ThirdBodyGravity.js +2 -2
- package/dist/force/ThirdBodyGravity.js.map +1 -1
- package/dist/force/Thrust.d.ts +2 -2
- package/dist/force/Thrust.js +2 -2
- 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 +5 -5
- package/dist/interpolator/ChebyshevCoefficients.js +2 -2
- package/dist/interpolator/ChebyshevCoefficients.js.map +1 -1
- package/dist/interpolator/ChebyshevInterpolator.d.ts +3 -3
- package/dist/interpolator/ChebyshevInterpolator.js +9 -9
- package/dist/interpolator/ChebyshevInterpolator.js.map +1 -1
- package/dist/interpolator/CubicSpline.d.ts +2 -2
- package/dist/interpolator/CubicSpline.js +1 -1
- package/dist/interpolator/CubicSplineInterpolator.d.ts +4 -4
- package/dist/interpolator/CubicSplineInterpolator.js +10 -10
- package/dist/interpolator/CubicSplineInterpolator.js.map +1 -1
- package/dist/interpolator/FieldInterpolator.d.ts +1 -1
- package/dist/interpolator/FieldInterpolator.js +1 -1
- package/dist/interpolator/Interpolator.d.ts +2 -2
- package/dist/interpolator/Interpolator.js +2 -2
- package/dist/interpolator/Interpolator.js.map +1 -1
- package/dist/interpolator/LagrangeInterpolator.d.ts +7 -7
- package/dist/interpolator/LagrangeInterpolator.js +2 -2
- package/dist/interpolator/LagrangeInterpolator.js.map +1 -1
- package/dist/interpolator/StateInterpolator.d.ts +2 -2
- package/dist/interpolator/StateInterpolator.js +1 -1
- package/dist/interpolator/VerletBlendInterpolator.d.ts +2 -2
- package/dist/interpolator/VerletBlendInterpolator.js +2 -2
- package/dist/interpolator/VerletBlendInterpolator.js.map +1 -1
- package/dist/main.d.ts +15 -5
- package/dist/main.js +15 -5
- package/dist/main.js.map +1 -1
- package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +2 -2
- package/dist/maneuver/TwoBurnOrbitTransfer.js +2 -2
- package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -1
- package/dist/maneuver/Waypoint.d.ts +2 -2
- package/dist/maneuver/Waypoint.js +2 -2
- 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 -2
- package/dist/objects/DetailedSatellite.js +6 -4
- package/dist/objects/DetailedSatellite.js.map +1 -1
- package/dist/objects/DetailedSensor.d.ts +3 -2
- package/dist/objects/DetailedSensor.js +2 -2
- 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 +3 -2
- package/dist/objects/LandObject.js +2 -2
- package/dist/objects/LandObject.js.map +1 -1
- package/dist/objects/Marker.d.ts +2 -2
- package/dist/objects/Marker.js +2 -2
- package/dist/objects/Marker.js.map +1 -1
- package/dist/objects/RfSensor.d.ts +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 +99 -0
- package/dist/objects/Sensor.js +238 -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 +2 -2
- package/dist/observation/Observation.js +1 -1
- package/dist/observation/ObservationOptical.d.ts +6 -6
- package/dist/observation/ObservationOptical.js +9 -9
- package/dist/observation/ObservationOptical.js.map +1 -1
- package/dist/observation/ObservationRadar.d.ts +6 -6
- package/dist/observation/ObservationRadar.js +9 -9
- package/dist/observation/ObservationRadar.js.map +1 -1
- package/dist/observation/ObservationUtils.d.ts +4 -2
- package/dist/observation/ObservationUtils.js +16 -2
- package/dist/observation/ObservationUtils.js.map +1 -1
- package/dist/observation/PropagatorPairs.d.ts +4 -4
- package/dist/observation/PropagatorPairs.js +7 -7
- package/dist/observation/PropagatorPairs.js.map +1 -1
- package/dist/observation/RAE.d.ts +111 -0
- package/dist/observation/RAE.js +214 -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 +2 -2
- package/dist/operations/BoxMuller.js +2 -2
- package/dist/operations/BoxMuller.js.map +1 -1
- package/dist/operations/EulerAngles.d.ts +2 -2
- package/dist/operations/EulerAngles.js +2 -2
- package/dist/operations/EulerAngles.js.map +1 -1
- package/dist/operations/Matrix.d.ts +170 -0
- package/dist/operations/Matrix.js +405 -0
- package/dist/operations/Matrix.js.map +1 -0
- package/dist/operations/Quaternion.d.ts +7 -7
- package/dist/operations/Quaternion.js +2 -2
- 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 +3 -3
- package/dist/operations/RandomGaussianSource.js +5 -5
- 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.d.ts +3 -3
- package/dist/optimize/ChebyshevCompressor.js +8 -8
- package/dist/optimize/ChebyshevCompressor.js.map +1 -1
- package/dist/optimize/DownhillSimplex.d.ts +1 -1
- package/dist/optimize/DownhillSimplex.js +1 -1
- package/dist/optimize/GoldenSection.d.ts +2 -2
- package/dist/optimize/GoldenSection.js +3 -3
- package/dist/optimize/PolynomialRegression.d.ts +1 -1
- package/dist/optimize/PolynomialRegression.js +2 -2
- package/dist/optimize/PolynomialRegression.js.map +1 -1
- package/dist/optimize/PolynomicalRegressionResult.d.ts +1 -1
- package/dist/optimize/PolynomicalRegressionResult.js +1 -1
- package/dist/optimize/SimpleLinearRegression.d.ts +1 -1
- package/dist/optimize/SimpleLinearRegression.js +1 -1
- package/dist/optimize/SimplexEntry.d.ts +4 -4
- package/dist/optimize/SimplexEntry.js +11 -11
- package/dist/optimize/SimplexEntry.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +11 -11
- package/dist/orbit_determination/BatchLeastSquaresOD.js +2 -2
- package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -1
- package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +2 -2
- package/dist/orbit_determination/BatchLeastSquaresResult.js +1 -1
- package/dist/orbit_determination/GibbsIOD.d.ts +2 -2
- package/dist/orbit_determination/GibbsIOD.js +2 -2
- package/dist/orbit_determination/GibbsIOD.js.map +1 -1
- package/dist/orbit_determination/GoodingIOD.d.ts +2 -2
- package/dist/orbit_determination/GoodingIOD.js +2 -2
- package/dist/orbit_determination/GoodingIOD.js.map +1 -1
- package/dist/orbit_determination/HerrickGibbsIOD.d.ts +2 -2
- package/dist/orbit_determination/HerrickGibbsIOD.js +2 -2
- package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -1
- package/dist/orbit_determination/LambertIOD.d.ts +2 -2
- package/dist/orbit_determination/LambertIOD.js +2 -2
- package/dist/orbit_determination/LambertIOD.js.map +1 -1
- package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +4 -4
- package/dist/orbit_determination/ModifiedGoodingIOD.js +2 -2
- 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/DormandPrince54Propagator.d.ts +5 -5
- package/dist/propagator/DormandPrince54Propagator.js +9 -9
- package/dist/propagator/DormandPrince54Propagator.js.map +1 -1
- package/dist/propagator/KeplerPropagator.d.ts +6 -6
- package/dist/propagator/KeplerPropagator.js +31 -31
- package/dist/propagator/KeplerPropagator.js.map +1 -1
- package/dist/propagator/Propagator.d.ts +2 -2
- package/dist/propagator/Propagator.js +2 -2
- package/dist/propagator/Propagator.js.map +1 -1
- package/dist/propagator/RkCheckpoint.d.ts +2 -2
- package/dist/propagator/RkCheckpoint.js +1 -1
- package/dist/propagator/RkResult.d.ts +2 -2
- package/dist/propagator/RkResult.js +1 -1
- package/dist/propagator/RungeKutta4Propagator.d.ts +3 -3
- package/dist/propagator/RungeKutta4Propagator.js +2 -2
- package/dist/propagator/RungeKutta4Propagator.js.map +1 -1
- package/dist/propagator/RungeKutta89Propagator.d.ts +5 -5
- package/dist/propagator/RungeKutta89Propagator.js +1 -1
- package/dist/propagator/RungeKutta89Propagator.js.map +1 -1
- package/dist/propagator/RungeKuttaAdaptive.d.ts +4 -4
- package/dist/propagator/RungeKuttaAdaptive.js +2 -2
- package/dist/propagator/RungeKuttaAdaptive.js.map +1 -1
- package/dist/propagator/Sgp4Propagator.d.ts +6 -6
- package/dist/propagator/Sgp4Propagator.js +15 -15
- package/dist/propagator/Sgp4Propagator.js.map +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 +99 -0
- package/dist/sgp4/sgp4.js +3164 -0
- package/dist/sgp4/sgp4.js.map +1 -0
- package/dist/smoothing/ExponentialSmoothing.d.ts +2 -2
- package/dist/smoothing/ExponentialSmoothing.js +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 +39 -0
- package/dist/time/TimeStamped.js +42 -0
- package/dist/time/TimeStamped.js.map +1 -0
- package/dist/time/index.d.ts +8 -0
- package/dist/time/index.js +9 -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 +675 -3
- package/dist/types/types.js +37 -1
- 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/create-covariance-from-tle.d.ts +18 -0
- package/dist/utils/create-covariance-from-tle.js +57 -0
- package/dist/utils/create-covariance-from-tle.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 +4 -1
- package/dist/utils/index.js +4 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/jacobian.d.ts +7 -1
- package/dist/utils/jacobian.js +7 -2
- 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 +5 -8
- 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 +665 -0
- package/src/body/index.ts +27 -0
- package/src/body/suncalc.LICENSE.md +18 -0
- package/src/coordinate/ClassicalElements.ts +327 -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 +2 -2
- 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 +123 -0
- package/src/coordinate/TEME.ts +97 -0
- package/src/coordinate/Tle.ts +1024 -0
- package/src/coordinate/index.ts +11 -0
- package/src/coordinate/tle-format-data.ts +47 -0
- package/src/covariance/CovarianceSample.ts +117 -19
- package/src/covariance/StateCovariance.ts +2 -2
- package/src/covariance/index.ts +2 -0
- 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 +2 -4
- package/src/force/EarthGravity.ts +2 -2
- package/src/force/Force.ts +2 -2
- package/src/force/ForceModel.ts +2 -2
- package/src/force/Gravity.ts +2 -2
- package/src/force/SolarRadiationPressure.ts +2 -2
- package/src/force/ThirdBodyGravity.ts +2 -2
- package/src/force/Thrust.ts +2 -2
- 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 +5 -5
- package/src/interpolator/ChebyshevInterpolator.ts +10 -10
- package/src/interpolator/CubicSpline.ts +2 -2
- package/src/interpolator/CubicSplineInterpolator.ts +8 -8
- package/src/interpolator/FieldInterpolator.ts +1 -1
- package/src/interpolator/Interpolator.ts +2 -2
- package/src/interpolator/LagrangeInterpolator.ts +7 -7
- package/src/interpolator/StateInterpolator.ts +2 -2
- package/src/interpolator/VerletBlendInterpolator.ts +2 -2
- package/src/main.ts +15 -5
- package/src/maneuver/TwoBurnOrbitTransfer.ts +2 -2
- package/src/maneuver/Waypoint.ts +2 -2
- package/src/objects/BaseObject.ts +171 -0
- package/src/objects/DetailedSatellite.ts +5 -4
- package/src/objects/DetailedSensor.ts +3 -2
- package/src/objects/GroundObject.ts +176 -0
- package/src/objects/LandObject.ts +3 -2
- package/src/objects/Marker.ts +2 -2
- package/src/objects/RfSensor.ts +1 -2
- package/src/objects/Satellite.ts +552 -0
- package/src/objects/Sensor.ts +279 -0
- package/src/objects/Star.ts +96 -0
- package/src/objects/index.ts +5 -0
- package/src/observation/Observation.ts +2 -2
- package/src/observation/ObservationOptical.ts +7 -7
- package/src/observation/ObservationRadar.ts +10 -6
- package/src/observation/ObservationUtils.ts +31 -2
- package/src/observation/PropagatorPairs.ts +3 -3
- package/src/observation/RAE.ts +261 -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 +2 -2
- package/src/operations/EulerAngles.ts +2 -2
- package/src/operations/Matrix.ts +473 -0
- package/src/operations/Quaternion.ts +7 -7
- package/src/operations/Random.ts +54 -0
- package/src/operations/RandomGaussianSource.ts +5 -5
- 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 +6 -6
- package/src/optimize/DownhillSimplex.ts +1 -1
- package/src/optimize/GoldenSection.ts +3 -3
- package/src/optimize/PolynomialRegression.ts +2 -2
- package/src/optimize/PolynomicalRegressionResult.ts +1 -1
- package/src/optimize/SimpleLinearRegression.ts +1 -1
- package/src/optimize/SimplexEntry.ts +9 -9
- package/src/orbit_determination/BatchLeastSquaresOD.ts +11 -11
- package/src/orbit_determination/BatchLeastSquaresResult.ts +2 -2
- package/src/orbit_determination/GibbsIOD.ts +4 -2
- package/src/orbit_determination/GoodingIOD.ts +2 -2
- package/src/orbit_determination/HerrickGibbsIOD.ts +2 -2
- package/src/orbit_determination/LambertIOD.ts +2 -2
- package/src/orbit_determination/ModifiedGoodingIOD.ts +4 -4
- package/src/orbit_determination/index.ts +7 -0
- package/src/propagator/DormandPrince54Propagator.ts +9 -9
- package/src/propagator/KeplerPropagator.ts +31 -31
- package/src/propagator/Propagator.ts +2 -2
- package/src/propagator/RkCheckpoint.ts +2 -2
- package/src/propagator/RkResult.ts +2 -2
- package/src/propagator/RungeKutta4Propagator.ts +3 -3
- package/src/propagator/RungeKutta89Propagator.ts +5 -5
- package/src/propagator/RungeKuttaAdaptive.ts +4 -4
- package/src/propagator/Sgp4Propagator.ts +14 -14
- 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 +3983 -0
- package/src/smoothing/ExponentialSmoothing.ts +2 -2
- 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 +46 -0
- package/src/time/index.ts +8 -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 +722 -3
- package/src/utils/constants.ts +113 -0
- package/src/utils/create-covariance-from-tle.ts +75 -0
- package/src/utils/functions.ts +562 -0
- package/src/utils/index.ts +4 -1
- package/src/utils/jacobian.ts +7 -3
- package/src/utils/linearDistance.ts +11 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
|
|
4
|
+
* with satellites and other orbital objects.
|
|
5
|
+
* @license AGPL-3.0-or-later
|
|
6
|
+
* @copyright (c) 2025 Kruczek Labs LLC
|
|
7
|
+
*
|
|
8
|
+
* Many of the classes are based off of the work of @david-rc-dayton and his
|
|
9
|
+
* Pious Squid library (https://github.com/david-rc-dayton/pious_squid) which
|
|
10
|
+
* is licensed under the MIT license.
|
|
11
|
+
*
|
|
12
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
13
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
14
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
17
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
18
|
+
* See the GNU Affero General Public License for more details.
|
|
19
|
+
*
|
|
20
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
21
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
|
+
*/
|
|
23
|
+
import { Vector3D, Matrix } from '../main.js';
|
|
24
|
+
/**
|
|
25
|
+
* A Vector is a mathematical object that has both magnitude and direction.
|
|
26
|
+
*/
|
|
27
|
+
export class Vector {
|
|
28
|
+
elements;
|
|
29
|
+
/**
|
|
30
|
+
* The length of the vector.
|
|
31
|
+
*/
|
|
32
|
+
length;
|
|
33
|
+
/**
|
|
34
|
+
* Represents a 3-dimensional vector.
|
|
35
|
+
*/
|
|
36
|
+
static origin3 = new Vector([0, 0, 0]);
|
|
37
|
+
/**
|
|
38
|
+
* Represents a vector with all elements set to zero.
|
|
39
|
+
*/
|
|
40
|
+
static origin6 = new Vector([0, 0, 0, 0, 0, 0]);
|
|
41
|
+
/**
|
|
42
|
+
* Represents the x-axis vector.
|
|
43
|
+
*/
|
|
44
|
+
static xAxis = new Vector([1, 0, 0]);
|
|
45
|
+
/**
|
|
46
|
+
* Represents the y-axis vector.
|
|
47
|
+
*/
|
|
48
|
+
static yAxis = new Vector([0, 1, 0]);
|
|
49
|
+
/**
|
|
50
|
+
* Represents the z-axis vector.
|
|
51
|
+
*/
|
|
52
|
+
static zAxis = new Vector([0, 0, 1]);
|
|
53
|
+
/**
|
|
54
|
+
* Represents a vector pointing along the negative x-axis.
|
|
55
|
+
*/
|
|
56
|
+
static xAxisNeg = new Vector([-1, 0, 0]);
|
|
57
|
+
/**
|
|
58
|
+
* Represents a vector pointing along the negative y-axis.
|
|
59
|
+
*/
|
|
60
|
+
static yAxisNeg = new Vector([0, -1, 0]);
|
|
61
|
+
/**
|
|
62
|
+
* Represents a vector pointing along the negative z-axis.
|
|
63
|
+
*/
|
|
64
|
+
static zAxisNeg = new Vector([0, 0, -1]);
|
|
65
|
+
constructor(elements) {
|
|
66
|
+
this.elements = elements;
|
|
67
|
+
this.length = elements.length;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a zero vector of the specified length.
|
|
71
|
+
* @param length The length of the vector.
|
|
72
|
+
* @returns A new Vector object representing the zero vector.
|
|
73
|
+
*/
|
|
74
|
+
static zero(length) {
|
|
75
|
+
return new Vector(new Array(length).fill(0));
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Creates a new Vector with the specified length, filled with the specified
|
|
79
|
+
* value.
|
|
80
|
+
* @param length The length of the new Vector.
|
|
81
|
+
* @param value The value to fill the Vector with.
|
|
82
|
+
* @returns A new Vector filled with the specified value.
|
|
83
|
+
*/
|
|
84
|
+
static filled(length, value) {
|
|
85
|
+
return new Vector(new Array(length).fill(value));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Creates a new Vector instance from an array of elements.
|
|
89
|
+
* @param elements - The array of elements to create the Vector from.
|
|
90
|
+
* @returns A new Vector instance.
|
|
91
|
+
*/
|
|
92
|
+
static fromList(elements) {
|
|
93
|
+
return new Vector(elements);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Returns a string representation of the vector.
|
|
97
|
+
* @param fixed - The number of digits to appear after the decimal point.
|
|
98
|
+
* Defaults to -1.
|
|
99
|
+
* @returns A string representation of the vector.
|
|
100
|
+
*/
|
|
101
|
+
toString(fixed = -1) {
|
|
102
|
+
if (fixed < 0) {
|
|
103
|
+
return `[${this.elements.join(', ')}]`;
|
|
104
|
+
}
|
|
105
|
+
const output = this.elements.map((e) => e.toFixed(fixed));
|
|
106
|
+
return `[${output.join(', ')}]`;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Returns a string representation of the x value of the vector.
|
|
110
|
+
* @returns A string representation of the x value of the vector.
|
|
111
|
+
*/
|
|
112
|
+
get x() {
|
|
113
|
+
return this.elements[0];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Returns a string representation of the y value of the vector.
|
|
117
|
+
* @returns A string representation of the y value of the vector.
|
|
118
|
+
*/
|
|
119
|
+
get y() {
|
|
120
|
+
return this.elements[1];
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Returns a string representation of the z value of the vector.
|
|
124
|
+
* @returns A string representation of the z value of the vector.
|
|
125
|
+
*/
|
|
126
|
+
get z() {
|
|
127
|
+
return this.elements[2];
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Converts the vector elements to an array.
|
|
131
|
+
* @returns An array containing the vector elements.
|
|
132
|
+
*/
|
|
133
|
+
toList() {
|
|
134
|
+
return Array.from(this.elements);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Converts the vector to a Float64Array.
|
|
138
|
+
* @returns The vector as a Float64Array.
|
|
139
|
+
*/
|
|
140
|
+
toArray() {
|
|
141
|
+
return new Float64Array(this.elements);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Calculates the magnitude of the vector.
|
|
145
|
+
* @returns The magnitude of the vector.
|
|
146
|
+
*/
|
|
147
|
+
magnitude() {
|
|
148
|
+
let total = 0;
|
|
149
|
+
for (const x of this.elements) {
|
|
150
|
+
total += x * x;
|
|
151
|
+
}
|
|
152
|
+
return Math.sqrt(total);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Adds the elements of another vector to this vector and returns a new
|
|
156
|
+
* vector.
|
|
157
|
+
* @param v - The vector to add.
|
|
158
|
+
* @returns A new vector containing the sum of the elements.
|
|
159
|
+
*/
|
|
160
|
+
add(v) {
|
|
161
|
+
const output = new Array(this.length);
|
|
162
|
+
for (let i = 0; i < this.length; i++) {
|
|
163
|
+
output[i] = this.elements[i] + (v.elements[i]);
|
|
164
|
+
}
|
|
165
|
+
return new Vector(output);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Subtracts a vector from the current vector.
|
|
169
|
+
* @param v The vector to subtract.
|
|
170
|
+
* @returns A new vector representing the result of the subtraction.
|
|
171
|
+
*/
|
|
172
|
+
subtract(v) {
|
|
173
|
+
const output = new Array(this.length);
|
|
174
|
+
for (let i = 0; i < this.length; i++) {
|
|
175
|
+
output[i] = this.elements[i] - (v.elements[i]);
|
|
176
|
+
}
|
|
177
|
+
return new Vector(output);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Scales the vector by a given factor.
|
|
181
|
+
* @param n The scaling factor.
|
|
182
|
+
* @returns A new Vector object representing the scaled vector.
|
|
183
|
+
*/
|
|
184
|
+
scale(n) {
|
|
185
|
+
const output = new Array(this.length);
|
|
186
|
+
for (let i = 0; i < this.length; i++) {
|
|
187
|
+
output[i] = this.elements[i] * n;
|
|
188
|
+
}
|
|
189
|
+
return new Vector(output);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Negates the vector by scaling it by -1.
|
|
193
|
+
* @returns A new Vector object representing the negated vector.
|
|
194
|
+
*/
|
|
195
|
+
negate() {
|
|
196
|
+
return this.scale(-1);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Return the Euclidean distance between this and another Vector.
|
|
200
|
+
* @param v The vector to calculate the distance to.
|
|
201
|
+
* @returns The distance between the two vectors.
|
|
202
|
+
*/
|
|
203
|
+
distance(v) {
|
|
204
|
+
return this.subtract(v).magnitude();
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Normalizes the vector, making it a unit vector with the same direction but
|
|
208
|
+
* a magnitude of 1. If the vector has a magnitude of 0, it returns a zero
|
|
209
|
+
* vector of the same length.
|
|
210
|
+
* @returns The normalized vector.
|
|
211
|
+
*/
|
|
212
|
+
normalize() {
|
|
213
|
+
const m = this.magnitude();
|
|
214
|
+
if (m === 0) {
|
|
215
|
+
return Vector.zero(this.length);
|
|
216
|
+
}
|
|
217
|
+
return this.scale(1.0 / m);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Calculates the dot product of this vector and another vector.
|
|
221
|
+
* @param v - The vector to calculate the dot product with.
|
|
222
|
+
* @returns The dot product of the two vectors.
|
|
223
|
+
*/
|
|
224
|
+
dot(v) {
|
|
225
|
+
let total = 0;
|
|
226
|
+
for (let i = 0; i < this.length; i++) {
|
|
227
|
+
total += this.elements[i] * (v.elements[i]);
|
|
228
|
+
}
|
|
229
|
+
return total;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Calculates the outer product of this vector with another vector.
|
|
233
|
+
* @param v The vector to calculate the outer product with.
|
|
234
|
+
* @returns A matrix representing the outer product of the two vectors.
|
|
235
|
+
*/
|
|
236
|
+
outer(v) {
|
|
237
|
+
const result = [];
|
|
238
|
+
for (let i = 0; i < this.length; i++) {
|
|
239
|
+
result[i] = [];
|
|
240
|
+
for (let j = 0; j < v.length; j++) {
|
|
241
|
+
(result[i])[j] = this.elements[i] * (v.elements[j]);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return new Matrix(result);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Calculates the cross product of this vector and the given vector.
|
|
248
|
+
* @param v - The vector to calculate the cross product with.
|
|
249
|
+
* @returns The resulting vector.
|
|
250
|
+
*/
|
|
251
|
+
cross(v) {
|
|
252
|
+
const output = new Array(this.length);
|
|
253
|
+
for (let i = 0; i < this.length; i++) {
|
|
254
|
+
output[i] =
|
|
255
|
+
this.elements[(i + 1) % this.length] * (v.elements[(i + 2) % this.length]) -
|
|
256
|
+
this.elements[(i + 2) % this.length] * (v.elements[(i + 1) % this.length]);
|
|
257
|
+
}
|
|
258
|
+
return new Vector(output);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Calculate the skew-symmetric matrix for this [Vector].
|
|
262
|
+
* @returns The skew-symmetric matrix.
|
|
263
|
+
* @throws [Error] if the vector is not of length 3.
|
|
264
|
+
*/
|
|
265
|
+
skewSymmetric() {
|
|
266
|
+
if (this.length !== 3) {
|
|
267
|
+
throw new Error('Skew-symmetric matrix requires a vector of length 3.');
|
|
268
|
+
}
|
|
269
|
+
return new Matrix([
|
|
270
|
+
[0, -this.elements[2], this.elements[1]],
|
|
271
|
+
[this.elements[2], 0, -this.elements[0]],
|
|
272
|
+
[-this.elements[1], this.elements[0], 0],
|
|
273
|
+
]);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Rotates the vector around the X-axis by the specified angle.
|
|
277
|
+
* @param theta The angle in radians.
|
|
278
|
+
* @returns The rotated vector.
|
|
279
|
+
*/
|
|
280
|
+
rotX(theta) {
|
|
281
|
+
const cosT = Math.cos(theta);
|
|
282
|
+
const sinT = Math.sin(theta);
|
|
283
|
+
const output = new Array(3);
|
|
284
|
+
output[0] = this.elements[0];
|
|
285
|
+
output[1] = cosT * this.elements[1] + sinT * this.elements[2];
|
|
286
|
+
output[2] = -sinT * this.elements[1] + cosT * this.elements[2];
|
|
287
|
+
return new Vector(output);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* Rotates the vector around the Y-axis by the specified angle.
|
|
291
|
+
* @param theta The angle of rotation in radians.
|
|
292
|
+
* @returns A new Vector representing the rotated vector.
|
|
293
|
+
*/
|
|
294
|
+
rotY(theta) {
|
|
295
|
+
const cosT = Math.cos(theta);
|
|
296
|
+
const sinT = Math.sin(theta);
|
|
297
|
+
const output = new Array(3);
|
|
298
|
+
output[0] = cosT * this.elements[0] + -sinT * this.elements[2];
|
|
299
|
+
output[1] = this.elements[1];
|
|
300
|
+
output[2] = sinT * this.elements[0] + cosT * this.elements[2];
|
|
301
|
+
return new Vector(output);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Rotates the vector around the Z-axis by the specified angle.
|
|
305
|
+
* @param theta The angle of rotation in radians.
|
|
306
|
+
* @returns A new Vector representing the rotated vector.
|
|
307
|
+
*/
|
|
308
|
+
rotZ(theta) {
|
|
309
|
+
const cosT = Math.cos(theta);
|
|
310
|
+
const sinT = Math.sin(theta);
|
|
311
|
+
const output = new Array(3);
|
|
312
|
+
output[0] = cosT * this.elements[0] + sinT * this.elements[1];
|
|
313
|
+
output[1] = -sinT * this.elements[0] + cosT * this.elements[1];
|
|
314
|
+
output[2] = this.elements[2];
|
|
315
|
+
return new Vector(output);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Calculates the angle between this vector and another vector.
|
|
319
|
+
* @param v The other vector.
|
|
320
|
+
* @returns The angle between the two vectors in radians.
|
|
321
|
+
*/
|
|
322
|
+
angle(v) {
|
|
323
|
+
// better than acos for small angles
|
|
324
|
+
const theta = Math.atan2(this.cross(v).magnitude(), this.dot(v));
|
|
325
|
+
if (isNaN(theta)) {
|
|
326
|
+
return 0.0;
|
|
327
|
+
}
|
|
328
|
+
return theta;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Calculates the angle between this vector and another vector in degrees.
|
|
332
|
+
* @param v The other vector.
|
|
333
|
+
* @returns The angle between the two vectors in degrees.
|
|
334
|
+
*/
|
|
335
|
+
angleDegrees(v) {
|
|
336
|
+
return (this.angle(v) * (180 / Math.PI));
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Determines if there is line of sight between this vector and another vector
|
|
340
|
+
* within a given radius.
|
|
341
|
+
* @param v - The vector to check line of sight with.
|
|
342
|
+
* @param radius - The radius within which line of sight is considered.
|
|
343
|
+
* @returns True if there is line of sight, false otherwise.
|
|
344
|
+
*/
|
|
345
|
+
sight(v, radius) {
|
|
346
|
+
const r1Mag2 = this.magnitude() ** 2;
|
|
347
|
+
const r2Mag2 = v.magnitude() ** 2;
|
|
348
|
+
const rDot = this.dot(v);
|
|
349
|
+
const tMin = (r1Mag2 - rDot) / (r1Mag2 + r2Mag2 - 2.0 * rDot);
|
|
350
|
+
let los = false;
|
|
351
|
+
if (tMin < 0 || tMin > 1) {
|
|
352
|
+
los = true;
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
const c = (1.0 - tMin) * r1Mag2 + rDot * tMin;
|
|
356
|
+
if (c >= radius * radius) {
|
|
357
|
+
los = true;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
return los;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Returns the bisect vector between this vector and the given vector. The
|
|
364
|
+
* bisect vector is calculated by scaling this vector's magnitude by the
|
|
365
|
+
* magnitude of the given vector, adding the result to the product of scaling
|
|
366
|
+
* the given vector's magnitude by this vector's magnitude, and then
|
|
367
|
+
* normalizing the resulting vector.
|
|
368
|
+
* @param v - The vector to calculate the bisect with.
|
|
369
|
+
* @returns The bisect vector.
|
|
370
|
+
*/
|
|
371
|
+
bisect(v) {
|
|
372
|
+
return this.scale(v.magnitude()).add(v.scale(this.magnitude())).normalize();
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Joins the current vector with another vector.
|
|
376
|
+
* @param v The vector to join with.
|
|
377
|
+
* @returns A new vector that contains the elements of both vectors.
|
|
378
|
+
*/
|
|
379
|
+
join(v) {
|
|
380
|
+
return new Vector(this.toList().concat(v.toList()));
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Returns a new Vector containing a portion of the elements from the
|
|
384
|
+
* specified start index to the specified end index
|
|
385
|
+
* @param start The start index of the slice (inclusive).
|
|
386
|
+
* @param end The end index of the slice (exclusive).
|
|
387
|
+
* @returns A new Vector containing the sliced elements.
|
|
388
|
+
*/
|
|
389
|
+
slice(start, end) {
|
|
390
|
+
return new Vector(this.elements.slice(start, end));
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Returns a new Matrix object representing the row vector.
|
|
394
|
+
* @returns The row vector as a Matrix object.
|
|
395
|
+
*/
|
|
396
|
+
row() {
|
|
397
|
+
return new Matrix([this.toList()]);
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Returns a new Matrix object representing the column vector of this Vector.
|
|
401
|
+
* @returns The column vector as a Matrix object.
|
|
402
|
+
*/
|
|
403
|
+
column() {
|
|
404
|
+
return new Matrix(this.toList().map((e) => [e]));
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Converts the elements at the specified index to a Vector3D object.
|
|
408
|
+
* @param index - The index of the elements to convert.
|
|
409
|
+
* @returns A new Vector3D object containing the converted elements.
|
|
410
|
+
*/
|
|
411
|
+
toVector3D(index) {
|
|
412
|
+
return new Vector3D(this.elements[index], this.elements[index + 1], this.elements[index + 2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,CAAC,KAAa;QACtB,OAAO,IAAI,QAAQ,CAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAY,EAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAY,EACvF,IAAI,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAY,CAAC,CAAC;IAC1C,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author @thkruz Theodore Kruczek
|
|
3
|
+
* @description Orbital Object ToolKit (ootk) is a collection of tools for working
|
|
4
|
+
* with satellites and other orbital objects.
|
|
5
|
+
* @license AGPL-3.0-or-later
|
|
6
|
+
* @copyright (c) 2025 Kruczek Labs LLC
|
|
7
|
+
*
|
|
8
|
+
* Many of the classes are based off of the work of @david-rc-dayton and his
|
|
9
|
+
* Pious Squid library (https://github.com/david-rc-dayton/pious_squid) which
|
|
10
|
+
* is licensed under the MIT license.
|
|
11
|
+
*
|
|
12
|
+
* Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
|
|
13
|
+
* terms of the GNU Affero General Public License as published by the Free Software
|
|
14
|
+
* Foundation, either version 3 of the License, or (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
17
|
+
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
18
|
+
* See the GNU Affero General Public License for more details.
|
|
19
|
+
*
|
|
20
|
+
* You should have received a copy of the GNU Affero General Public License along with
|
|
21
|
+
* Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
|
|
22
|
+
*/
|
|
23
|
+
import { Kilometers, KilometersPerSecond, Radians } from '../main.js';
|
|
24
|
+
import { Matrix } from './Matrix.js';
|
|
25
|
+
import { Vector } from './Vector.js';
|
|
26
|
+
export declare class Vector3D<T extends number = number> {
|
|
27
|
+
x: T;
|
|
28
|
+
y: T;
|
|
29
|
+
z: T;
|
|
30
|
+
constructor(x: T, y: T, z: T);
|
|
31
|
+
/**
|
|
32
|
+
* Create a new Vector3D object from the first three elements of a Vector
|
|
33
|
+
* object.
|
|
34
|
+
* @param v The Vector object to convert.
|
|
35
|
+
* @returns A new Vector3D object.
|
|
36
|
+
*/
|
|
37
|
+
static fromVector<U extends number>(v: Vector<U>): Vector3D<U>;
|
|
38
|
+
static readonly origin: Vector3D<number>;
|
|
39
|
+
static readonly xAxis: Vector3D<number>;
|
|
40
|
+
static readonly yAxis: Vector3D<number>;
|
|
41
|
+
static readonly zAxis: Vector3D<number>;
|
|
42
|
+
static readonly xAxisNeg: Vector3D<number>;
|
|
43
|
+
static readonly yAxisNeg: Vector3D<number>;
|
|
44
|
+
static readonly zAxisNeg: Vector3D<number>;
|
|
45
|
+
toList(): T[];
|
|
46
|
+
toArray(): Float64Array<ArrayBuffer>;
|
|
47
|
+
/**
|
|
48
|
+
* Return the Vector3D element at the provided index.
|
|
49
|
+
* @deprecated don't do this
|
|
50
|
+
* @param index The index of the element to return.
|
|
51
|
+
* @returns The element at the provided index.
|
|
52
|
+
*/
|
|
53
|
+
getElement(index: number): number;
|
|
54
|
+
toVector(): Vector<T>;
|
|
55
|
+
toString(fixed?: number): string;
|
|
56
|
+
magnitude(): T;
|
|
57
|
+
add(v: Vector3D<T>): Vector3D<T>;
|
|
58
|
+
subtract(v: Vector3D<T>): Vector3D<T>;
|
|
59
|
+
scale<U extends number>(n: U): Vector3D<U>;
|
|
60
|
+
negate(): Vector3D<T>;
|
|
61
|
+
/**
|
|
62
|
+
* Return the Euclidean distance between this and another Vector3D.
|
|
63
|
+
* @param v The other Vector3D.
|
|
64
|
+
* @returns The distance between this and the other Vector3D.
|
|
65
|
+
*/
|
|
66
|
+
distance(v: Vector3D<T>): T;
|
|
67
|
+
/**
|
|
68
|
+
* Convert this to a unit Vector3D.
|
|
69
|
+
* @returns A unit Vector3D.
|
|
70
|
+
*/
|
|
71
|
+
normalize(): Vector3D<T>;
|
|
72
|
+
dot<T extends number>(v: Vector3D<T>): T;
|
|
73
|
+
outer(v: Vector3D): Matrix;
|
|
74
|
+
cross<U extends number>(v: Vector3D<U>): Vector3D<U>;
|
|
75
|
+
skewSymmetric(): Matrix;
|
|
76
|
+
rotX(theta: number): Vector3D;
|
|
77
|
+
rotY(theta: Radians): Vector3D<T>;
|
|
78
|
+
rotZ(theta: Radians): Vector3D<T>;
|
|
79
|
+
angle<U extends number>(v: Vector3D<U>): Radians;
|
|
80
|
+
angleDegrees(v: Vector3D<T>): number;
|
|
81
|
+
sight(v: Vector3D<KilometersPerSecond>, radius: Kilometers): boolean;
|
|
82
|
+
bisect(v: Vector3D<T>): Vector3D<T>;
|
|
83
|
+
row(): Matrix;
|
|
84
|
+
column(): Matrix;
|
|
85
|
+
join(v: Vector3D): Vector;
|
|
86
|
+
}
|