@ac-kit/math-geometry 0.2.2 → 0.3.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 (371) hide show
  1. package/CHANGELOG.md +228 -0
  2. package/README.md +323 -52
  3. package/dist/_brand.d.ts +14 -0
  4. package/dist/_brand.d.ts.map +1 -0
  5. package/dist/_brand.js +2 -0
  6. package/dist/_brand.js.map +1 -0
  7. package/dist/_ear-clipping.d.ts +20 -0
  8. package/dist/_ear-clipping.d.ts.map +1 -0
  9. package/dist/_ear-clipping.js +360 -0
  10. package/dist/_ear-clipping.js.map +1 -0
  11. package/dist/_ray3-intersect.d.ts +19 -0
  12. package/dist/_ray3-intersect.d.ts.map +1 -0
  13. package/dist/_ray3-intersect.js +122 -0
  14. package/dist/_ray3-intersect.js.map +1 -0
  15. package/dist/box2-array-boundary.d.ts +50 -0
  16. package/dist/box2-array-boundary.d.ts.map +1 -0
  17. package/dist/box2-array-boundary.js +97 -0
  18. package/dist/box2-array-boundary.js.map +1 -0
  19. package/dist/box2-array.d.ts +42 -0
  20. package/dist/box2-array.d.ts.map +1 -0
  21. package/dist/box2-array.js +134 -0
  22. package/dist/box2-array.js.map +1 -0
  23. package/dist/box2-componentwise.d.ts +110 -0
  24. package/dist/box2-componentwise.d.ts.map +1 -0
  25. package/dist/box2-componentwise.js +325 -0
  26. package/dist/box2-componentwise.js.map +1 -0
  27. package/dist/box2-grid-index.d.ts +67 -0
  28. package/dist/box2-grid-index.d.ts.map +1 -0
  29. package/dist/box2-grid-index.js +198 -0
  30. package/dist/box2-grid-index.js.map +1 -0
  31. package/dist/box2-record.d.ts +83 -0
  32. package/dist/box2-record.d.ts.map +1 -0
  33. package/dist/box2-record.js +124 -0
  34. package/dist/box2-record.js.map +1 -0
  35. package/dist/box2.d.ts +38 -0
  36. package/dist/box2.d.ts.map +1 -0
  37. package/dist/box2.js +97 -0
  38. package/dist/box2.js.map +1 -0
  39. package/dist/box3-array-boundary.d.ts +50 -0
  40. package/dist/box3-array-boundary.d.ts.map +1 -0
  41. package/dist/box3-array-boundary.js +107 -0
  42. package/dist/box3-array-boundary.js.map +1 -0
  43. package/dist/box3-componentwise.d.ts +110 -0
  44. package/dist/box3-componentwise.d.ts.map +1 -0
  45. package/dist/box3-componentwise.js +392 -0
  46. package/dist/box3-componentwise.js.map +1 -0
  47. package/dist/box3-record.d.ts +92 -0
  48. package/dist/box3-record.d.ts.map +1 -0
  49. package/dist/box3-record.js +147 -0
  50. package/dist/box3-record.js.map +1 -0
  51. package/dist/box3.d.ts +19 -16
  52. package/dist/box3.d.ts.map +1 -1
  53. package/dist/box3.js +73 -76
  54. package/dist/box3.js.map +1 -1
  55. package/dist/box4-array-boundary.d.ts +50 -0
  56. package/dist/box4-array-boundary.d.ts.map +1 -0
  57. package/dist/box4-array-boundary.js +117 -0
  58. package/dist/box4-array-boundary.js.map +1 -0
  59. package/dist/box4-componentwise.d.ts +110 -0
  60. package/dist/box4-componentwise.d.ts.map +1 -0
  61. package/dist/box4-componentwise.js +459 -0
  62. package/dist/box4-componentwise.js.map +1 -0
  63. package/dist/box4-record.d.ts +96 -0
  64. package/dist/box4-record.d.ts.map +1 -0
  65. package/dist/box4-record.js +167 -0
  66. package/dist/box4-record.js.map +1 -0
  67. package/dist/box4.d.ts +13 -8
  68. package/dist/box4.d.ts.map +1 -1
  69. package/dist/box4.js +27 -5
  70. package/dist/box4.js.map +1 -1
  71. package/dist/circle2-array-boundary.d.ts +51 -0
  72. package/dist/circle2-array-boundary.d.ts.map +1 -0
  73. package/dist/circle2-array-boundary.js +93 -0
  74. package/dist/circle2-array-boundary.js.map +1 -0
  75. package/dist/circle2-array.d.ts +17 -0
  76. package/dist/circle2-array.d.ts.map +1 -0
  77. package/dist/circle2-array.js +44 -0
  78. package/dist/circle2-array.js.map +1 -0
  79. package/dist/circle2-record.d.ts +81 -0
  80. package/dist/circle2-record.d.ts.map +1 -0
  81. package/dist/circle2-record.js +114 -0
  82. package/dist/circle2-record.js.map +1 -0
  83. package/dist/circle2.d.ts +27 -82
  84. package/dist/circle2.d.ts.map +1 -1
  85. package/dist/circle2.js +59 -104
  86. package/dist/circle2.js.map +1 -1
  87. package/dist/coordinates/cylindrical-record.d.ts +86 -0
  88. package/dist/coordinates/cylindrical-record.d.ts.map +1 -0
  89. package/dist/coordinates/cylindrical-record.js +114 -0
  90. package/dist/coordinates/cylindrical-record.js.map +1 -0
  91. package/dist/coordinates/horizontal-record.d.ts +86 -0
  92. package/dist/coordinates/horizontal-record.d.ts.map +1 -0
  93. package/dist/coordinates/horizontal-record.js +114 -0
  94. package/dist/coordinates/horizontal-record.js.map +1 -0
  95. package/dist/coordinates/horizontal.d.ts +48 -0
  96. package/dist/coordinates/horizontal.d.ts.map +1 -0
  97. package/dist/coordinates/horizontal.js +100 -0
  98. package/dist/coordinates/horizontal.js.map +1 -0
  99. package/dist/coordinates/index.d.ts +10 -0
  100. package/dist/coordinates/index.d.ts.map +1 -0
  101. package/dist/coordinates/index.js +10 -0
  102. package/dist/coordinates/index.js.map +1 -0
  103. package/dist/coordinates/longitude-latitude-record.d.ts +81 -0
  104. package/dist/coordinates/longitude-latitude-record.d.ts.map +1 -0
  105. package/dist/coordinates/longitude-latitude-record.js +104 -0
  106. package/dist/coordinates/longitude-latitude-record.js.map +1 -0
  107. package/dist/coordinates/longitude-latitude.d.ts +33 -0
  108. package/dist/coordinates/longitude-latitude.d.ts.map +1 -0
  109. package/dist/coordinates/longitude-latitude.js +78 -0
  110. package/dist/coordinates/longitude-latitude.js.map +1 -0
  111. package/dist/coordinates/polar-record.d.ts +77 -0
  112. package/dist/coordinates/polar-record.d.ts.map +1 -0
  113. package/dist/coordinates/polar-record.js +104 -0
  114. package/dist/coordinates/polar-record.js.map +1 -0
  115. package/dist/coordinates/polar.d.ts +28 -0
  116. package/dist/coordinates/polar.d.ts.map +1 -0
  117. package/dist/coordinates/polar.js +68 -0
  118. package/dist/coordinates/polar.js.map +1 -0
  119. package/dist/coordinates/spherical-cylindrical.d.ts +49 -0
  120. package/dist/coordinates/spherical-cylindrical.d.ts.map +1 -0
  121. package/dist/coordinates/spherical-cylindrical.js +110 -0
  122. package/dist/coordinates/spherical-cylindrical.js.map +1 -0
  123. package/dist/coordinates/spherical-record.d.ts +86 -0
  124. package/dist/coordinates/spherical-record.d.ts.map +1 -0
  125. package/dist/coordinates/spherical-record.js +114 -0
  126. package/dist/coordinates/spherical-record.js.map +1 -0
  127. package/dist/frustum3-record.d.ts +132 -0
  128. package/dist/frustum3-record.d.ts.map +1 -0
  129. package/dist/frustum3-record.js +333 -0
  130. package/dist/frustum3-record.js.map +1 -0
  131. package/dist/frustum3.d.ts +60 -0
  132. package/dist/frustum3.d.ts.map +1 -0
  133. package/dist/frustum3.js +186 -0
  134. package/dist/frustum3.js.map +1 -0
  135. package/dist/index.d.ts +36 -16
  136. package/dist/index.d.ts.map +1 -1
  137. package/dist/index.js +36 -16
  138. package/dist/index.js.map +1 -1
  139. package/dist/line2-record.d.ts +87 -0
  140. package/dist/line2-record.d.ts.map +1 -0
  141. package/dist/line2-record.js +123 -0
  142. package/dist/line2-record.js.map +1 -0
  143. package/dist/line2.d.ts +20 -33
  144. package/dist/line2.d.ts.map +1 -1
  145. package/dist/line2.js +56 -51
  146. package/dist/line2.js.map +1 -1
  147. package/dist/line3-record.d.ts +91 -0
  148. package/dist/line3-record.d.ts.map +1 -0
  149. package/dist/line3-record.js +146 -0
  150. package/dist/line3-record.js.map +1 -0
  151. package/dist/line3.d.ts +11 -24
  152. package/dist/line3.d.ts.map +1 -1
  153. package/dist/line3.js +32 -36
  154. package/dist/line3.js.map +1 -1
  155. package/dist/mesh/_generator-kit.d.ts +14 -0
  156. package/dist/mesh/_generator-kit.d.ts.map +1 -0
  157. package/dist/mesh/_generator-kit.js +39 -0
  158. package/dist/mesh/_generator-kit.js.map +1 -0
  159. package/dist/mesh/_index-kernels-u16.d.ts +43 -0
  160. package/dist/mesh/_index-kernels-u16.d.ts.map +1 -0
  161. package/dist/mesh/_index-kernels-u16.js +264 -0
  162. package/dist/mesh/_index-kernels-u16.js.map +1 -0
  163. package/dist/mesh/_index-kernels-u32.d.ts +43 -0
  164. package/dist/mesh/_index-kernels-u32.d.ts.map +1 -0
  165. package/dist/mesh/_index-kernels-u32.js +264 -0
  166. package/dist/mesh/_index-kernels-u32.js.map +1 -0
  167. package/dist/mesh/generate-box.d.ts +16 -0
  168. package/dist/mesh/generate-box.d.ts.map +1 -0
  169. package/dist/mesh/generate-box.js +79 -0
  170. package/dist/mesh/generate-box.js.map +1 -0
  171. package/dist/mesh/generate-cylinder.d.ts +25 -0
  172. package/dist/mesh/generate-cylinder.d.ts.map +1 -0
  173. package/dist/mesh/generate-cylinder.js +117 -0
  174. package/dist/mesh/generate-cylinder.js.map +1 -0
  175. package/dist/mesh/generate-heightfield.d.ts +24 -0
  176. package/dist/mesh/generate-heightfield.d.ts.map +1 -0
  177. package/dist/mesh/generate-heightfield.js +48 -0
  178. package/dist/mesh/generate-heightfield.js.map +1 -0
  179. package/dist/mesh/generate-plane.d.ts +18 -0
  180. package/dist/mesh/generate-plane.d.ts.map +1 -0
  181. package/dist/mesh/generate-plane.js +39 -0
  182. package/dist/mesh/generate-plane.js.map +1 -0
  183. package/dist/mesh/generate-sphere.d.ts +50 -0
  184. package/dist/mesh/generate-sphere.d.ts.map +1 -0
  185. package/dist/mesh/generate-sphere.js +244 -0
  186. package/dist/mesh/generate-sphere.js.map +1 -0
  187. package/dist/mesh/index.d.ts +8 -0
  188. package/dist/mesh/index.d.ts.map +1 -0
  189. package/dist/mesh/index.js +8 -0
  190. package/dist/mesh/index.js.map +1 -0
  191. package/dist/mesh/mesh3-kernels.d.ts +82 -0
  192. package/dist/mesh/mesh3-kernels.d.ts.map +1 -0
  193. package/dist/mesh/mesh3-kernels.js +180 -0
  194. package/dist/mesh/mesh3-kernels.js.map +1 -0
  195. package/dist/mesh/mesh3.d.ts +66 -0
  196. package/dist/mesh/mesh3.d.ts.map +1 -0
  197. package/dist/mesh/mesh3.js +128 -0
  198. package/dist/mesh/mesh3.js.map +1 -0
  199. package/dist/plane3-record.d.ts +88 -0
  200. package/dist/plane3-record.d.ts.map +1 -0
  201. package/dist/plane3-record.js +123 -0
  202. package/dist/plane3-record.js.map +1 -0
  203. package/dist/plane3.d.ts +42 -28
  204. package/dist/plane3.d.ts.map +1 -1
  205. package/dist/plane3.js +166 -48
  206. package/dist/plane3.js.map +1 -1
  207. package/dist/polygon2.d.ts +82 -29
  208. package/dist/polygon2.d.ts.map +1 -1
  209. package/dist/polygon2.js +236 -93
  210. package/dist/polygon2.js.map +1 -1
  211. package/dist/polygon3.d.ts +40 -21
  212. package/dist/polygon3.d.ts.map +1 -1
  213. package/dist/polygon3.js +215 -91
  214. package/dist/polygon3.js.map +1 -1
  215. package/dist/polyline2.d.ts +37 -0
  216. package/dist/polyline2.d.ts.map +1 -0
  217. package/dist/polyline2.js +146 -0
  218. package/dist/polyline2.js.map +1 -0
  219. package/dist/polyline3.d.ts +35 -0
  220. package/dist/polyline3.d.ts.map +1 -0
  221. package/dist/polyline3.js +159 -0
  222. package/dist/polyline3.js.map +1 -0
  223. package/dist/quadtree.d.ts +238 -0
  224. package/dist/quadtree.d.ts.map +1 -0
  225. package/dist/quadtree.js +1019 -0
  226. package/dist/quadtree.js.map +1 -0
  227. package/dist/ray2-record.d.ts +86 -0
  228. package/dist/ray2-record.d.ts.map +1 -0
  229. package/dist/ray2-record.js +123 -0
  230. package/dist/ray2-record.js.map +1 -0
  231. package/dist/ray2.d.ts +38 -13
  232. package/dist/ray2.d.ts.map +1 -1
  233. package/dist/ray2.js +85 -22
  234. package/dist/ray2.js.map +1 -1
  235. package/dist/ray3-array.d.ts +27 -0
  236. package/dist/ray3-array.d.ts.map +1 -0
  237. package/dist/ray3-array.js +89 -0
  238. package/dist/ray3-array.js.map +1 -0
  239. package/dist/ray3-record.d.ts +90 -0
  240. package/dist/ray3-record.d.ts.map +1 -0
  241. package/dist/ray3-record.js +146 -0
  242. package/dist/ray3-record.js.map +1 -0
  243. package/dist/ray3.d.ts +72 -25
  244. package/dist/ray3.d.ts.map +1 -1
  245. package/dist/ray3.js +233 -64
  246. package/dist/ray3.js.map +1 -1
  247. package/dist/segment2-record.d.ts +80 -0
  248. package/dist/segment2-record.d.ts.map +1 -0
  249. package/dist/segment2-record.js +122 -0
  250. package/dist/segment2-record.js.map +1 -0
  251. package/dist/segment2.d.ts +34 -19
  252. package/dist/segment2.d.ts.map +1 -1
  253. package/dist/segment2.js +88 -42
  254. package/dist/segment2.js.map +1 -1
  255. package/dist/segment3-record.d.ts +90 -0
  256. package/dist/segment3-record.d.ts.map +1 -0
  257. package/dist/segment3-record.js +146 -0
  258. package/dist/segment3-record.js.map +1 -0
  259. package/dist/segment3.d.ts +24 -12
  260. package/dist/segment3.d.ts.map +1 -1
  261. package/dist/segment3.js +67 -30
  262. package/dist/segment3.js.map +1 -1
  263. package/dist/size.d.ts +40 -0
  264. package/dist/size.d.ts.map +1 -0
  265. package/dist/size.js +72 -0
  266. package/dist/size.js.map +1 -0
  267. package/dist/sphere3-array-boundary.d.ts +51 -0
  268. package/dist/sphere3-array-boundary.d.ts.map +1 -0
  269. package/dist/sphere3-array-boundary.js +98 -0
  270. package/dist/sphere3-array-boundary.js.map +1 -0
  271. package/dist/sphere3-record.d.ts +88 -0
  272. package/dist/sphere3-record.d.ts.map +1 -0
  273. package/dist/sphere3-record.js +123 -0
  274. package/dist/sphere3-record.js.map +1 -0
  275. package/dist/sphere3.d.ts +55 -12
  276. package/dist/sphere3.d.ts.map +1 -1
  277. package/dist/sphere3.js +233 -24
  278. package/dist/sphere3.js.map +1 -1
  279. package/dist/spherical/cap.d.ts +56 -0
  280. package/dist/spherical/cap.d.ts.map +1 -0
  281. package/dist/spherical/cap.js +363 -0
  282. package/dist/spherical/cap.js.map +1 -0
  283. package/dist/spherical/great-circle.d.ts +39 -0
  284. package/dist/spherical/great-circle.d.ts.map +1 -0
  285. package/dist/spherical/great-circle.js +158 -0
  286. package/dist/spherical/great-circle.js.map +1 -0
  287. package/dist/spherical/index.d.ts +3 -0
  288. package/dist/spherical/index.d.ts.map +1 -0
  289. package/dist/spherical/index.js +3 -0
  290. package/dist/spherical/index.js.map +1 -0
  291. package/dist/triangle2-record.d.ts +91 -0
  292. package/dist/triangle2-record.d.ts.map +1 -0
  293. package/dist/triangle2-record.js +146 -0
  294. package/dist/triangle2-record.js.map +1 -0
  295. package/dist/triangle2.d.ts +29 -14
  296. package/dist/triangle2.d.ts.map +1 -1
  297. package/dist/triangle2.js +86 -22
  298. package/dist/triangle2.js.map +1 -1
  299. package/dist/triangle3-record.d.ts +97 -0
  300. package/dist/triangle3-record.d.ts.map +1 -0
  301. package/dist/triangle3-record.js +178 -0
  302. package/dist/triangle3-record.js.map +1 -0
  303. package/dist/triangle3.d.ts +41 -17
  304. package/dist/triangle3.d.ts.map +1 -1
  305. package/dist/triangle3.js +267 -38
  306. package/dist/triangle3.js.map +1 -1
  307. package/package.json +15 -8
  308. package/dist/angles.d.ts +0 -31
  309. package/dist/angles.d.ts.map +0 -1
  310. package/dist/angles.js +0 -53
  311. package/dist/angles.js.map +0 -1
  312. package/dist/coordinate-spaces.d.ts +0 -39
  313. package/dist/coordinate-spaces.d.ts.map +0 -1
  314. package/dist/coordinate-spaces.js +0 -52
  315. package/dist/coordinate-spaces.js.map +0 -1
  316. package/dist/coordinates-vec2.d.ts +0 -7
  317. package/dist/coordinates-vec2.d.ts.map +0 -1
  318. package/dist/coordinates-vec2.js +0 -35
  319. package/dist/coordinates-vec2.js.map +0 -1
  320. package/dist/coordinates-vec3.d.ts +0 -11
  321. package/dist/coordinates-vec3.d.ts.map +0 -1
  322. package/dist/coordinates-vec3.js +0 -61
  323. package/dist/coordinates-vec3.js.map +0 -1
  324. package/dist/coordinates.d.ts +0 -54
  325. package/dist/coordinates.d.ts.map +0 -1
  326. package/dist/coordinates.js +0 -2
  327. package/dist/coordinates.js.map +0 -1
  328. package/dist/euler-angles-quaternion.d.ts +0 -7
  329. package/dist/euler-angles-quaternion.d.ts.map +0 -1
  330. package/dist/euler-angles-quaternion.js +0 -100
  331. package/dist/euler-angles-quaternion.js.map +0 -1
  332. package/dist/euler-angles.d.ts +0 -33
  333. package/dist/euler-angles.d.ts.map +0 -1
  334. package/dist/euler-angles.js +0 -35
  335. package/dist/euler-angles.js.map +0 -1
  336. package/dist/geometry-vectors.d.ts +0 -11
  337. package/dist/geometry-vectors.d.ts.map +0 -1
  338. package/dist/geometry-vectors.js +0 -19
  339. package/dist/geometry-vectors.js.map +0 -1
  340. package/dist/mesh3.d.ts +0 -32
  341. package/dist/mesh3.d.ts.map +0 -1
  342. package/dist/mesh3.js +0 -142
  343. package/dist/mesh3.js.map +0 -1
  344. package/dist/point2.d.ts +0 -41
  345. package/dist/point2.d.ts.map +0 -1
  346. package/dist/point2.js +0 -92
  347. package/dist/point2.js.map +0 -1
  348. package/dist/point3.d.ts +0 -43
  349. package/dist/point3.d.ts.map +0 -1
  350. package/dist/point3.js +0 -103
  351. package/dist/point3.js.map +0 -1
  352. package/dist/point4.d.ts +0 -12
  353. package/dist/point4.d.ts.map +0 -1
  354. package/dist/point4.js +0 -28
  355. package/dist/point4.js.map +0 -1
  356. package/dist/rect2.d.ts +0 -54
  357. package/dist/rect2.d.ts.map +0 -1
  358. package/dist/rect2.js +0 -149
  359. package/dist/rect2.js.map +0 -1
  360. package/dist/size2.d.ts +0 -33
  361. package/dist/size2.d.ts.map +0 -1
  362. package/dist/size2.js +0 -81
  363. package/dist/size2.js.map +0 -1
  364. package/dist/size3.d.ts +0 -21
  365. package/dist/size3.d.ts.map +0 -1
  366. package/dist/size3.js +0 -59
  367. package/dist/size3.js.map +0 -1
  368. package/dist/size4.d.ts +0 -10
  369. package/dist/size4.d.ts.map +0 -1
  370. package/dist/size4.js +0 -16
  371. package/dist/size4.js.map +0 -1
