ootk 2.0.1 → 4.0.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.
Files changed (262) hide show
  1. package/.eslintrc.json +14 -14
  2. package/CHANGELOG.md +122 -0
  3. package/README.md +27 -40
  4. package/jest.config.ts +30 -0
  5. package/lib/coordinate/Hill.d.ts +50 -0
  6. package/lib/coordinate/Hill.js +214 -0
  7. package/lib/coordinate/Hill.js.map +1 -0
  8. package/lib/coordinate/index.d.ts +1 -0
  9. package/lib/coordinate/index.js +2 -0
  10. package/lib/coordinate/index.js.map +1 -0
  11. package/lib/covariance/CovarianceSample.d.ts +44 -0
  12. package/lib/covariance/CovarianceSample.js +146 -0
  13. package/lib/covariance/CovarianceSample.js.map +1 -0
  14. package/lib/covariance/StateCovariance.d.ts +41 -0
  15. package/lib/covariance/StateCovariance.js +62 -0
  16. package/lib/covariance/StateCovariance.js.map +1 -0
  17. package/lib/force/AtmosphericDrag.d.ts +32 -0
  18. package/lib/force/AtmosphericDrag.js +66 -0
  19. package/lib/force/AtmosphericDrag.js.map +1 -0
  20. package/{dist/ootk.d.ts → lib/force/EarthGravity.d.ts} +13 -11
  21. package/lib/force/EarthGravity.js +115 -0
  22. package/lib/force/EarthGravity.js.map +1 -0
  23. package/lib/force/Force.d.ts +25 -0
  24. package/lib/force/Force.js +30 -0
  25. package/lib/force/Force.js.map +1 -0
  26. package/lib/force/ForceModel.d.ts +38 -0
  27. package/lib/force/ForceModel.js +71 -0
  28. package/lib/force/ForceModel.js.map +1 -0
  29. package/lib/force/Gravity.d.ts +41 -0
  30. package/lib/force/Gravity.js +48 -0
  31. package/lib/force/Gravity.js.map +1 -0
  32. package/lib/force/SolarRadiationPressure.d.ts +27 -0
  33. package/lib/force/SolarRadiationPressure.js +42 -0
  34. package/lib/force/SolarRadiationPressure.js.map +1 -0
  35. package/lib/force/ThirdBodyGravity.d.ts +27 -0
  36. package/lib/force/ThirdBodyGravity.js +56 -0
  37. package/lib/force/ThirdBodyGravity.js.map +1 -0
  38. package/lib/force/Thrust.d.ts +35 -0
  39. package/lib/force/Thrust.js +53 -0
  40. package/lib/force/Thrust.js.map +1 -0
  41. package/lib/interpolator/ChebyshevCoefficients.d.ts +54 -0
  42. package/lib/interpolator/ChebyshevCoefficients.js +90 -0
  43. package/lib/interpolator/ChebyshevCoefficients.js.map +1 -0
  44. package/lib/interpolator/ChebyshevInterpolator.d.ts +39 -0
  45. package/lib/interpolator/ChebyshevInterpolator.js +71 -0
  46. package/lib/interpolator/ChebyshevInterpolator.js.map +1 -0
  47. package/lib/interpolator/CubicSpline.d.ts +36 -0
  48. package/lib/interpolator/CubicSpline.js +64 -0
  49. package/lib/interpolator/CubicSpline.js.map +1 -0
  50. package/lib/interpolator/CubicSplineInterpolator.d.ts +37 -0
  51. package/lib/interpolator/CubicSplineInterpolator.js +78 -0
  52. package/lib/interpolator/CubicSplineInterpolator.js.map +1 -0
  53. package/lib/interpolator/FieldInterpolator.d.ts +26 -0
  54. package/lib/interpolator/FieldInterpolator.js +31 -0
  55. package/lib/interpolator/FieldInterpolator.js.map +1 -0
  56. package/lib/interpolator/Interpolator.d.ts +23 -0
  57. package/lib/interpolator/Interpolator.js +48 -0
  58. package/lib/interpolator/Interpolator.js.map +1 -0
  59. package/lib/interpolator/LagrangeInterpolator.d.ts +42 -0
  60. package/lib/interpolator/LagrangeInterpolator.js +156 -0
  61. package/lib/interpolator/LagrangeInterpolator.js.map +1 -0
  62. package/lib/interpolator/StateInterpolator.d.ts +29 -0
  63. package/lib/interpolator/StateInterpolator.js +37 -0
  64. package/lib/interpolator/StateInterpolator.js.map +1 -0
  65. package/lib/interpolator/VerletBlendInterpolator.d.ts +44 -0
  66. package/lib/interpolator/VerletBlendInterpolator.js +115 -0
  67. package/lib/interpolator/VerletBlendInterpolator.js.map +1 -0
  68. package/lib/maneuver/TwoBurnOrbitTransfer.d.ts +43 -0
  69. package/lib/maneuver/TwoBurnOrbitTransfer.js +62 -0
  70. package/lib/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
  71. package/lib/maneuver/Waypoint.d.ts +66 -0
  72. package/lib/maneuver/Waypoint.js +152 -0
  73. package/lib/maneuver/Waypoint.js.map +1 -0
  74. package/lib/objects/DetailedSatellite.d.ts +94 -0
  75. package/lib/objects/DetailedSatellite.js +140 -0
  76. package/lib/objects/DetailedSatellite.js.map +1 -0
  77. package/lib/objects/DetailedSensor.d.ts +43 -0
  78. package/lib/objects/DetailedSensor.js +45 -0
  79. package/lib/objects/DetailedSensor.js.map +1 -0
  80. package/lib/objects/{space-object.d.ts → LandObject.d.ts} +19 -21
  81. package/lib/objects/LandObject.js +28 -0
  82. package/lib/objects/LandObject.js.map +1 -0
  83. package/lib/objects/Marker.d.ts +21 -0
  84. package/lib/objects/Marker.js +25 -0
  85. package/lib/objects/Marker.js.map +1 -0
  86. package/lib/objects/index.d.ts +5 -4
  87. package/lib/objects/index.js +5 -4
  88. package/lib/objects/index.js.map +1 -1
  89. package/lib/observation/Observation.d.ts +51 -0
  90. package/lib/observation/Observation.js +71 -0
  91. package/lib/observation/Observation.js.map +1 -0
  92. package/lib/observation/ObservationOptical.d.ts +47 -0
  93. package/lib/observation/ObservationOptical.js +101 -0
  94. package/lib/observation/ObservationOptical.js.map +1 -0
  95. package/lib/observation/ObservationRadar.d.ts +43 -0
  96. package/lib/observation/ObservationRadar.js +90 -0
  97. package/lib/observation/ObservationRadar.js.map +1 -0
  98. package/lib/observation/ObservationUtils.d.ts +21 -0
  99. package/lib/observation/ObservationUtils.js +33 -0
  100. package/lib/observation/ObservationUtils.js.map +1 -0
  101. package/lib/observation/PropagatorPairs.d.ts +31 -0
  102. package/lib/observation/PropagatorPairs.js +40 -0
  103. package/lib/observation/PropagatorPairs.js.map +1 -0
  104. package/lib/ootk.d.ts +10 -9
  105. package/lib/ootk.js +10 -9
  106. package/lib/ootk.js.map +1 -1
  107. package/lib/operations/BoxMuller.d.ts +41 -0
  108. package/lib/operations/BoxMuller.js +66 -0
  109. package/lib/operations/BoxMuller.js.map +1 -0
  110. package/lib/operations/EulerAngles.d.ts +50 -0
  111. package/lib/operations/EulerAngles.js +111 -0
  112. package/lib/operations/EulerAngles.js.map +1 -0
  113. package/lib/operations/Quaternion.d.ts +57 -0
  114. package/lib/operations/Quaternion.js +164 -0
  115. package/lib/operations/Quaternion.js.map +1 -0
  116. package/lib/operations/RandomGaussianSource.d.ts +25 -0
  117. package/lib/operations/RandomGaussianSource.js +43 -0
  118. package/lib/operations/RandomGaussianSource.js.map +1 -0
  119. package/lib/operations/index.d.ts +4 -0
  120. package/lib/operations/index.js +5 -0
  121. package/lib/operations/index.js.map +1 -0
  122. package/lib/optimize/ChebyshevCompressor.d.ts +31 -0
  123. package/lib/optimize/ChebyshevCompressor.js +80 -0
  124. package/lib/optimize/ChebyshevCompressor.js.map +1 -0
  125. package/lib/optimize/DownhillSimplex.d.ts +50 -0
  126. package/lib/optimize/DownhillSimplex.js +168 -0
  127. package/lib/optimize/DownhillSimplex.js.map +1 -0
  128. package/lib/optimize/GoldenSection.d.ts +33 -0
  129. package/lib/optimize/GoldenSection.js +49 -0
  130. package/lib/optimize/GoldenSection.js.map +1 -0
  131. package/lib/optimize/PolynomialRegression.d.ts +37 -0
  132. package/lib/optimize/PolynomialRegression.js +66 -0
  133. package/lib/optimize/PolynomialRegression.js.map +1 -0
  134. package/lib/optimize/PolynomicalRegressionResult.d.ts +28 -0
  135. package/lib/optimize/PolynomicalRegressionResult.js +32 -0
  136. package/lib/optimize/PolynomicalRegressionResult.js.map +1 -0
  137. package/lib/optimize/SimpleLinearRegression.d.ts +41 -0
  138. package/lib/optimize/SimpleLinearRegression.js +107 -0
  139. package/lib/optimize/SimpleLinearRegression.js.map +1 -0
  140. package/lib/optimize/SimplexEntry.d.ts +33 -0
  141. package/lib/optimize/SimplexEntry.js +39 -0
  142. package/lib/optimize/SimplexEntry.js.map +1 -0
  143. package/lib/orbit_determination/BatchLeastSquaresOD.d.ts +54 -0
  144. package/lib/orbit_determination/BatchLeastSquaresOD.js +118 -0
  145. package/lib/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
  146. package/lib/orbit_determination/BatchLeastSquaresResult.d.ts +29 -0
  147. package/lib/orbit_determination/BatchLeastSquaresResult.js +31 -0
  148. package/lib/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
  149. package/lib/orbit_determination/GibbsIOD.d.ts +33 -0
  150. package/lib/orbit_determination/GibbsIOD.js +70 -0
  151. package/lib/orbit_determination/GibbsIOD.js.map +1 -0
  152. package/lib/orbit_determination/GoodingIOD.d.ts +52 -0
  153. package/lib/orbit_determination/GoodingIOD.js +244 -0
  154. package/lib/orbit_determination/GoodingIOD.js.map +1 -0
  155. package/{dist/objects/space-object.d.ts → lib/orbit_determination/HerrickGibbsIOD.d.ts} +17 -22
  156. package/lib/orbit_determination/HerrickGibbsIOD.js +49 -0
  157. package/lib/orbit_determination/HerrickGibbsIOD.js.map +1 -0
  158. package/lib/orbit_determination/LambertIOD.d.ts +46 -0
  159. package/lib/orbit_determination/LambertIOD.js +199 -0
  160. package/lib/orbit_determination/LambertIOD.js.map +1 -0
  161. package/lib/orbit_determination/ModifiedGoodingIOD.d.ts +41 -0
  162. package/lib/orbit_determination/ModifiedGoodingIOD.js +82 -0
  163. package/lib/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
  164. package/lib/propagator/DormandPrince54Propagator.d.ts +29 -0
  165. package/lib/propagator/DormandPrince54Propagator.js +68 -0
  166. package/lib/propagator/DormandPrince54Propagator.js.map +1 -0
  167. package/lib/propagator/KeplerPropagator.d.ts +36 -0
  168. package/lib/propagator/KeplerPropagator.js +81 -0
  169. package/lib/propagator/KeplerPropagator.js.map +1 -0
  170. package/lib/propagator/Propagator.d.ts +35 -0
  171. package/lib/propagator/Propagator.js +163 -0
  172. package/lib/propagator/Propagator.js.map +1 -0
  173. package/lib/propagator/RkCheckpoint.d.ts +23 -0
  174. package/lib/propagator/RkCheckpoint.js +26 -0
  175. package/lib/propagator/RkCheckpoint.js.map +1 -0
  176. package/lib/propagator/RkResult.d.ts +24 -0
  177. package/lib/propagator/RkResult.js +28 -0
  178. package/lib/propagator/RkResult.js.map +1 -0
  179. package/lib/propagator/RungeKutta4Propagator.d.ts +46 -0
  180. package/lib/propagator/RungeKutta4Propagator.js +132 -0
  181. package/lib/propagator/RungeKutta4Propagator.js.map +1 -0
  182. package/lib/propagator/RungeKutta89Propagator.d.ts +29 -0
  183. package/lib/propagator/RungeKutta89Propagator.js +130 -0
  184. package/lib/propagator/RungeKutta89Propagator.js.map +1 -0
  185. package/lib/propagator/RungeKuttaAdaptive.d.ts +52 -0
  186. package/lib/propagator/RungeKuttaAdaptive.js +152 -0
  187. package/lib/propagator/RungeKuttaAdaptive.js.map +1 -0
  188. package/lib/propagator/Sgp4Propagator.d.ts +35 -0
  189. package/lib/propagator/Sgp4Propagator.js +55 -0
  190. package/lib/propagator/Sgp4Propagator.js.map +1 -0
  191. package/lib/smoothing/ExponentialSmoothing.d.ts +24 -0
  192. package/lib/smoothing/ExponentialSmoothing.js +82 -0
  193. package/lib/smoothing/ExponentialSmoothing.js.map +1 -0
  194. package/lib/types/types.d.ts +68 -262
  195. package/lib/types/types.js +23 -33
  196. package/lib/types/types.js.map +1 -1
  197. package/package.json +28 -42
  198. package/codecov.yml +0 -21
  199. package/dist/objects/base-object.d.ts +0 -40
  200. package/dist/objects/detailed-sat.d.ts +0 -66
  201. package/dist/objects/index.d.ts +0 -4
  202. package/dist/objects/sat.d.ts +0 -92
  203. package/dist/objects/sensor.d.ts +0 -87
  204. package/dist/objects/star.d.ts +0 -46
  205. package/dist/ootk.js +0 -2
  206. package/dist/ootk.js.LICENSE.txt +0 -77
  207. package/dist/sgp4/Sgp4Assembly.d.ts +0 -5
  208. package/dist/sgp4/sgp4.d.ts +0 -82
  209. package/dist/tle/tle-format-data.d.ts +0 -6
  210. package/dist/tle/tle.d.ts +0 -374
  211. package/dist/transforms/transforms.d.ts +0 -55
  212. package/dist/types/types.d.ts +0 -280
  213. package/dist/utils/constants.d.ts +0 -34
  214. package/dist/utils/moon-math.d.ts +0 -113
  215. package/dist/utils/sun-math.d.ts +0 -230
  216. package/dist/utils/utils.d.ts +0 -39
  217. package/lib/objects/base-object.d.ts +0 -40
  218. package/lib/objects/base-object.js +0 -109
  219. package/lib/objects/base-object.js.map +0 -1
  220. package/lib/objects/detailed-sat.d.ts +0 -66
  221. package/lib/objects/detailed-sat.js +0 -149
  222. package/lib/objects/detailed-sat.js.map +0 -1
  223. package/lib/objects/sat.d.ts +0 -92
  224. package/lib/objects/sat.js +0 -188
  225. package/lib/objects/sat.js.map +0 -1
  226. package/lib/objects/sensor.d.ts +0 -87
  227. package/lib/objects/sensor.js +0 -255
  228. package/lib/objects/sensor.js.map +0 -1
  229. package/lib/objects/space-object.js +0 -60
  230. package/lib/objects/space-object.js.map +0 -1
  231. package/lib/objects/star.d.ts +0 -46
  232. package/lib/objects/star.js +0 -91
  233. package/lib/objects/star.js.map +0 -1
  234. package/lib/sgp4/Sgp4Assembly.d.ts +0 -5
  235. package/lib/sgp4/Sgp4Assembly.js +0 -75
  236. package/lib/sgp4/Sgp4Assembly.js.map +0 -1
  237. package/lib/sgp4/sgp4.d.ts +0 -82
  238. package/lib/sgp4/sgp4.js +0 -3274
  239. package/lib/sgp4/sgp4.js.map +0 -1
  240. package/lib/tle/tle-format-data.d.ts +0 -6
  241. package/lib/tle/tle-format-data.js +0 -10
  242. package/lib/tle/tle-format-data.js.map +0 -1
  243. package/lib/tle/tle.d.ts +0 -374
  244. package/lib/tle/tle.js +0 -611
  245. package/lib/tle/tle.js.map +0 -1
  246. package/lib/transforms/transforms.d.ts +0 -55
  247. package/lib/transforms/transforms.js +0 -209
  248. package/lib/transforms/transforms.js.map +0 -1
  249. package/lib/utils/constants.d.ts +0 -34
  250. package/lib/utils/constants.js +0 -35
  251. package/lib/utils/constants.js.map +0 -1
  252. package/lib/utils/moon-math.d.ts +0 -113
  253. package/lib/utils/moon-math.js +0 -387
  254. package/lib/utils/moon-math.js.map +0 -1
  255. package/lib/utils/sun-math.d.ts +0 -230
  256. package/lib/utils/sun-math.js +0 -422
  257. package/lib/utils/sun-math.js.map +0 -1
  258. package/lib/utils/utils.d.ts +0 -39
  259. package/lib/utils/utils.js +0 -100
  260. package/lib/utils/utils.js.map +0 -1
  261. package/sandbox.html +0 -8
  262. /package/{LICENSE.MD → LICENSE.md} +0 -0
