ootk 3.0.0 → 4.0.0-1

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 (357) hide show
  1. package/CHANGELOG.md +235 -10
  2. package/README.md +27 -40
  3. package/dist/coordinate/Hill.d.ts +49 -0
  4. package/dist/coordinate/Hill.js +222 -0
  5. package/dist/coordinate/Hill.js.map +1 -0
  6. package/dist/coordinate/index.d.ts +1 -0
  7. package/dist/coordinate/index.js +2 -0
  8. package/dist/coordinate/index.js.map +1 -0
  9. package/dist/covariance/CovarianceSample.d.ts +43 -0
  10. package/dist/covariance/CovarianceSample.js +147 -0
  11. package/dist/covariance/CovarianceSample.js.map +1 -0
  12. package/dist/covariance/StateCovariance.d.ts +42 -0
  13. package/dist/covariance/StateCovariance.js +65 -0
  14. package/dist/covariance/StateCovariance.js.map +1 -0
  15. package/dist/force/AtmosphericDrag.d.ts +31 -0
  16. package/dist/force/AtmosphericDrag.js +73 -0
  17. package/dist/force/AtmosphericDrag.js.map +1 -0
  18. package/dist/force/EarthGravity.d.ts +27 -0
  19. package/dist/force/EarthGravity.js +117 -0
  20. package/dist/force/EarthGravity.js.map +1 -0
  21. package/{lib/ootk.d.ts → dist/force/Force.d.ts} +12 -11
  22. package/dist/force/Force.js +31 -0
  23. package/dist/force/Force.js.map +1 -0
  24. package/dist/force/ForceModel.d.ts +37 -0
  25. package/dist/force/ForceModel.js +75 -0
  26. package/dist/force/ForceModel.js.map +1 -0
  27. package/dist/force/Gravity.d.ts +38 -0
  28. package/dist/force/Gravity.js +47 -0
  29. package/dist/force/Gravity.js.map +1 -0
  30. package/dist/{ootk.d.ts → force/SolarRadiationPressure.d.ts} +12 -11
  31. package/dist/force/SolarRadiationPressure.js +44 -0
  32. package/dist/force/SolarRadiationPressure.js.map +1 -0
  33. package/dist/force/ThirdBodyGravity.d.ts +26 -0
  34. package/dist/force/ThirdBodyGravity.js +57 -0
  35. package/dist/force/ThirdBodyGravity.js.map +1 -0
  36. package/dist/force/Thrust.d.ts +34 -0
  37. package/dist/force/Thrust.js +58 -0
  38. package/dist/force/Thrust.js.map +1 -0
  39. package/dist/interfaces/RfSensorParams.d.ts +28 -0
  40. package/dist/interfaces/RfSensorParams.js +24 -0
  41. package/dist/interfaces/RfSensorParams.js.map +1 -0
  42. package/dist/interfaces/index.d.ts +1 -0
  43. package/dist/interfaces/index.js +2 -0
  44. package/dist/interfaces/index.js.map +1 -0
  45. package/dist/interpolator/ChebyshevCoefficients.d.ts +50 -0
  46. package/dist/interpolator/ChebyshevCoefficients.js +94 -0
  47. package/dist/interpolator/ChebyshevCoefficients.js.map +1 -0
  48. package/dist/interpolator/ChebyshevInterpolator.d.ts +38 -0
  49. package/dist/interpolator/ChebyshevInterpolator.js +71 -0
  50. package/dist/interpolator/ChebyshevInterpolator.js.map +1 -0
  51. package/dist/interpolator/CubicSpline.d.ts +35 -0
  52. package/dist/interpolator/CubicSpline.js +69 -0
  53. package/dist/interpolator/CubicSpline.js.map +1 -0
  54. package/dist/interpolator/CubicSplineInterpolator.d.ts +36 -0
  55. package/dist/interpolator/CubicSplineInterpolator.js +80 -0
  56. package/dist/interpolator/CubicSplineInterpolator.js.map +1 -0
  57. package/dist/interpolator/FieldInterpolator.d.ts +28 -0
  58. package/dist/interpolator/FieldInterpolator.js +34 -0
  59. package/dist/interpolator/FieldInterpolator.js.map +1 -0
  60. package/dist/interpolator/Interpolator.d.ts +22 -0
  61. package/dist/interpolator/Interpolator.js +47 -0
  62. package/dist/interpolator/Interpolator.js.map +1 -0
  63. package/dist/interpolator/LagrangeInterpolator.d.ts +40 -0
  64. package/dist/interpolator/LagrangeInterpolator.js +159 -0
  65. package/dist/interpolator/LagrangeInterpolator.js.map +1 -0
  66. package/dist/interpolator/StateInterpolator.d.ts +27 -0
  67. package/dist/interpolator/StateInterpolator.js +35 -0
  68. package/dist/interpolator/StateInterpolator.js.map +1 -0
  69. package/dist/interpolator/VerletBlendInterpolator.d.ts +43 -0
  70. package/dist/interpolator/VerletBlendInterpolator.js +118 -0
  71. package/dist/interpolator/VerletBlendInterpolator.js.map +1 -0
  72. package/{lib/ootk.js → dist/main.d.ts} +13 -10
  73. package/dist/{objects/space-object.d.ts → main.js} +17 -23
  74. package/dist/main.js.map +1 -0
  75. package/dist/maneuver/TwoBurnOrbitTransfer.d.ts +41 -0
  76. package/dist/maneuver/TwoBurnOrbitTransfer.js +65 -0
  77. package/dist/maneuver/TwoBurnOrbitTransfer.js.map +1 -0
  78. package/dist/maneuver/Waypoint.d.ts +91 -0
  79. package/dist/maneuver/Waypoint.js +179 -0
  80. package/dist/maneuver/Waypoint.js.map +1 -0
  81. package/{lib/objects/detailed-sat.d.ts → dist/objects/DetailedSatellite.d.ts} +40 -36
  82. package/dist/objects/DetailedSatellite.js +136 -0
  83. package/dist/objects/DetailedSatellite.js.map +1 -0
  84. package/dist/objects/DetailedSensor.d.ts +42 -0
  85. package/dist/objects/DetailedSensor.js +65 -0
  86. package/dist/objects/DetailedSensor.js.map +1 -0
  87. package/dist/objects/LandObject.d.ts +33 -0
  88. package/dist/objects/LandObject.js +34 -0
  89. package/dist/objects/LandObject.js.map +1 -0
  90. package/dist/objects/Marker.d.ts +20 -0
  91. package/dist/objects/Marker.js +24 -0
  92. package/dist/objects/Marker.js.map +1 -0
  93. package/dist/objects/RfSensor.d.ts +41 -0
  94. package/dist/objects/RfSensor.js +67 -0
  95. package/dist/objects/RfSensor.js.map +1 -0
  96. package/dist/objects/index.d.ts +5 -4
  97. package/dist/objects/index.js +6 -0
  98. package/dist/objects/index.js.map +1 -0
  99. package/dist/observation/Observation.d.ts +89 -0
  100. package/dist/observation/Observation.js +102 -0
  101. package/dist/observation/Observation.js.map +1 -0
  102. package/dist/observation/ObservationOptical.d.ts +48 -0
  103. package/dist/observation/ObservationOptical.js +105 -0
  104. package/dist/observation/ObservationOptical.js.map +1 -0
  105. package/dist/observation/ObservationRadar.d.ts +46 -0
  106. package/dist/observation/ObservationRadar.js +96 -0
  107. package/dist/observation/ObservationRadar.js.map +1 -0
  108. package/dist/observation/ObservationUtils.d.ts +20 -0
  109. package/dist/observation/ObservationUtils.js +32 -0
  110. package/dist/observation/ObservationUtils.js.map +1 -0
  111. package/dist/observation/PropagatorPairs.d.ts +32 -0
  112. package/dist/observation/PropagatorPairs.js +43 -0
  113. package/dist/observation/PropagatorPairs.js.map +1 -0
  114. package/dist/operations/BoxMuller.d.ts +46 -0
  115. package/dist/operations/BoxMuller.js +77 -0
  116. package/dist/operations/BoxMuller.js.map +1 -0
  117. package/dist/operations/EulerAngles.d.ts +105 -0
  118. package/dist/operations/EulerAngles.js +161 -0
  119. package/dist/operations/EulerAngles.js.map +1 -0
  120. package/dist/operations/Quaternion.d.ts +56 -0
  121. package/dist/operations/Quaternion.js +167 -0
  122. package/dist/operations/Quaternion.js.map +1 -0
  123. package/dist/operations/RandomGaussianSource.d.ts +24 -0
  124. package/dist/operations/RandomGaussianSource.js +43 -0
  125. package/dist/operations/RandomGaussianSource.js.map +1 -0
  126. package/dist/operations/index.d.ts +4 -0
  127. package/dist/operations/index.js +5 -0
  128. package/dist/operations/index.js.map +1 -0
  129. package/dist/optimize/ChebyshevCompressor.d.ts +32 -0
  130. package/dist/optimize/ChebyshevCompressor.js +83 -0
  131. package/dist/optimize/ChebyshevCompressor.js.map +1 -0
  132. package/dist/optimize/DownhillSimplex.d.ts +64 -0
  133. package/dist/optimize/DownhillSimplex.js +182 -0
  134. package/dist/optimize/DownhillSimplex.js.map +1 -0
  135. package/dist/optimize/GoldenSection.d.ts +39 -0
  136. package/dist/optimize/GoldenSection.js +55 -0
  137. package/dist/optimize/GoldenSection.js.map +1 -0
  138. package/dist/optimize/PolynomialRegression.d.ts +49 -0
  139. package/dist/optimize/PolynomialRegression.js +83 -0
  140. package/dist/optimize/PolynomialRegression.js.map +1 -0
  141. package/dist/optimize/PolynomicalRegressionResult.d.ts +31 -0
  142. package/dist/optimize/PolynomicalRegressionResult.js +38 -0
  143. package/dist/optimize/PolynomicalRegressionResult.js.map +1 -0
  144. package/dist/optimize/SimpleLinearRegression.d.ts +44 -0
  145. package/dist/optimize/SimpleLinearRegression.js +112 -0
  146. package/dist/optimize/SimpleLinearRegression.js.map +1 -0
  147. package/dist/optimize/SimplexEntry.d.ts +32 -0
  148. package/dist/optimize/SimplexEntry.js +42 -0
  149. package/dist/optimize/SimplexEntry.js.map +1 -0
  150. package/dist/orbit_determination/BatchLeastSquaresOD.d.ts +65 -0
  151. package/dist/orbit_determination/BatchLeastSquaresOD.js +143 -0
  152. package/dist/orbit_determination/BatchLeastSquaresOD.js.map +1 -0
  153. package/dist/orbit_determination/BatchLeastSquaresResult.d.ts +31 -0
  154. package/{lib/objects/space-object.d.ts → dist/orbit_determination/BatchLeastSquaresResult.js} +21 -23
  155. package/dist/orbit_determination/BatchLeastSquaresResult.js.map +1 -0
  156. package/dist/orbit_determination/GibbsIOD.d.ts +38 -0
  157. package/dist/orbit_determination/GibbsIOD.js +76 -0
  158. package/dist/orbit_determination/GibbsIOD.js.map +1 -0
  159. package/dist/orbit_determination/GoodingIOD.d.ts +51 -0
  160. package/dist/orbit_determination/GoodingIOD.js +247 -0
  161. package/dist/orbit_determination/GoodingIOD.js.map +1 -0
  162. package/dist/orbit_determination/HerrickGibbsIOD.d.ts +33 -0
  163. package/dist/orbit_determination/HerrickGibbsIOD.js +50 -0
  164. package/dist/orbit_determination/HerrickGibbsIOD.js.map +1 -0
  165. package/dist/orbit_determination/LambertIOD.d.ts +59 -0
  166. package/dist/orbit_determination/LambertIOD.js +213 -0
  167. package/dist/orbit_determination/LambertIOD.js.map +1 -0
  168. package/dist/orbit_determination/ModifiedGoodingIOD.d.ts +40 -0
  169. package/dist/orbit_determination/ModifiedGoodingIOD.js +83 -0
  170. package/dist/orbit_determination/ModifiedGoodingIOD.js.map +1 -0
  171. package/dist/propagator/DormandPrince54Propagator.d.ts +28 -0
  172. package/dist/propagator/DormandPrince54Propagator.js +64 -0
  173. package/dist/propagator/DormandPrince54Propagator.js.map +1 -0
  174. package/dist/propagator/KeplerPropagator.d.ts +35 -0
  175. package/dist/propagator/KeplerPropagator.js +84 -0
  176. package/dist/propagator/KeplerPropagator.js.map +1 -0
  177. package/dist/propagator/Propagator.d.ts +34 -0
  178. package/dist/propagator/Propagator.js +162 -0
  179. package/dist/propagator/Propagator.js.map +1 -0
  180. package/dist/propagator/RkCheckpoint.d.ts +22 -0
  181. package/dist/propagator/RkCheckpoint.js +27 -0
  182. package/dist/propagator/RkCheckpoint.js.map +1 -0
  183. package/dist/propagator/RkResult.d.ts +23 -0
  184. package/dist/propagator/RkResult.js +30 -0
  185. package/dist/propagator/RkResult.js.map +1 -0
  186. package/dist/propagator/RungeKutta4Propagator.d.ts +50 -0
  187. package/dist/propagator/RungeKutta4Propagator.js +141 -0
  188. package/dist/propagator/RungeKutta4Propagator.js.map +1 -0
  189. package/dist/propagator/RungeKutta89Propagator.d.ts +28 -0
  190. package/dist/propagator/RungeKutta89Propagator.js +126 -0
  191. package/dist/propagator/RungeKutta89Propagator.js.map +1 -0
  192. package/dist/propagator/RungeKuttaAdaptive.d.ts +54 -0
  193. package/dist/propagator/RungeKuttaAdaptive.js +159 -0
  194. package/dist/propagator/RungeKuttaAdaptive.js.map +1 -0
  195. package/dist/propagator/Sgp4Propagator.d.ts +34 -0
  196. package/dist/propagator/Sgp4Propagator.js +56 -0
  197. package/dist/propagator/Sgp4Propagator.js.map +1 -0
  198. package/dist/smoothing/ExponentialSmoothing.d.ts +23 -0
  199. package/dist/smoothing/ExponentialSmoothing.js +81 -0
  200. package/dist/smoothing/ExponentialSmoothing.js.map +1 -0
  201. package/dist/transforms/index.d.ts +1 -0
  202. package/dist/transforms/index.js +2 -0
  203. package/dist/transforms/index.js.map +1 -0
  204. package/dist/transforms/transforms.d.ts +56 -92
  205. package/dist/transforms/transforms.js +94 -0
  206. package/dist/transforms/transforms.js.map +1 -0
  207. package/dist/types/types.d.ts +105 -584
  208. package/dist/types/types.js +23 -0
  209. package/dist/types/types.js.map +1 -0
  210. package/dist/utils/index.d.ts +1 -0
  211. package/dist/utils/index.js +2 -0
  212. package/dist/utils/index.js.map +1 -0
  213. package/dist/utils/jacobian.d.ts +11 -0
  214. package/dist/utils/jacobian.js +29 -0
  215. package/dist/utils/jacobian.js.map +1 -0
  216. package/package.json +34 -42
  217. package/src/coordinate/Hill.ts +326 -0
  218. package/src/coordinate/index.ts +1 -0
  219. package/src/covariance/CovarianceSample.ts +194 -0
  220. package/src/covariance/StateCovariance.ts +69 -0
  221. package/src/force/AtmosphericDrag.ts +101 -0
  222. package/src/force/EarthGravity.ts +157 -0
  223. package/src/force/Force.ts +33 -0
  224. package/src/force/ForceModel.ts +91 -0
  225. package/src/force/Gravity.ts +53 -0
  226. package/src/force/SolarRadiationPressure.ts +42 -0
  227. package/src/force/ThirdBodyGravity.ts +62 -0
  228. package/src/force/Thrust.ts +83 -0
  229. package/src/interfaces/RfSensorParams.ts +30 -0
  230. package/src/interfaces/index.ts +1 -0
  231. package/src/interpolator/ChebyshevCoefficients.ts +109 -0
  232. package/src/interpolator/ChebyshevInterpolator.ts +87 -0
  233. package/src/interpolator/CubicSpline.ts +72 -0
  234. package/src/interpolator/CubicSplineInterpolator.ts +90 -0
  235. package/src/interpolator/FieldInterpolator.ts +37 -0
  236. package/src/interpolator/Interpolator.ts +56 -0
  237. package/src/interpolator/LagrangeInterpolator.ts +192 -0
  238. package/src/interpolator/StateInterpolator.ts +39 -0
  239. package/src/interpolator/VerletBlendInterpolator.ts +146 -0
  240. package/src/main.ts +32 -0
  241. package/src/maneuver/TwoBurnOrbitTransfer.ts +79 -0
  242. package/src/maneuver/Waypoint.ts +267 -0
  243. package/src/objects/DetailedSatellite.ts +159 -0
  244. package/src/objects/DetailedSensor.ts +68 -0
  245. package/src/objects/LandObject.ts +46 -0
  246. package/src/objects/Marker.ts +25 -0
  247. package/src/objects/RfSensor.ts +78 -0
  248. package/src/objects/index.ts +5 -0
  249. package/src/observation/Observation.ts +125 -0
  250. package/src/observation/ObservationOptical.ts +146 -0
  251. package/src/observation/ObservationRadar.ts +131 -0
  252. package/src/observation/ObservationUtils.ts +40 -0
  253. package/src/observation/PropagatorPairs.ts +45 -0
  254. package/src/operations/BoxMuller.ts +87 -0
  255. package/src/operations/EulerAngles.ts +183 -0
  256. package/src/operations/Quaternion.ts +222 -0
  257. package/src/operations/RandomGaussianSource.ts +51 -0
  258. package/src/operations/index.ts +4 -0
  259. package/src/optimize/ChebyshevCompressor.ts +96 -0
  260. package/src/optimize/DownhillSimplex.ts +212 -0
  261. package/src/optimize/GoldenSection.ts +71 -0
  262. package/src/optimize/PolynomialRegression.ts +109 -0
  263. package/src/optimize/PolynomicalRegressionResult.ts +32 -0
  264. package/src/optimize/SimpleLinearRegression.ts +127 -0
  265. package/src/optimize/SimplexEntry.ts +50 -0
  266. package/src/orbit_determination/BatchLeastSquaresOD.ts +174 -0
  267. package/src/orbit_determination/BatchLeastSquaresResult.ts +33 -0
  268. package/src/orbit_determination/GibbsIOD.ts +95 -0
  269. package/src/orbit_determination/GoodingIOD.ts +380 -0
  270. package/src/orbit_determination/HerrickGibbsIOD.ts +51 -0
  271. package/src/orbit_determination/LambertIOD.ts +260 -0
  272. package/src/orbit_determination/ModifiedGoodingIOD.ts +133 -0
  273. package/src/propagator/DormandPrince54Propagator.ts +73 -0
  274. package/src/propagator/KeplerPropagator.ts +102 -0
  275. package/src/propagator/Propagator.ts +253 -0
  276. package/src/propagator/RkCheckpoint.ts +25 -0
  277. package/src/propagator/RkResult.ts +26 -0
  278. package/src/propagator/RungeKutta4Propagator.ts +179 -0
  279. package/src/propagator/RungeKutta89Propagator.ts +132 -0
  280. package/src/propagator/RungeKuttaAdaptive.ts +232 -0
  281. package/src/propagator/Sgp4Propagator.ts +71 -0
  282. package/src/smoothing/ExponentialSmoothing.ts +90 -0
  283. package/src/transforms/index.ts +1 -0
  284. package/src/transforms/transforms.ts +117 -0
  285. package/src/types/types.ts +135 -0
  286. package/src/utils/index.ts +1 -0
  287. package/src/utils/jacobian.ts +38 -0
  288. package/.eslintrc.json +0 -244
  289. package/.prettierrc +0 -17
  290. package/babel.config.js +0 -16
  291. package/codecov.yml +0 -21
  292. package/dist/objects/base-object.d.ts +0 -40
  293. package/dist/objects/detailed-sat.d.ts +0 -66
  294. package/dist/objects/sat.d.ts +0 -92
  295. package/dist/objects/sensor.d.ts +0 -93
  296. package/dist/objects/star.d.ts +0 -46
  297. package/dist/ootk.js +0 -2
  298. package/dist/ootk.js.LICENSE.txt +0 -77
  299. package/dist/sgp4/sgp4.d.ts +0 -82
  300. package/dist/tle/tle-format-data.d.ts +0 -6
  301. package/dist/tle/tle.d.ts +0 -375
  302. package/dist/utils/constants.d.ts +0 -34
  303. package/dist/utils/moon-math.d.ts +0 -113
  304. package/dist/utils/sun-math.d.ts +0 -230
  305. package/dist/utils/utils.d.ts +0 -39
  306. package/jest.config.ts +0 -30
  307. package/lib/objects/base-object.d.ts +0 -40
  308. package/lib/objects/base-object.js +0 -79
  309. package/lib/objects/base-object.js.map +0 -1
  310. package/lib/objects/detailed-sat.js +0 -149
  311. package/lib/objects/detailed-sat.js.map +0 -1
  312. package/lib/objects/index.d.ts +0 -4
  313. package/lib/objects/index.js +0 -5
  314. package/lib/objects/index.js.map +0 -1
  315. package/lib/objects/sat.d.ts +0 -92
  316. package/lib/objects/sat.js +0 -188
  317. package/lib/objects/sat.js.map +0 -1
  318. package/lib/objects/sensor.d.ts +0 -93
  319. package/lib/objects/sensor.js +0 -273
  320. package/lib/objects/sensor.js.map +0 -1
  321. package/lib/objects/space-object.js +0 -60
  322. package/lib/objects/space-object.js.map +0 -1
  323. package/lib/objects/star.d.ts +0 -46
  324. package/lib/objects/star.js +0 -91
  325. package/lib/objects/star.js.map +0 -1
  326. package/lib/ootk.js.map +0 -1
  327. package/lib/sgp4/sgp4.d.ts +0 -82
  328. package/lib/sgp4/sgp4.js +0 -3262
  329. package/lib/sgp4/sgp4.js.map +0 -1
  330. package/lib/tle/tle-format-data.d.ts +0 -6
  331. package/lib/tle/tle-format-data.js +0 -10
  332. package/lib/tle/tle-format-data.js.map +0 -1
  333. package/lib/tle/tle.d.ts +0 -375
  334. package/lib/tle/tle.js +0 -611
  335. package/lib/tle/tle.js.map +0 -1
  336. package/lib/transforms/transforms.d.ts +0 -94
  337. package/lib/transforms/transforms.js +0 -308
  338. package/lib/transforms/transforms.js.map +0 -1
  339. package/lib/types/types.d.ts +0 -605
  340. package/lib/types/types.js +0 -36
  341. package/lib/types/types.js.map +0 -1
  342. package/lib/utils/constants.d.ts +0 -34
  343. package/lib/utils/constants.js +0 -35
  344. package/lib/utils/constants.js.map +0 -1
  345. package/lib/utils/moon-math.d.ts +0 -113
  346. package/lib/utils/moon-math.js +0 -387
  347. package/lib/utils/moon-math.js.map +0 -1
  348. package/lib/utils/sun-math.d.ts +0 -230
  349. package/lib/utils/sun-math.js +0 -422
  350. package/lib/utils/sun-math.js.map +0 -1
  351. package/lib/utils/utils.d.ts +0 -39
  352. package/lib/utils/utils.js +0 -102
  353. package/lib/utils/utils.js.map +0 -1
  354. package/sandbox.html +0 -8
  355. package/tsconfig.base.json +0 -31
  356. package/tsconfig.build.json +0 -14
  357. /package/{LICENSE.MD → LICENSE.md} +0 -0
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { Random, Vector } from 'ootk-core';
18
+ export declare class BoxMuller {
19
+ private _index;
20
+ private _cache;
21
+ mu: number;
22
+ sigma: number;
23
+ rand: Random;
24
+ /**
25
+ * Create a new [BoxMuller] object with mean [mu], standard deviation
26
+ * [sigma], and [seed] number.
27
+ * @param mu Mean value.
28
+ * @param sigma Standard deviation.
29
+ * @param seed Random seed.
30
+ */
31
+ constructor(mu: number, sigma: number, seed?: number);
32
+ _generate(): void;
33
+ /**
34
+ * Generate a gaussian number, with mean [mu] and standard
35
+ * deviation [sigma].
36
+ * @returns A gaussian number.
37
+ */
38
+ nextGauss(): number;
39
+ /**
40
+ * Generate a [Vector] of gaussian numbers, with mean [mu] and standard
41
+ * deviation [sigma].
42
+ * @param n Number of gaussian numbers to generate.
43
+ * @returns A [Vector] of gaussian numbers.
44
+ */
45
+ gaussVector(n: number): Vector;
46
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { Random, TAU, Vector } from 'ootk-core';
18
+ // / Box-Muller random Gaussian number generator.
19
+ export class BoxMuller {
20
+ _index = 0;
21
+ _cache = new Float64Array(2);
22
+ // / Mean value.
23
+ mu;
24
+ // / Standard deviation.
25
+ sigma;
26
+ // / Uniform random number generator.
27
+ rand;
28
+ /**
29
+ * Create a new [BoxMuller] object with mean [mu], standard deviation
30
+ * [sigma], and [seed] number.
31
+ * @param mu Mean value.
32
+ * @param sigma Standard deviation.
33
+ * @param seed Random seed.
34
+ */
35
+ constructor(mu, sigma, seed = 0) {
36
+ this.mu = mu;
37
+ this.sigma = sigma;
38
+ this.rand = new Random(seed);
39
+ this._generate();
40
+ }
41
+ // / Refill the cache with random Gaussian numbers.
42
+ _generate() {
43
+ this._index = 0;
44
+ const u1 = this.rand.nextFloat();
45
+ const u2 = this.rand.nextFloat();
46
+ const mag = this.sigma * Math.sqrt(-2.0 * Math.log(u1));
47
+ this._cache[0] = mag * Math.cos(TAU * u2) + this.mu;
48
+ this._cache[1] = mag * Math.sin(TAU * u2) + this.mu;
49
+ }
50
+ /**
51
+ * Generate a gaussian number, with mean [mu] and standard
52
+ * deviation [sigma].
53
+ * @returns A gaussian number.
54
+ */
55
+ nextGauss() {
56
+ if (this._index > 1) {
57
+ this._generate();
58
+ }
59
+ const result = this._cache[this._index];
60
+ this._index++;
61
+ return result;
62
+ }
63
+ /**
64
+ * Generate a [Vector] of gaussian numbers, with mean [mu] and standard
65
+ * deviation [sigma].
66
+ * @param n Number of gaussian numbers to generate.
67
+ * @returns A [Vector] of gaussian numbers.
68
+ */
69
+ gaussVector(n) {
70
+ const result = new Float64Array(n);
71
+ for (let i = 0; i < n; i++) {
72
+ result[i] = this.nextGauss();
73
+ }
74
+ return new Vector(result);
75
+ }
76
+ }
77
+ //# sourceMappingURL=BoxMuller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoxMuller.js","sourceRoot":"","sources":["../../src/operations/BoxMuller.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEhD,iDAAiD;AACjD,MAAM,OAAO,SAAS;IACZ,MAAM,GAAG,CAAC,CAAC;IACX,MAAM,GAAG,IAAI,YAAY,CAAC,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AAC;QAEd,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,CAAS;QACnB,MAAM,MAAM,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;QAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;YAC1B,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;SAC9B;QAED,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;CACF"}
@@ -0,0 +1,105 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { Degrees, Matrix, Radians, Vector3D } from 'ootk-core';
18
+ export declare class EulerAngles {
19
+ roll: number;
20
+ pitch: number;
21
+ yaw: number;
22
+ /**
23
+ * Create a new EulerAngles object from roll, pitch, and yaw angles in radians.
24
+ * @param roll Roll angle in radians.
25
+ * @param pitch Pitch angle in radians.
26
+ * @param yaw Yaw angle in radians.
27
+ */
28
+ constructor(roll: Radians, pitch: Radians, yaw: Radians);
29
+ /**
30
+ * Create a new EulerAngles object from roll, pitch, and yaw angles.
31
+ * @param rollDeg Roll angle in degrees.
32
+ * @param pitchDeg Pitch angle in degrees.
33
+ * @param yawDeg Yaw angle in degrees.
34
+ * @returns EulerAngles object.
35
+ */
36
+ static fromDegrees(rollDeg: Degrees, pitchDeg: Degrees, yawDeg: Degrees): EulerAngles;
37
+ /**
38
+ * Create a new EulerAngles object from 3-2-1 ordered direction cosine matrix c.
39
+ * @param c 3-2-1 ordered direction cosine matrix.
40
+ * @returns EulerAngles object.
41
+ */
42
+ static fromDcm321(c: Matrix): EulerAngles;
43
+ /**
44
+ * Gets the roll angle in degrees.
45
+ * @returns The roll angle in degrees.
46
+ */
47
+ get rollDegrees(): Degrees;
48
+ /**
49
+ * Gets the pitch angle in degrees.
50
+ * @returns The pitch angle in degrees.
51
+ */
52
+ get pitchDegrees(): Degrees;
53
+ /**
54
+ * Gets the yaw angle in degrees.
55
+ * @returns The yaw angle in degrees.
56
+ */
57
+ get yawDegrees(): Degrees;
58
+ /**
59
+ * Gets the roll angle in radians.
60
+ * @returns The roll angle in radians.
61
+ */
62
+ get phi(): Radians;
63
+ /**
64
+ * Gets the pitch angle in radians.
65
+ * @returns The pitch angle in radians.
66
+ */
67
+ get theta(): Radians;
68
+ /**
69
+ * Gets the yaw angle in radians.
70
+ * @returns The yaw angle in radians.
71
+ */
72
+ get psi(): Radians;
73
+ /**
74
+ * Gets the roll component in degrees.
75
+ * @returns The roll component in degrees.
76
+ */
77
+ get phiDegrees(): Degrees;
78
+ /**
79
+ * Gets the pitch component in degrees.
80
+ * @returns The pitch component in degrees.
81
+ */
82
+ get thetaDegrees(): Degrees;
83
+ /**
84
+ * Gets the yaw component in degrees.
85
+ * @returns The yaw component in degrees.
86
+ */
87
+ get psiDegrees(): Degrees;
88
+ /**
89
+ * Returns a string representation of the Euler angles.
90
+ * @param precision The number of decimal places to include in the string representation. Default is 6.
91
+ * @returns A string representation of the Euler angles.
92
+ */
93
+ toString(precision?: number): string;
94
+ /**
95
+ * Calculates the Direction Cosine Matrix (DCM) using the 3-2-1 Euler angles convention.
96
+ * @returns The calculated DCM as a Matrix object.
97
+ */
98
+ dcm321(): Matrix;
99
+ /**
100
+ * Rotates a 3D vector using a 3-2-1 Euler angle sequence.
101
+ * @param v The vector to rotate.
102
+ * @returns The rotated vector.
103
+ */
104
+ rotateVector321(v: Vector3D): Vector3D;
105
+ }
@@ -0,0 +1,161 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { DEG2RAD, Matrix, RAD2DEG } from 'ootk-core';
18
+ // / Class containing Euler angles.
19
+ export class EulerAngles {
20
+ // / Roll component _(rad)_.
21
+ roll;
22
+ // / Pitch component _(rad)_.
23
+ pitch;
24
+ // / Yaw component _(rad)_.
25
+ yaw;
26
+ /**
27
+ * Create a new EulerAngles object from roll, pitch, and yaw angles in radians.
28
+ * @param roll Roll angle in radians.
29
+ * @param pitch Pitch angle in radians.
30
+ * @param yaw Yaw angle in radians.
31
+ */
32
+ constructor(roll, pitch, yaw) {
33
+ this.roll = roll;
34
+ this.pitch = pitch;
35
+ this.yaw = yaw;
36
+ }
37
+ /**
38
+ * Create a new EulerAngles object from roll, pitch, and yaw angles.
39
+ * @param rollDeg Roll angle in degrees.
40
+ * @param pitchDeg Pitch angle in degrees.
41
+ * @param yawDeg Yaw angle in degrees.
42
+ * @returns EulerAngles object.
43
+ */
44
+ static fromDegrees(rollDeg, pitchDeg, yawDeg) {
45
+ const roll = rollDeg * DEG2RAD;
46
+ const pitch = pitchDeg * DEG2RAD;
47
+ const yaw = yawDeg * DEG2RAD;
48
+ return new EulerAngles(roll, pitch, yaw);
49
+ }
50
+ /**
51
+ * Create a new EulerAngles object from 3-2-1 ordered direction cosine matrix c.
52
+ * @param c 3-2-1 ordered direction cosine matrix.
53
+ * @returns EulerAngles object.
54
+ */
55
+ static fromDcm321(c) {
56
+ const roll = Math.atan(c.elements[1][2] / c.elements[2][2]);
57
+ const pitch = -Math.asin(c.elements[0][2]);
58
+ const yaw = Math.atan(c.elements[0][1] / c.elements[0][0]);
59
+ return new EulerAngles(roll, pitch, yaw);
60
+ }
61
+ /**
62
+ * Gets the roll angle in degrees.
63
+ * @returns The roll angle in degrees.
64
+ */
65
+ get rollDegrees() {
66
+ return this.roll * RAD2DEG;
67
+ }
68
+ /**
69
+ * Gets the pitch angle in degrees.
70
+ * @returns The pitch angle in degrees.
71
+ */
72
+ get pitchDegrees() {
73
+ return this.pitch * RAD2DEG;
74
+ }
75
+ /**
76
+ * Gets the yaw angle in degrees.
77
+ * @returns The yaw angle in degrees.
78
+ */
79
+ get yawDegrees() {
80
+ return this.yaw * RAD2DEG;
81
+ }
82
+ /**
83
+ * Gets the roll angle in radians.
84
+ * @returns The roll angle in radians.
85
+ */
86
+ get phi() {
87
+ return this.roll;
88
+ }
89
+ /**
90
+ * Gets the pitch angle in radians.
91
+ * @returns The pitch angle in radians.
92
+ */
93
+ get theta() {
94
+ return this.pitch;
95
+ }
96
+ /**
97
+ * Gets the yaw angle in radians.
98
+ * @returns The yaw angle in radians.
99
+ */
100
+ get psi() {
101
+ return this.yaw;
102
+ }
103
+ /**
104
+ * Gets the roll component in degrees.
105
+ * @returns The roll component in degrees.
106
+ */
107
+ get phiDegrees() {
108
+ return this.phi * RAD2DEG;
109
+ }
110
+ /**
111
+ * Gets the pitch component in degrees.
112
+ * @returns The pitch component in degrees.
113
+ */
114
+ get thetaDegrees() {
115
+ return this.theta * RAD2DEG;
116
+ }
117
+ /**
118
+ * Gets the yaw component in degrees.
119
+ * @returns The yaw component in degrees.
120
+ */
121
+ get psiDegrees() {
122
+ return this.psi * RAD2DEG;
123
+ }
124
+ /**
125
+ * Returns a string representation of the Euler angles.
126
+ * @param precision The number of decimal places to include in the string representation. Default is 6.
127
+ * @returns A string representation of the Euler angles.
128
+ */
129
+ toString(precision = 6) {
130
+ const rollStr = this.rollDegrees.toFixed(precision);
131
+ const pitchStr = this.pitchDegrees.toFixed(precision);
132
+ const yawStr = this.yawDegrees.toFixed(precision);
133
+ return `Euler(roll: ${rollStr}°, pitch: ${pitchStr}°, yaw: ${yawStr}°)`;
134
+ }
135
+ /**
136
+ * Calculates the Direction Cosine Matrix (DCM) using the 3-2-1 Euler angles convention.
137
+ * @returns The calculated DCM as a Matrix object.
138
+ */
139
+ dcm321() {
140
+ const sPhi = Math.sin(this.phi);
141
+ const cPhi = Math.cos(this.phi);
142
+ const sTheta = Math.sin(this.theta);
143
+ const cTheta = Math.cos(this.theta);
144
+ const sPsi = Math.sin(this.psi);
145
+ const cPsi = Math.cos(this.psi);
146
+ return new Matrix([
147
+ [cTheta * cPsi, cTheta * sPsi, -sTheta],
148
+ [sPhi * sTheta * cPsi - cPhi * sPsi, sPhi * sTheta * sPsi + cPhi * cPsi, sPhi * cTheta],
149
+ [cPhi * sTheta * cPsi + sPhi * sPsi, cPhi * sTheta * sPsi - sPhi * cPsi, cPhi * cTheta],
150
+ ]);
151
+ }
152
+ /**
153
+ * Rotates a 3D vector using a 3-2-1 Euler angle sequence.
154
+ * @param v The vector to rotate.
155
+ * @returns The rotated vector.
156
+ */
157
+ rotateVector321(v) {
158
+ return this.dcm321().multiplyVector3D(v);
159
+ }
160
+ }
161
+ //# sourceMappingURL=EulerAngles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EulerAngles.js","sourceRoot":"","sources":["../../src/operations/EulerAngles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,O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;;;OAGG;IACH,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEhC,OAAO,IAAI,MAAM,CAAC;YAChB,CAAC,MAAM,GAAG,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC;YACvC,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;YACvF,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG,MAAM,CAAC;SACxF,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,eAAe,CAAC,CAAW;QACzB,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { Matrix, Radians, RadiansPerSecond, Vector, Vector3D } from 'ootk-core';
18
+ export declare class Quaternion {
19
+ x: number;
20
+ y: number;
21
+ z: number;
22
+ w: number;
23
+ constructor(x: number, y: number, z: number, w: number);
24
+ static zero: Quaternion;
25
+ static one: Quaternion;
26
+ static xAxis: Quaternion;
27
+ static yAxis: Quaternion;
28
+ static zAxis: Quaternion;
29
+ toString(precision?: number): string;
30
+ positivePolar(): Quaternion;
31
+ magnitudeSquared(): number;
32
+ magnitude(): number;
33
+ scale(n: number): Quaternion;
34
+ negate(): Quaternion;
35
+ normalize(): Quaternion;
36
+ conjugate(): Quaternion;
37
+ inverse(): Quaternion;
38
+ add(q: Quaternion): Quaternion;
39
+ subtract(q: Quaternion): Quaternion;
40
+ addReal(n: number): Quaternion;
41
+ multiply(q: Quaternion): Quaternion;
42
+ dot(q: Quaternion): number;
43
+ rotateVector(v: Vector): Vector;
44
+ rotateVector3D(v: Vector3D): Vector3D;
45
+ lerp(q: Quaternion, t: number): Quaternion;
46
+ slerp(q: Quaternion, t: number): Quaternion;
47
+ toVector3D(): Vector3D;
48
+ angle(q: Quaternion): Radians;
49
+ geodesicAngle(q: Quaternion): Radians;
50
+ distance(q: Quaternion): number;
51
+ delta(qTo: Quaternion): Quaternion;
52
+ toDirectionCosineMatrix(): Matrix;
53
+ toRotationMatrix(): Matrix;
54
+ vectorAngle(observer: Vector3D, target: Vector3D, forward: Vector3D): number;
55
+ kinematics(angularVelocity: Vector3D<RadiansPerSecond>): Quaternion;
56
+ }
@@ -0,0 +1,167 @@
1
+ /**
2
+ * @author @thkruz Theodore Kruczek
3
+ * @license AGPL-3.0-or-later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { Matrix, Vector, Vector3D, wrapAngle } from 'ootk-core';
18
+ export class Quaternion {
19
+ x;
20
+ y;
21
+ z;
22
+ w;
23
+ constructor(x, y, z, w) {
24
+ this.x = x;
25
+ this.y = y;
26
+ this.z = z;
27
+ this.w = w;
28
+ }
29
+ static zero = new Quaternion(0, 0, 0, 0);
30
+ static one = new Quaternion(0, 0, 0, 1);
31
+ static xAxis = new Quaternion(1, 0, 0, 0);
32
+ static yAxis = new Quaternion(0, 1, 0, 0);
33
+ static zAxis = new Quaternion(0, 0, 1, 0);
34
+ toString(precision = 8) {
35
+ const xStr = this.x.toFixed(precision);
36
+ const yStr = this.y.toFixed(precision);
37
+ const zStr = this.z.toFixed(precision);
38
+ const wStr = this.w.toFixed(precision);
39
+ return `Q(x: ${xStr}, y: ${yStr}, z: ${zStr}, w: ${wStr})`;
40
+ }
41
+ positivePolar() {
42
+ return this.w >= 0 ? this.normalize() : this.negate().normalize();
43
+ }
44
+ magnitudeSquared() {
45
+ return this.w * this.w + this.x * this.x + this.y * this.y + this.z * this.z;
46
+ }
47
+ magnitude() {
48
+ return Math.sqrt(this.magnitudeSquared());
49
+ }
50
+ scale(n) {
51
+ return new Quaternion(n * this.x, n * this.y, n * this.z, n * this.w);
52
+ }
53
+ negate() {
54
+ return this.scale(-1);
55
+ }
56
+ normalize() {
57
+ const m = this.magnitude();
58
+ if (m === 0) {
59
+ return Quaternion.zero;
60
+ }
61
+ return this.scale(1 / m);
62
+ }
63
+ conjugate() {
64
+ return new Quaternion(-this.x, -this.y, -this.z, this.w);
65
+ }
66
+ inverse() {
67
+ return this.conjugate().scale(1 / this.magnitudeSquared());
68
+ }
69
+ add(q) {
70
+ return new Quaternion(this.x + q.x, this.y + q.y, this.z + q.z, this.w + q.w);
71
+ }
72
+ subtract(q) {
73
+ return new Quaternion(this.x - q.x, this.y - q.y, this.z - q.z, this.w - q.w);
74
+ }
75
+ addReal(n) {
76
+ return new Quaternion(this.x, this.y, this.z, this.w + n);
77
+ }
78
+ multiply(q) {
79
+ const mx = this.w * q.x + this.x * q.w + this.y * q.z - this.z * q.y;
80
+ const my = this.w * q.y - this.x * q.z + this.y * q.w + this.z * q.x;
81
+ const mz = this.w * q.z + this.x * q.y - this.y * q.x + this.z * q.w;
82
+ const mw = this.w * q.w - this.x * q.x - this.y * q.y - this.z * q.z;
83
+ return new Quaternion(mx, my, mz, mw);
84
+ }
85
+ dot(q) {
86
+ return this.x * q.x + this.y * q.y + this.z * q.z + this.w * q.w;
87
+ }
88
+ rotateVector(v) {
89
+ const q = this.multiply(new Quaternion(v.x, v.y, v.z, 0)).multiply(this.conjugate());
90
+ return new Vector([q.x, q.y, q.z]);
91
+ }
92
+ rotateVector3D(v) {
93
+ const q = this.multiply(new Quaternion(v.x, v.y, v.z, 0)).multiply(this.conjugate());
94
+ return new Vector3D(q.x, q.y, q.z);
95
+ }
96
+ lerp(q, t) {
97
+ const f = 1.0 - t;
98
+ return new Quaternion(f * this.x + t * q.x, f * this.y + t * q.y, f * this.z + t * q.z, f * this.w + t * q.w).positivePolar();
99
+ }
100
+ slerp(q, t) {
101
+ let qp = q;
102
+ let dotP = this.dot(qp);
103
+ if (dotP < 0) {
104
+ dotP = -dotP;
105
+ qp = qp.negate();
106
+ }
107
+ if (dotP > 0.9995) {
108
+ return this.lerp(qp, t);
109
+ }
110
+ const theta = Math.acos(dotP);
111
+ const sinTheta = Math.sin(theta);
112
+ const f1 = Math.sin((1.0 - t) * theta) / sinTheta;
113
+ const f2 = Math.sin(t * theta) / sinTheta;
114
+ return new Quaternion(f1 * this.x + f2 * qp.x, f1 * this.y + f2 * qp.y, f1 * this.z + f2 * qp.z, f1 * this.w + f2 * qp.w).positivePolar();
115
+ }
116
+ toVector3D() {
117
+ return new Vector3D(this.x, this.y, this.z);
118
+ }
119
+ angle(q) {
120
+ const c = this.multiply(q.conjugate()).normalize();
121
+ return 2 * Math.atan2(c.toVector3D().magnitude(), c.w);
122
+ }
123
+ geodesicAngle(q) {
124
+ const p = this.dot(q);
125
+ return wrapAngle(Math.acos(2 * p * p - 1.0));
126
+ }
127
+ distance(q) {
128
+ const m01 = this.subtract(q).magnitude();
129
+ const p01 = this.add(q).magnitude();
130
+ return m01 < p01 ? m01 : p01;
131
+ }
132
+ delta(qTo) {
133
+ return this.inverse().multiply(qTo);
134
+ }
135
+ toDirectionCosineMatrix() {
136
+ const w2 = this.w * this.w;
137
+ const x2 = this.x * this.x;
138
+ const y2 = this.y * this.y;
139
+ const z2 = this.z * this.z;
140
+ const m = [
141
+ [w2 + x2 - y2 - z2, 2.0 * (this.x * this.y + this.z * this.w), 2.0 * (this.x * this.z - this.y * this.w)],
142
+ [2.0 * (this.x * this.y - this.z * this.w), w2 - x2 + y2 - z2, 2.0 * (this.y * this.z + this.x * this.w)],
143
+ [2.0 * (this.x * this.z + this.y * this.w), 2.0 * (this.y * this.z - this.x * this.w), w2 - x2 - y2 + z2],
144
+ ];
145
+ return new Matrix(m);
146
+ }
147
+ toRotationMatrix() {
148
+ return this.toDirectionCosineMatrix().transpose();
149
+ }
150
+ vectorAngle(observer, target, forward) {
151
+ const delta = target.subtract(observer);
152
+ const transform = this.toDirectionCosineMatrix().multiplyVector3D(delta);
153
+ return forward.angle(transform);
154
+ }
155
+ kinematics(angularVelocity) {
156
+ const wPrime = new Vector([0, angularVelocity.x, angularVelocity.y, angularVelocity.z]);
157
+ const qMat = new Matrix([
158
+ [this.x, this.w, -this.z, this.y],
159
+ [this.y, this.z, this.w, -this.x],
160
+ [this.z, -this.y, this.x, this.w],
161
+ [this.w, -this.x, -this.y, -this.z],
162
+ ]);
163
+ const result = qMat.multiplyVector(wPrime).scale(0.5).elements;
164
+ return new Quaternion(result[0], result[1], result[2], result[3]);
165
+ }
166
+ }
167
+ //# sourceMappingURL=Quaternion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Quaternion.js","sourceRoot":"","sources":["../../src/operations/Quaternion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAA6B,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3F,MAAM,OAAO,UAAU;IACrB,CAAC,CAAS;IACV,CAAC,CAAS;IACV,CAAC,CAAS;IACV,CAAC,CAAS;IAEV,YAAY,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QACpD,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IAED,MAAM,CAAC,IAAI,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACzC,MAAM,CAAC,GAAG,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1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later
4
+ * @copyright (c) 2020-2024 Theodore Kruczek
5
+ *
6
+ * Orbital Object ToolKit is free software: you can redistribute it and/or modify it under the
7
+ * terms of the GNU Affero General Public License as published by the Free Software
8
+ * Foundation, either version 3 of the License, or (at your option) any later version.
9
+ *
10
+ * Orbital Object ToolKit is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
+ * See the GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License along with
15
+ * Orbital Object ToolKit. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ import { Vector, Vector3D } from 'ootk-core';
18
+ export declare class RandomGaussianSource {
19
+ private _boxMuller;
20
+ constructor(seed?: number);
21
+ nextGauss(): number;
22
+ gaussVector(n: number): Vector;
23
+ gaussSphere(radius?: number): Vector3D;
24
+ }