@@ -0,0 +1,114 @@
1
+ // Generated from scripts/templates/record.liquid by scripts/generate-records.ts. Do not edit.
2
+ import { isCloseAbsolute, numberAtOrNaN } from "@ac-kit/core";
3
+ import { geometryConfig } from "../globals.js";
4
+ /**
5
+ * Every creator copies this array, which holds non-integer doubles and is never
6
+ * exposed: nothing a caller does can change the element kind it copies.
7
+ */
8
+ const TEMPLATE_ = [0.5, 0.5, 0.5];
9
+ /**
10
+ * Creates the cylindrical coordinates `[0, 0, 0]`, the origin.
11
+ *
12
+ * Allocates; keep it out of hot loops.
13
+ */
14
+ export function cylindricalCoordsCreate() {
15
+ const out = TEMPLATE_.slice();
16
+ out[0] = 0;
17
+ out[1] = 0;
18
+ out[2] = 0;
19
+ return out;
20
+ }
21
+ /**
22
+ * Creates the cylindrical coordinates with the components `radius, azimuth,
23
+ * height`, in storage order.
24
+ *
25
+ * Allocates; keep it out of hot loops.
26
+ */
27
+ export function cylindricalCoordsOf(radius, azimuth, height) {
28
+ const out = TEMPLATE_.slice();
29
+ out[0] = radius;
30
+ out[1] = azimuth;
31
+ out[2] = height;
32
+ return out;
33
+ }
34
+ /**
35
+ * Creates a copy of `a`. Like every creator it starts from a clean array.
36
+ *
37
+ * Allocates; keep it out of hot loops.
38
+ */
39
+ export function cylindricalCoordsClone(a) {
40
+ const out = TEMPLATE_.slice();
41
+ out[0] = a[0];
42
+ out[1] = a[1];
43
+ out[2] = a[2];
44
+ return out;
45
+ }
46
+ /** Writes the components, in storage order, into `out`. */
47
+ export function cylindricalCoordsSet(out, radius, azimuth, height) {
48
+ out[0] = radius;
49
+ out[1] = azimuth;
50
+ out[2] = height;
51
+ return out;
52
+ }
53
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
54
+ export function cylindricalCoordsCopy(out, a) {
55
+ out[0] = a[0];
56
+ out[1] = a[1];
57
+ out[2] = a[2];
58
+ return out;
59
+ }
60
+ /**
61
+ * Exact component-wise equality: `−0` equals `+0`, `NaN` equals nothing, itself
62
+ * included, and an infinity equals itself. See {@link cylindricalCoordsIsClose}
63
+ * for a tolerant test.
64
+ */
65
+ export function cylindricalCoordsEquals(a, b) {
66
+ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
67
+ }
68
+ /**
69
+ * Component-wise approximate equality: every pair differs by at most
70
+ * `tolerance`, an absolute bound in the caller's units, and an infinity is
71
+ * close only to itself. Not transitive, so never a basis for ordering or a
72
+ * container key: use {@link cylindricalCoordsEquals} there.
73
+ *
74
+ * @param tolerance Defaults to `geometryConfig.defaultLinearTolerance`.
75
+ */
76
+ export function cylindricalCoordsIsClose(a, b, tolerance = geometryConfig.defaultLinearTolerance) {
77
+ return (isCloseAbsolute(a[0], b[0], tolerance) &&
78
+ isCloseAbsolute(a[1], b[1], tolerance) &&
79
+ isCloseAbsolute(a[2], b[2], tolerance));
80
+ }
81
+ /**
82
+ * The checked way in from untyped data (JSON, messages, arrays of unknown
83
+ * origin): `source[offset … offset + 3)` copied into `out`, each element that
84
+ * is not a number written as `NaN`, an index past the end of `source` too, so
85
+ * `out` never holds a non-number. A cold path: buffers use
86
+ * {@link cylindricalCoordsLoad}. O(1).
87
+ *
88
+ * `source` may be `out` itself: the 3 elements are read before the first write.
89
+ *
90
+ * @param out The cylindrical coordinates to fill.
91
+ * @param source The array to read, of any length and any content.
92
+ * @param offset The index of the first component in `source`.
93
+ * @returns `out`.
94
+ */
95
+ export function cylindricalCoordsFromArray(out, source, offset = 0) {
96
+ const value0 = numberAtOrNaN(source, offset);
97
+ const value1 = numberAtOrNaN(source, offset + 1);
98
+ const value2 = numberAtOrNaN(source, offset + 2);
99
+ out[0] = value0;
100
+ out[1] = value1;
101
+ out[2] = value2;
102
+ return out;
103
+ }
104
+ /**
105
+ * Whether every component is a finite number: the check to run after parsing
106
+ * untrusted data or before an upload, as operations never check. A component
107
+ * that is not a number at all counts as not finite.
108
+ */
109
+ export function cylindricalCoordsIsFinite(value) {
110
+ return (Number.isFinite(value[0]) &&
111
+ Number.isFinite(value[1]) &&
112
+ Number.isFinite(value[2]));
113
+ }
114
+ //# sourceMappingURL=cylindrical-record.js.map
@@ -0,0 +1 @@
1
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AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,0BAA0B,CACzC,GAAsB,EACtB,MAAyB,EACzB,MAAM,GAAG,CAAC;IAEV,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IAChB,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IAChB,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IAChB,OAAO,GAAG,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACxC,KAAgC;IAEhC,OAAO,CACN,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACzB,CAAC;AACH,CAAC"}
@@ -0,0 +1,86 @@
1
+ import type { Brand_ } from "../_brand.js";
2
+ /**
3
+ * Horizontal coordinates: the azimuth clockwise from north toward east in `[0,
4
+ * 2π)`, the elevation from the horizon in `[−π/2, π/2]` and the range, `≥ 0`,
5
+ * in radians and the caller's length unit.
6
+ *
7
+ * A plain array of 3 binary64 numbers carrying a type-level brand, holding
8
+ * exactly the numbers one element of the matching bulk buffer holds, in the
9
+ * same order.
10
+ *
11
+ * Only {@link horizontalCoordsCreate}, {@link horizontalCoordsOf},
12
+ * {@link horizontalCoordsClone}, {@link horizontalCoordsFromArray} and the
13
+ * functions that write an `out` make one; see `Vec3` in `@ac-kit/math-linear`
14
+ * for the rules that bind callers who bypass the types.
15
+ */
16
+ export type HorizontalCoords = [
17
+ azimuth: number,
18
+ elevation: number,
19
+ range: number
20
+ ] & Brand_<"HorizontalCoords">;
21
+ /** A {@link HorizontalCoords} that is only read. */
22
+ export type ReadonlyHorizontalCoords = readonly [
23
+ azimuth: number,
24
+ elevation: number,
25
+ range: number
26
+ ] & Brand_<"HorizontalCoords">;
27
+ /**
28
+ * Creates the horizontal coordinates `[0, 0, 0]`, the origin.
29
+ *
30
+ * Allocates; keep it out of hot loops.
31
+ */
32
+ export declare function horizontalCoordsCreate(): HorizontalCoords;
33
+ /**
34
+ * Creates the horizontal coordinates with the components `azimuth, elevation,
35
+ * range`, in storage order.
36
+ *
37
+ * Allocates; keep it out of hot loops.
38
+ */
39
+ export declare function horizontalCoordsOf(azimuth: number, elevation: number, range: number): HorizontalCoords;
40
+ /**
41
+ * Creates a copy of `a`. Like every creator it starts from a clean array.
42
+ *
43
+ * Allocates; keep it out of hot loops.
44
+ */
45
+ export declare function horizontalCoordsClone(a: ReadonlyHorizontalCoords): HorizontalCoords;
46
+ /** Writes the components, in storage order, into `out`. */
47
+ export declare function horizontalCoordsSet(out: HorizontalCoords, azimuth: number, elevation: number, range: number): HorizontalCoords;
48
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
49
+ export declare function horizontalCoordsCopy(out: HorizontalCoords, a: ReadonlyHorizontalCoords): HorizontalCoords;
50
+ /**
51
+ * Exact component-wise equality: `−0` equals `+0`, `NaN` equals nothing, itself
52
+ * included, and an infinity equals itself. See {@link horizontalCoordsIsClose}
53
+ * for a tolerant test.
54
+ */
55
+ export declare function horizontalCoordsEquals(a: ReadonlyHorizontalCoords, b: ReadonlyHorizontalCoords): boolean;
56
+ /**
57
+ * Component-wise approximate equality: every pair differs by at most
58
+ * `tolerance`, an absolute bound in the caller's units, and an infinity is
59
+ * close only to itself. Not transitive, so never a basis for ordering or a
60
+ * container key: use {@link horizontalCoordsEquals} there.
61
+ *
62
+ * @param tolerance Defaults to `geometryConfig.defaultLinearTolerance`.
63
+ */
64
+ export declare function horizontalCoordsIsClose(a: ReadonlyHorizontalCoords, b: ReadonlyHorizontalCoords, tolerance?: number): boolean;
65
+ /**
66
+ * The checked way in from untyped data (JSON, messages, arrays of unknown
67
+ * origin): `source[offset … offset + 3)` copied into `out`, each element that
68
+ * is not a number written as `NaN`, an index past the end of `source` too, so
69
+ * `out` never holds a non-number. A cold path: buffers use
70
+ * {@link horizontalCoordsLoad}. O(1).
71
+ *
72
+ * `source` may be `out` itself: the 3 elements are read before the first write.
73
+ *
74
+ * @param out The horizontal coordinates to fill.
75
+ * @param source The array to read, of any length and any content.
76
+ * @param offset The index of the first component in `source`.
77
+ * @returns `out`.
78
+ */
79
+ export declare function horizontalCoordsFromArray(out: HorizontalCoords, source: ArrayLike<number>, offset?: number): HorizontalCoords;
80
+ /**
81
+ * Whether every component is a finite number: the check to run after parsing
82
+ * untrusted data or before an upload, as operations never check. A component
83
+ * that is not a number at all counts as not finite.
84
+ */
85
+ export declare function horizontalCoordsIsFinite(value: ReadonlyHorizontalCoords): boolean;
86
+ //# sourceMappingURL=horizontal-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"horizontal-record.d.ts","sourceRoot":"","sources":["../../src/coordinates/horizontal-record.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE,MAAM;IACf,SAAS,EAAE,MAAM;IACjB,KAAK,EAAE,MAAM;CACb,GACA,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAE5B,oDAAoD;AACpD,MAAM,MAAM,wBAAwB,GAAG,SAAS;IAC/C,OAAO,EAAE,MAAM;IACf,SAAS,EAAE,MAAM;IACjB,KAAK,EAAE,MAAM;CACb,GACA,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAQ5B;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,gBAAgB,CAMzD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACX,gBAAgB,CAMlB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACpC,CAAC,EAAE,wBAAwB,GACzB,gBAAgB,CAMlB;AAED,2DAA2D;AAC3D,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,gBAAgB,EACrB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GACX,gBAAgB,CAKlB;AAED,yDAAyD;AACzD,wBAAgB,oBAAoB,CACnC,GAAG,EAAE,gBAAgB,EACrB,CAAC,EAAE,wBAAwB,GACzB,gBAAgB,CAKlB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,CAAC,EAAE,wBAAwB,EAC3B,CAAC,EAAE,wBAAwB,GACzB,OAAO,CAET;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACtC,CAAC,EAAE,wBAAwB,EAC3B,CAAC,EAAE,wBAAwB,EAC3B,SAAS,GAAE,MAA8C,GACvD,OAAO,CAMT;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACxC,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,SAAS,CAAC,MAAM,CAAC,EACzB,MAAM,SAAI,GACR,gBAAgB,CAQlB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,wBAAwB,GAC7B,OAAO,CAMT"}
@@ -0,0 +1,114 @@
1
+ // Generated from scripts/templates/record.liquid by scripts/generate-records.ts. Do not edit.
2
+ import { isCloseAbsolute, numberAtOrNaN } from "@ac-kit/core";
3
+ import { geometryConfig } from "../globals.js";
4
+ /**
5
+ * Every creator copies this array, which holds non-integer doubles and is never
6
+ * exposed: nothing a caller does can change the element kind it copies.
7
+ */
8
+ const TEMPLATE_ = [0.5, 0.5, 0.5];
9
+ /**
10
+ * Creates the horizontal coordinates `[0, 0, 0]`, the origin.
11
+ *
12
+ * Allocates; keep it out of hot loops.
13
+ */
14
+ export function horizontalCoordsCreate() {
15
+ const out = TEMPLATE_.slice();
16
+ out[0] = 0;
17
+ out[1] = 0;
18
+ out[2] = 0;
19
+ return out;
20
+ }
21
+ /**
22
+ * Creates the horizontal coordinates with the components `azimuth, elevation,
23
+ * range`, in storage order.
24
+ *
25
+ * Allocates; keep it out of hot loops.
26
+ */
27
+ export function horizontalCoordsOf(azimuth, elevation, range) {
28
+ const out = TEMPLATE_.slice();
29
+ out[0] = azimuth;
30
+ out[1] = elevation;
31
+ out[2] = range;
32
+ return out;
33
+ }
34
+ /**
35
+ * Creates a copy of `a`. Like every creator it starts from a clean array.
36
+ *
37
+ * Allocates; keep it out of hot loops.
38
+ */
39
+ export function horizontalCoordsClone(a) {
40
+ const out = TEMPLATE_.slice();
41
+ out[0] = a[0];
42
+ out[1] = a[1];
43
+ out[2] = a[2];
44
+ return out;
45
+ }
46
+ /** Writes the components, in storage order, into `out`. */
47
+ export function horizontalCoordsSet(out, azimuth, elevation, range) {
48
+ out[0] = azimuth;
49
+ out[1] = elevation;
50
+ out[2] = range;
51
+ return out;
52
+ }
53
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
54
+ export function horizontalCoordsCopy(out, a) {
55
+ out[0] = a[0];
56
+ out[1] = a[1];
57
+ out[2] = a[2];
58
+ return out;
59
+ }
60
+ /**
61
+ * Exact component-wise equality: `−0` equals `+0`, `NaN` equals nothing, itself
62
+ * included, and an infinity equals itself. See {@link horizontalCoordsIsClose}
63
+ * for a tolerant test.
64
+ */
65
+ export function horizontalCoordsEquals(a, b) {
66
+ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
67
+ }
68
+ /**
69
+ * Component-wise approximate equality: every pair differs by at most
70
+ * `tolerance`, an absolute bound in the caller's units, and an infinity is
71
+ * close only to itself. Not transitive, so never a basis for ordering or a
72
+ * container key: use {@link horizontalCoordsEquals} there.
73
+ *
74
+ * @param tolerance Defaults to `geometryConfig.defaultLinearTolerance`.
75
+ */
76
+ export function horizontalCoordsIsClose(a, b, tolerance = geometryConfig.defaultLinearTolerance) {
77
+ return (isCloseAbsolute(a[0], b[0], tolerance) &&
78
+ isCloseAbsolute(a[1], b[1], tolerance) &&
79
+ isCloseAbsolute(a[2], b[2], tolerance));
80
+ }
81
+ /**
82
+ * The checked way in from untyped data (JSON, messages, arrays of unknown
83
+ * origin): `source[offset … offset + 3)` copied into `out`, each element that
84
+ * is not a number written as `NaN`, an index past the end of `source` too, so
85
+ * `out` never holds a non-number. A cold path: buffers use
86
+ * {@link horizontalCoordsLoad}. O(1).
87
+ *
88
+ * `source` may be `out` itself: the 3 elements are read before the first write.
89
+ *
90
+ * @param out The horizontal coordinates to fill.
91
+ * @param source The array to read, of any length and any content.
92
+ * @param offset The index of the first component in `source`.
93
+ * @returns `out`.
94
+ */
95
+ export function horizontalCoordsFromArray(out, source, offset = 0) {
96
+ const value0 = numberAtOrNaN(source, offset);
97
+ const value1 = numberAtOrNaN(source, offset + 1);
98
+ const value2 = numberAtOrNaN(source, offset + 2);
99
+ out[0] = value0;
100
+ out[1] = value1;
101
+ out[2] = value2;
102
+ return out;
103
+ }
104
+ /**
105
+ * Whether every component is a finite number: the check to run after parsing
106
+ * untrusted data or before an upload, as operations never check. A component
107
+ * that is not a number at all counts as not finite.
108
+ */
109
+ export function horizontalCoordsIsFinite(value) {
110
+ return (Number.isFinite(value[0]) &&
111
+ Number.isFinite(value[1]) &&
112
+ Number.isFinite(value[2]));
113
+ }
114
+ //# sourceMappingURL=horizontal-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"horizontal-record.js","sourceRoot":"","sources":["../../src/coordinates/horizontal-record.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,MA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AM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IAChB,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IAChB,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IAChB,OAAO,GAAG,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACvC,KAA+B;IAE/B,OAAO,CACN,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACzB,CAAC;AACH,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { type Mat3x3, type ReadonlyVec3, type Vec3 } from "@ac-kit/math-linear";
2
+ import type { HorizontalCoords, ReadonlyHorizontalCoords } from "./horizontal-record.js";
3
+ import type { ReadonlyLongitudeLatitude } from "./longitude-latitude-record.js";
4
+ /**
5
+ * The axes of a local frame at a position, as `[first, second, third]`:
6
+ * `"east-north-up"` (the ENU of surveying and of {@link horizontalFromVec3Enu})
7
+ * or `"north-east-down"` (the NED of aviation).
8
+ */
9
+ export type LocalAxes = "east-north-up" | "north-east-down";
10
+ /**
11
+ * Writes the rotation that takes directions in a Z-up global frame (ECEF, or
12
+ * equatorial coordinates on the sky) to the local `axes` at `position` into
13
+ * `out`: a vector `v` gives `out · v`, its components along the first, second
14
+ * and third local axis. On the Earth the position is the longitude and the
15
+ * geodetic latitude; on the sky, the local sidereal angle and the observer's
16
+ * latitude. No ellipsoid is needed: a rotation only needs the two angles.
17
+ *
18
+ * The matrix is column-major, so its rows are the local axes in global
19
+ * coordinates; its transpose is the inverse.
20
+ *
21
+ * @throws {RangeError} For `axes` other than the two named.
22
+ */
23
+ export declare function mat3x3FromLocalFrame(out: Mat3x3, position: ReadonlyLongitudeLatitude, axes: LocalAxes): Mat3x3;
24
+ /**
25
+ * Writes the horizontal coordinates of a vector in east-north-up axes into
26
+ * `out`: the azimuth clockwise from north toward east, in `[0, 2π)`, the
27
+ * elevation above the horizon `atan2(up, √(east² + north²))`, in `[−π/2, π/2]`,
28
+ * and the range, the vector's length. The zero vector gives `[0, 0, 0]` and a
29
+ * vertical one azimuth `0`.
30
+ */
31
+ export declare function horizontalFromVec3Enu(out: HorizontalCoords, a: ReadonlyVec3): HorizontalCoords;
32
+ /**
33
+ * Writes the east-north-up vector of the horizontal coordinates `coords` into
34
+ * `out`.
35
+ */
36
+ export declare function vec3EnuFromHorizontal(out: Vec3, coords: ReadonlyHorizontalCoords): Vec3;
37
+ /**
38
+ * Writes the horizontal coordinates of every east-north-up vector of `input`
39
+ * (three numbers each) into `out` (three numbers each), as
40
+ * {@link horizontalFromVec3Enu}: the kernel for a catalogue or a terrain grid.
41
+ * `out` may be `input` itself (in place) but not a partially overlapping view
42
+ * of it. O(n).
43
+ *
44
+ * @throws {RangeError} When `input.length` is not a multiple of 3 or `out` has
45
+ * another length.
46
+ */
47
+ export declare function horizontalArrayFromVec3Enu<T extends Float64Array>(out: T, input: Float64Array): T;
48
+ //# sourceMappingURL=horizontal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"horizontal.d.ts","sourceRoot":"","sources":["../../src/coordinates/horizontal.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,MAAM,EAEX,KAAK,YAAY,EACjB,KAAK,IAAI,EAET,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EACX,gBAAgB,EAChB,wBAAwB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAEhF;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAE5D;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CACnC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,yBAAyB,EACnC,IAAI,EAAE,SAAS,GACb,MAAM,CA8CR;AAQD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACpC,GAAG,EAAE,gBAAgB,EACrB,CAAC,EAAE,YAAY,GACb,gBAAgB,CAQlB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACpC,GAAG,EAAE,IAAI,EACT,MAAM,EAAE,wBAAwB,GAC9B,IAAI,CASN;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,YAAY,EAChE,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,YAAY,GACjB,CAAC,CAgBH"}
@@ -0,0 +1,100 @@
1
+ import { describeValue } from "@ac-kit/core";
2
+ import { mat3x3SetRows, vec3Length, } from "@ac-kit/math-linear";
3
+ import { angleWrapRad } from "@ac-kit/math-scalar";
4
+ /**
5
+ * Writes the rotation that takes directions in a Z-up global frame (ECEF, or
6
+ * equatorial coordinates on the sky) to the local `axes` at `position` into
7
+ * `out`: a vector `v` gives `out · v`, its components along the first, second
8
+ * and third local axis. On the Earth the position is the longitude and the
9
+ * geodetic latitude; on the sky, the local sidereal angle and the observer's
10
+ * latitude. No ellipsoid is needed: a rotation only needs the two angles.
11
+ *
12
+ * The matrix is column-major, so its rows are the local axes in global
13
+ * coordinates; its transpose is the inverse.
14
+ *
15
+ * @throws {RangeError} For `axes` other than the two named.
16
+ */
17
+ export function mat3x3FromLocalFrame(out, position, axes) {
18
+ if (axes !== "east-north-up" && axes !== "north-east-down") {
19
+ throw new RangeError(`mat3x3FromLocalFrame: unknown axes ${describeValue(axes)}, expected "east-north-up" or "north-east-down".`);
20
+ }
21
+ const longitude = position[0];
22
+ const latitude = position[1];
23
+ const sinLongitude = Math.sin(longitude);
24
+ const cosLongitude = Math.cos(longitude);
25
+ const sinLatitude = Math.sin(latitude);
26
+ const cosLatitude = Math.cos(latitude);
27
+ const eastX = -sinLongitude;
28
+ const eastY = cosLongitude;
29
+ const northX = -sinLatitude * cosLongitude;
30
+ const northY = -sinLatitude * sinLongitude;
31
+ const northZ = cosLatitude;
32
+ const upX = cosLatitude * cosLongitude;
33
+ const upY = cosLatitude * sinLongitude;
34
+ const upZ = sinLatitude;
35
+ if (axes === "east-north-up") {
36
+ return mat3x3SetRows(out, eastX, eastY, 0, northX, northY, northZ, upX, upY, upZ);
37
+ }
38
+ return mat3x3SetRows(out, northX, northY, northZ, eastX, eastY, 0, -upX, -upY, -upZ);
39
+ }
40
+ function azimuthOf_(east, north) {
41
+ return east === 0 && north === 0
42
+ ? 0
43
+ : angleWrapRad(Math.atan2(east, north)) + 0;
44
+ }
45
+ /**
46
+ * Writes the horizontal coordinates of a vector in east-north-up axes into
47
+ * `out`: the azimuth clockwise from north toward east, in `[0, 2π)`, the
48
+ * elevation above the horizon `atan2(up, √(east² + north²))`, in `[−π/2, π/2]`,
49
+ * and the range, the vector's length. The zero vector gives `[0, 0, 0]` and a
50
+ * vertical one azimuth `0`.
51
+ */
52
+ export function horizontalFromVec3Enu(out, a) {
53
+ const east = a[0];
54
+ const north = a[1];
55
+ const up = a[2];
56
+ out[0] = azimuthOf_(east, north);
57
+ out[1] = Math.atan2(up, Math.sqrt(east * east + north * north)) + 0;
58
+ out[2] = vec3Length(a);
59
+ return out;
60
+ }
61
+ /**
62
+ * Writes the east-north-up vector of the horizontal coordinates `coords` into
63
+ * `out`.
64
+ */
65
+ export function vec3EnuFromHorizontal(out, coords) {
66
+ const azimuth = coords[0];
67
+ const elevation = coords[1];
68
+ const range = coords[2];
69
+ const level = range * Math.cos(elevation);
70
+ out[0] = level * Math.sin(azimuth);
71
+ out[1] = level * Math.cos(azimuth);
72
+ out[2] = range * Math.sin(elevation);
73
+ return out;
74
+ }
75
+ /**
76
+ * Writes the horizontal coordinates of every east-north-up vector of `input`
77
+ * (three numbers each) into `out` (three numbers each), as
78
+ * {@link horizontalFromVec3Enu}: the kernel for a catalogue or a terrain grid.
79
+ * `out` may be `input` itself (in place) but not a partially overlapping view
80
+ * of it. O(n).
81
+ *
82
+ * @throws {RangeError} When `input.length` is not a multiple of 3 or `out` has
83
+ * another length.
84
+ */
85
+ export function horizontalArrayFromVec3Enu(out, input) {
86
+ const length = input.length;
87
+ if (length % 3 !== 0 || out.length !== length) {
88
+ throw new RangeError(`horizontalArrayFromVec3Enu: out has ${out.length} numbers for ${length} in input, which must be a multiple of 3.`);
89
+ }
90
+ for (let index = 0; index < length; index += 3) {
91
+ const east = input[index];
92
+ const north = input[index + 1];
93
+ const up = input[index + 2];
94
+ out[index] = azimuthOf_(east, north);
95
+ out[index + 1] = Math.atan2(up, Math.sqrt(east * east + north * north)) + 0;
96
+ out[index + 2] = Math.sqrt(east * east + north * north + up * up);
97
+ }
98
+ return out;
99
+ }
100
+ //# sourceMappingURL=horizontal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"horizontal.js","sourceRoot":"","sources":["../../src/coordinates/horizontal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAEN,aAAa,EAGb,UAAU,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAenD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CACnC,GAAW,EACX,QAAmC,EACnC,IAAe;IAEf,IAAI,IAAI,KAAK,eAAe,IAAI,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC5D,MAAM,IAAI,UAAU,CACnB,sCAAsC,aAAa,CAAC,IAAI,CAAC,kDAAkD,CAC3G,CAAC;IACH,CAAC;IACD,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC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0BAA0B,CACzC,GAAM,EACN,KAAmB;IAEnB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5B,IAAI,MAAM,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QAC/C,MAAM,IAAI,UAAU,CACnB,uCAAuC,GAAG,CAAC,MAAM,gBAAgB,MAAM,2CAA2C,CAClH,CAAC;IACH,CAAC;IACD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAE,CAAC;QAC3B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QAChC,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,GAAG,CAAC,CAAE,CAAC;QAC7B,GAAG,CAAC,KAAK,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACrC,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QAC5E,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from "./cylindrical-record.js";
2
+ export * from "./horizontal-record.js";
3
+ export * from "./horizontal.js";
4
+ export * from "./longitude-latitude-record.js";
5
+ export * from "./longitude-latitude.js";
6
+ export * from "./polar-record.js";
7
+ export * from "./polar.js";
8
+ export * from "./spherical-cylindrical.js";
9
+ export * from "./spherical-record.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/coordinates/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,10 @@
1
+ export * from "./cylindrical-record.js";
2
+ export * from "./horizontal-record.js";
3
+ export * from "./horizontal.js";
4
+ export * from "./longitude-latitude-record.js";
5
+ export * from "./longitude-latitude.js";
6
+ export * from "./polar-record.js";
7
+ export * from "./polar.js";
8
+ export * from "./spherical-cylindrical.js";
9
+ export * from "./spherical-record.js";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/coordinates/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,81 @@
1
+ import type { Brand_ } from "../_brand.js";
2
+ /**
3
+ * The angular pair of a direction on a Z-up sphere, in radians: the longitude
4
+ * from +X toward +Y, then the latitude from the equator toward +Z. Longitude
5
+ * first, as GeoJSON, proj4, d3 and (α, δ) do.
6
+ *
7
+ * A plain array of 2 binary64 numbers carrying a type-level brand, holding
8
+ * exactly the numbers one element of the matching bulk buffer holds, in the
9
+ * same order.
10
+ *
11
+ * Only {@link longitudeLatitudeCreate}, {@link longitudeLatitudeOf},
12
+ * {@link longitudeLatitudeClone}, {@link longitudeLatitudeFromArray} and the
13
+ * functions that write an `out` make one; see `Vec3` in `@ac-kit/math-linear`
14
+ * for the rules that bind callers who bypass the types.
15
+ */
16
+ export type LongitudeLatitude = [longitude: number, latitude: number] & Brand_<"LongitudeLatitude">;
17
+ /** A {@link LongitudeLatitude} that is only read. */
18
+ export type ReadonlyLongitudeLatitude = readonly [
19
+ longitude: number,
20
+ latitude: number
21
+ ] & Brand_<"LongitudeLatitude">;
22
+ /**
23
+ * Creates the position `[0, 0]`, on the equator at +X.
24
+ *
25
+ * Allocates; keep it out of hot loops.
26
+ */
27
+ export declare function longitudeLatitudeCreate(): LongitudeLatitude;
28
+ /**
29
+ * Creates the longitude and latitude with the components `longitude, latitude`,
30
+ * in storage order.
31
+ *
32
+ * Allocates; keep it out of hot loops.
33
+ */
34
+ export declare function longitudeLatitudeOf(longitude: number, latitude: number): LongitudeLatitude;
35
+ /**
36
+ * Creates a copy of `a`. Like every creator it starts from a clean array.
37
+ *
38
+ * Allocates; keep it out of hot loops.
39
+ */
40
+ export declare function longitudeLatitudeClone(a: ReadonlyLongitudeLatitude): LongitudeLatitude;
41
+ /** Writes the components, in storage order, into `out`. */
42
+ export declare function longitudeLatitudeSet(out: LongitudeLatitude, longitude: number, latitude: number): LongitudeLatitude;
43
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
44
+ export declare function longitudeLatitudeCopy(out: LongitudeLatitude, a: ReadonlyLongitudeLatitude): LongitudeLatitude;
45
+ /**
46
+ * Exact component-wise equality: `−0` equals `+0`, `NaN` equals nothing, itself
47
+ * included, and an infinity equals itself. See {@link longitudeLatitudeIsClose}
48
+ * for a tolerant test.
49
+ */
50
+ export declare function longitudeLatitudeEquals(a: ReadonlyLongitudeLatitude, b: ReadonlyLongitudeLatitude): boolean;
51
+ /**
52
+ * Component-wise approximate equality: every pair differs by at most
53
+ * `tolerance`, an absolute bound in the caller's units, and an infinity is
54
+ * close only to itself. Not transitive, so never a basis for ordering or a
55
+ * container key: use {@link longitudeLatitudeEquals} there.
56
+ *
57
+ * @param tolerance Defaults to `geometryConfig.defaultLinearTolerance`.
58
+ */
59
+ export declare function longitudeLatitudeIsClose(a: ReadonlyLongitudeLatitude, b: ReadonlyLongitudeLatitude, tolerance?: number): boolean;
60
+ /**
61
+ * The checked way in from untyped data (JSON, messages, arrays of unknown
62
+ * origin): `source[offset … offset + 2)` copied into `out`, each element that
63
+ * is not a number written as `NaN`, an index past the end of `source` too, so
64
+ * `out` never holds a non-number. A cold path: buffers use
65
+ * {@link longitudeLatitudeLoad}. O(1).
66
+ *
67
+ * `source` may be `out` itself: the 2 elements are read before the first write.
68
+ *
69
+ * @param out The longitude and latitude to fill.
70
+ * @param source The array to read, of any length and any content.
71
+ * @param offset The index of the first component in `source`.
72
+ * @returns `out`.
73
+ */
74
+ export declare function longitudeLatitudeFromArray(out: LongitudeLatitude, source: ArrayLike<number>, offset?: number): LongitudeLatitude;
75
+ /**
76
+ * Whether every component is a finite number: the check to run after parsing
77
+ * untrusted data or before an upload, as operations never check. A component
78
+ * that is not a number at all counts as not finite.
79
+ */
80
+ export declare function longitudeLatitudeIsFinite(value: ReadonlyLongitudeLatitude): boolean;
81
+ //# sourceMappingURL=longitude-latitude-record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"longitude-latitude-record.d.ts","sourceRoot":"","sources":["../../src/coordinates/longitude-latitude-record.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,GACpE,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE7B,qDAAqD;AACrD,MAAM,MAAM,yBAAyB,GAAG,SAAS;IAChD,SAAS,EAAE,MAAM;IACjB,QAA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