@@ -1,209 +0,0 @@
1
- /* eslint-disable init-declarations */
2
- /**
3
- * @author Theodore Kruczek.
4
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
5
- * with satellites and other orbital objects.
6
- *
7
- * @file The Transforms module contains a collection of conversions not contained
8
- * in the original SGP4 library such as ECI to ECF and ECF to RAE. This was based
9
- * on some of the functions in satellite.js.
10
- *
11
- * @license AGPL-3.0-or-later
12
- * @Copyright (c) 2020-2023 Theodore Kruczek
13
- *
14
- * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
15
- * terms of the GNU Affero General Public License as published by the Free Software
16
- * Foundation, either version 3 of the License, or (at your option) any later version.
17
- *
18
- * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
19
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
- * See the GNU Affero General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU Affero General Public License along with
23
- * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
24
- */
25
- import { PI, TAU } from '../utils/constants';
26
- var Transforms = /** @class */ (function () {
27
- function Transforms() {
28
- }
29
- Transforms.getDegLat = function (radians) {
30
- if (radians < -PI / 2 || radians > PI / 2) {
31
- throw new RangeError('Latitude radians must be in range [-PI/2; PI/2].');
32
- }
33
- return Transforms.rad2deg(radians);
34
- };
35
- Transforms.getDegLon = function (radians) {
36
- if (radians < -PI || radians > PI) {
37
- throw new RangeError('Longitude radians must be in range [-PI; PI].');
38
- }
39
- return Transforms.rad2deg(radians);
40
- };
41
- Transforms.getRadLat = function (degrees) {
42
- if (degrees < -90 || degrees > 90) {
43
- throw new RangeError('Latitude degrees must be in range [-90; 90].');
44
- }
45
- return Transforms.deg2rad(degrees);
46
- };
47
- Transforms.getRadLon = function (degrees) {
48
- if (degrees < -180 || degrees > 180) {
49
- throw new RangeError('Longitude degrees must be in range [-180; 180].');
50
- }
51
- return Transforms.deg2rad(degrees);
52
- };
53
- Transforms.rad2deg = function (radians) {
54
- return ((radians * 180) / PI);
55
- };
56
- Transforms.deg2rad = function (degrees) {
57
- return ((degrees * PI) / 180.0);
58
- };
59
- Transforms.ecf2eci = function (ecf, gmst) {
60
- /*
61
- * Ccar.colorado.edu/ASEN5070/handouts/coordsys.doc
62
- *
63
- * [X] [C -S 0][X]
64
- * [Y] = [S C 0][Y]
65
- * [Z]eci [0 0 1][Z]ecf
66
- *
67
- */
68
- var X = (ecf.x * Math.cos(gmst) - ecf.y * Math.sin(gmst));
69
- var Y = (ecf.x * Math.sin(gmst) + ecf.y * Math.cos(gmst));
70
- var Z = ecf.z;
71
- return { x: X, y: Y, z: Z };
72
- };
73
- Transforms.ecf2rae = function (lla, ecf) {
74
- var sezCoords = Transforms.lla2sez(lla, ecf);
75
- return Transforms.sez2rae(sezCoords);
76
- };
77
- /**
78
- * EciToGeodetic converts eci coordinates to lla coordinates
79
- * @param {vec3} eci takes xyz coordinates
80
- * @param {number} gmst takes a number in gmst time
81
- * @returns {array} array containing lla coordinates
82
- */
83
- Transforms.eci2lla = function (eci, gmst) {
84
- // http://www.celestrak.com/columns/v02n03/
85
- var a = 6378.137;
86
- var b = 6356.7523142;
87
- var R = Math.sqrt(eci.x * eci.x + eci.y * eci.y);
88
- var f = (a - b) / a;
89
- var e2 = 2 * f - f * f;
90
- var lon = Math.atan2(eci.y, eci.x) - gmst;
91
- while (lon < -PI) {
92
- lon += TAU;
93
- }
94
- while (lon > PI) {
95
- lon -= TAU;
96
- }
97
- var kmax = 20;
98
- var k = 0;
99
- var lat = Math.atan2(eci.z, Math.sqrt(eci.x * eci.x + eci.y * eci.y));
100
- var C;
101
- while (k < kmax) {
102
- C = 1 / Math.sqrt(1 - e2 * (Math.sin(lat) * Math.sin(lat)));
103
- lat = Math.atan2(eci.z + a * C * e2 * Math.sin(lat), R);
104
- k += 1;
105
- }
106
- var alt = R / Math.cos(lat) - a * C;
107
- return { lon: lon, lat: lat, alt: alt };
108
- };
109
- Transforms.eci2ecf = function (eci, gmst) {
110
- /*
111
- * Ccar.colorado.edu/ASEN5070/handouts/coordsys.doc
112
- *
113
- * [X] [C -S 0][X]
114
- * [Y] = [S C 0][Y]
115
- * [Z]eci [0 0 1][Z]ecf
116
- *
117
- *
118
- * Inverse:
119
- * [X] [C S 0][X]
120
- * [Y] = [-S C 0][Y]
121
- * [Z]ecf [0 0 1][Z]eci
122
- */
123
- var x = (eci.x * Math.cos(gmst) + eci.y * Math.sin(gmst));
124
- var y = (eci.x * -Math.sin(gmst) + eci.y * Math.cos(gmst));
125
- var z = eci.z;
126
- return {
127
- x: x,
128
- y: y,
129
- z: z,
130
- };
131
- };
132
- Transforms.lla2ecf = function (lla) {
133
- var lon = lla.lon, lat = lla.lat, alt = lla.alt;
134
- var a = 6378.137;
135
- var b = 6356.7523142;
136
- var f = (a - b) / a;
137
- var e2 = 2 * f - f * f;
138
- var normal = a / Math.sqrt(1 - e2 * (Math.sin(lat) * Math.sin(lat)));
139
- var x = (normal + alt) * Math.cos(lat) * Math.cos(lon);
140
- var y = (normal + alt) * Math.cos(lat) * Math.sin(lon);
141
- var z = (normal * (1 - e2) + alt) * Math.sin(lat);
142
- return {
143
- x: x,
144
- y: y,
145
- z: z,
146
- };
147
- };
148
- Transforms.lla2sez = function (lla, ecf) {
149
- /*
150
- * http://www.celestrak.com/columns/v02n02/
151
- * TS Kelso's method, except I'm using ECF frame
152
- * and he uses ECI.
153
- */
154
- var lon = lla.lon, lat = lla.lat;
155
- var observerEcf = Transforms.lla2ecf(lla);
156
- var rx = ecf.x - observerEcf.x;
157
- var ry = ecf.y - observerEcf.y;
158
- var rz = ecf.z - observerEcf.z;
159
- // Top is short for topocentric
160
- var south = Math.sin(lat) * Math.cos(lon) * rx + Math.sin(lat) * Math.sin(lon) * ry - Math.cos(lat) * rz;
161
- var east = -Math.sin(lon) * rx + Math.cos(lon) * ry;
162
- var zenith = Math.cos(lat) * Math.cos(lon) * rx + Math.cos(lat) * Math.sin(lon) * ry + Math.sin(lat) * rz;
163
- return { s: south, e: east, z: zenith };
164
- };
165
- Transforms.rae2sez = function (rae) {
166
- // Az,el,range to sez convertion
167
- var south = -rae.rng * Math.cos(rae.el) * Math.cos(rae.az);
168
- var east = rae.rng * Math.cos(rae.el) * Math.sin(rae.az);
169
- var zenith = rae.rng * Math.sin(rae.el);
170
- return {
171
- s: south,
172
- e: east,
173
- z: zenith,
174
- };
175
- };
176
- Transforms.rae2ecf = function (rae, lla) {
177
- var obsEcf = Transforms.lla2ecf(lla);
178
- var sez = Transforms.rae2sez(rae);
179
- // Some needed calculations
180
- var slat = Math.sin(lla.lat);
181
- var slon = Math.sin(lla.lon);
182
- var clat = Math.cos(lla.lat);
183
- var clon = Math.cos(lla.lon);
184
- var x = slat * clon * sez.s + -slon * sez.e + clat * clon * sez.z + obsEcf.x;
185
- var y = slat * slon * sez.s + clon * sez.e + clat * slon * sez.z + obsEcf.y;
186
- var z = -clat * sez.s + slat * sez.z + obsEcf.z;
187
- return { x: x, y: y, z: z };
188
- };
189
- /**
190
- * @param {Object} sez Containing SEZ coordinates
191
- * @param {Number} sez.s Positive horizontal vector S due south.
192
- * @param {Number} sez.e Positive horizontal vector E due east.
193
- * @param {Number} sez.z Vector Z normal to the surface of the earth (up).
194
- * @returns {RaeVec3} Rng, Az, El array
195
- */
196
- Transforms.sez2rae = function (sez) {
197
- var rng = Math.sqrt(sez.s * sez.s + sez.e * sez.e + sez.z * sez.z);
198
- var el = Math.asin(sez.z / rng);
199
- var az = (Math.atan2(-sez.e, sez.s) + PI);
200
- return {
201
- rng: rng,
202
- az: az,
203
- el: el,
204
- };
205
- };
206
- return Transforms;
207
- }());
208
- export { Transforms };
209
- //# sourceMappingURL=transforms.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transforms.js","sourceRoot":"","sources":["../../src/transforms/transforms.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE7C;IAAA;IA4NA,CAAC;IA3Ne,oBAAS,GAAvB,UAAwB,OAAgB;QACtC,IAAI,OAAO,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,OAAO,GAAG,EAAE,GAAG,CAAC,EAAE;YACzC,MAAM,IAAI,UAAU,CAAC,kDAAkD,CAAC,CAAC;SAC1E;QAED,OAAO,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAEa,oBAAS,GAAvB,UAAwB,OAAgB;QACtC,IAAI,OAAO,GAAG,CAAC,EAAE,IAAI,OAAO,GAAG,EAAE,EAAE;YACjC,MAAM,IAAI,UAAU,CAAC,+CAA+C,CAAC,CAAC;SACvE;QAED,OAAO,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAEa,oBAAS,GAAvB,UAAwB,OAAgB;QACtC,IAAI,OAAO,GAAG,CAAC,EAAE,IAAI,OAAO,GAAG,EAAE,EAAE;YACjC,MAAM,IAAI,UAAU,CAAC,8CAA8C,CAAC,CAAC;SACtE;QAED,OAAO,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAEa,oBAAS,GAAvB,UAAwB,OAAgB;QACtC,IAAI,OAAO,GAAG,CAAC,GAAG,IAAI,OAAO,GAAG,GAAG,EAAE;YACnC,MAAM,IAAI,UAAU,CAAC,iDAAiD,CAAC,CAAC;SACzE;QAED,OAAO,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,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G,GAAG,CAAC,CAAC,CAAC,CAAC;QACjF,IAAM,EAAE,GAAY,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;QAC3C,IAAM,EAAE,GAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QAErD,OAAgB;YACd,GAAG,KAAA;YACH,EAAE,IAAA;YACF,EAAE,IAAA;SACH,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AA5ND,IA4NC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,34 +0,0 @@
1
- /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
4
- * with satellites and other orbital objects.
5
- *
6
- * @file Commonly used constants.
7
- *
8
- * @license AGPL-3.0-or-later
9
- * @Copyright (c) 2020-2023 Theodore Kruczek
10
- *
11
- * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
12
- * terms of the GNU Affero General Public License as published by the Free Software
13
- * Foundation, either version 3 of the License, or (at your option) any later version.
14
- *
15
- * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
16
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
- * See the GNU Affero General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public License along with
20
- * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
21
- */
22
- export declare const PI: number;
23
- export declare const TAU: number;
24
- export declare const DEG2RAD: number;
25
- export declare const x2o3: number;
26
- export declare const temp4 = 1.5e-12;
27
- export declare const RAD2DEG: number;
28
- export declare const MINUTES_PER_DAY = 1440;
29
- export declare const MS_PER_DAY = 86400000;
30
- export declare const DAY_TO_MS = 1.15741e-8;
31
- export declare const cMPerSec = 299792458;
32
- export declare const cKmPerSec: number;
33
- export declare const cKmPerMs: number;
34
- export declare const RADIUS_OF_EARTH = 6371;
@@ -1,35 +0,0 @@
1
- /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
4
- * with satellites and other orbital objects.
5
- *
6
- * @file Commonly used constants.
7
- *
8
- * @license AGPL-3.0-or-later
9
- * @Copyright (c) 2020-2023 Theodore Kruczek
10
- *
11
- * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
12
- * terms of the GNU Affero General Public License as published by the Free Software
13
- * Foundation, either version 3 of the License, or (at your option) any later version.
14
- *
15
- * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
16
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
- * See the GNU Affero General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU Affero General Public License along with
20
- * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
21
- */
22
- export var PI = Math.PI;
23
- export var TAU = PI * 2; // https://tauday.com/tau-manifesto
24
- export var DEG2RAD = PI / 180.0;
25
- export var x2o3 = 2.0 / 3.0;
26
- export var temp4 = 1.5e-12;
27
- export var RAD2DEG = 360 / TAU;
28
- export var MINUTES_PER_DAY = 1440;
29
- export var MS_PER_DAY = 86400000;
30
- export var DAY_TO_MS = 1.15741e-8;
31
- export var cMPerSec = 299792458;
32
- export var cKmPerSec = 299792458 / 1000;
33
- export var cKmPerMs = 299792458 / 1000 / 1000;
34
- export var RADIUS_OF_EARTH = 6371; // Radius of Earth in kilometers
35
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,CAAS,IAAA,EAAE,GAAK,IAAI,GAAT,CAAU;AAC3B,MAAM,CAAC,IAAM,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,mCAAmC;AAC9D,MAAM,CAAC,IAAM,OAAO,GAAG,EAAE,GAAG,KAAK,CAAC;AAClC,MAAM,CAAC,IAAM,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC;AAC9B,MAAM,CAAC,IAAM,KAAK,GAAG,OAAO,CAAC;AAE7B,MAAM,CAAC,IAAM,OAAO,GAAG,GAAG,GAAG,GAAG,CAAC;AACjC,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,CAAC;AACpC,MAAM,CAAC,IAAM,UAAU,GAAG,QAAQ,CAAC;AACnC,MAAM,CAAC,IAAM,SAAS,GAAG,UAAU,CAAC;AACpC,MAAM,CAAC,IAAM,QAAQ,GAAG,SAAS,CAAC;AAClC,MAAM,CAAC,IAAM,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;AAC1C,MAAM,CAAC,IAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;AAChD,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,CAAC,CAAC,gCAAgC"}
@@ -1,113 +0,0 @@
1
- /**
2
- * @author Theodore Kruczek.
3
- * @description Orbital Object ToolKit (OOTK) is a collection of tools for working
4
- * with satellites and other orbital objects.
5
- *
6
- * @file MoonMath is a an extension to SunMath for calculating the position of the moon
7
- * and its phases. This was originally created by Vladimir Agafonkin. Robert Gester's
8
- * update was referenced for documentation. There were a couple of bugs in both versions
9
- * so there will be some differences if you are migrating from either to this library.
10
- *
11
- *
12
- * @license AGPL-3.0-or-later
13
- * @Copyright (c) 2020-2023 Theodore Kruczek
14
- *
15
- * @Copyright (c) 2011-2015, Vladimir Agafonkin
16
- * SunCalc is a JavaScript library for calculating sun/moon position and light phases.
17
- * https://github.com/mourner/suncalc
18
- *
19
- * Reworked and enhanced by Robert Gester
20
- * @Copyright (c) 2022 Robert Gester
21
- * https://github.com/hypnos3/suncalc3
22
- *
23
- * moon calculations, based on http://aa.quae.nl/en/reken/hemelpositie.html formulas
24
- *
25
- * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
26
- * terms of the GNU Affero General Public License as published by the Free Software
27
- * Foundation, either version 3 of the License, or (at your option) any later version.
28
- *
29
- * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
30
- * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
31
- * See the GNU Affero General Public License for more details.
32
- *
33
- * You should have received a copy of the GNU Affero General Public License along with
34
- * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
35
- */
36
- import { Radians } from '../ootk';
37
- type MoonIlluminationData = {
38
- fraction: number;
39
- phase: {
40
- from: number;
41
- to: number;
42
- id: string;
43
- emoji: string;
44
- code: string;
45
- name: string;
46
- weight: number;
47
- css: string;
48
- };
49
- phaseValue: number;
50
- angle: number;
51
- next: {
52
- value: number;
53
- date: string;
54
- type: string;
55
- newMoon: {
56
- value: number;
57
- date: string;
58
- };
59
- fullMoon: {
60
- value: number;
61
- date: string;
62
- };
63
- firstQuarter: {
64
- value: number;
65
- date: string;
66
- };
67
- thirdQuarter: {
68
- value: number;
69
- date: string;
70
- };
71
- };
72
- };
73
- export declare class MoonMath {
74
- static moonCoords(d: any): {
75
- ra: Radians;
76
- dec: Radians;
77
- dist: number;
78
- };
79
- static hoursLater(date: Date, h: number): Date;
80
- static getMoonPosition(date: any, lat: any, lon: any): {
81
- az: Radians;
82
- el: Radians;
83
- rng: number;
84
- parallacticAngle: number;
85
- };
86
- private static moonCycles;
87
- /**
88
- * calculations for illumination parameters of the moon,
89
- * based on http://idlastro.gsfc.nasa.gov/ftp/pro/astro/mphase.pro formulas and
90
- * Chapter 48 of "Astronomical Algorithms" 2nd edition by Jean Meeus (Willmann-Bell, Richmond) 1998.
91
- * @param {number | Date} date Date object or timestamp for calculating moon-illumination
92
- * @return {MoonIlluminationData} result object of moon-illumination
93
- */
94
- static getMoonIllumination(date: number | Date): MoonIlluminationData;
95
- /**
96
- * calculations for moon rise/set times are based on http://www.stargazing.net/kepler/moonrise.html article
97
- * @param {number|Date} dateValue Date object or timestamp for calculating moon-times
98
- * @param {number} lat latitude for calculating moon-times
99
- * @param {number} lon longitude for calculating moon-times
100
- * @param {boolean} [isUtc] defines if the calculation should be in utc or local time (default is local)
101
- * @return {IMoonTimes} result object of sunTime
102
- */
103
- static getMoonTimes(dateValue: Date, lat: Radians, lon: Radians, isUtc?: boolean): {
104
- rise: any;
105
- set: any;
106
- ye: any;
107
- alwaysUp: any;
108
- alwaysDown: any;
109
- highest: any;
110
- };
111
- private static calculateRiseSetTimes;
112
- }
113
- export {};