@math.gl/core 5.0.0-alpha.2 → 5.0.0-alpha.20

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 (272) hide show
  1. package/APACHE-2.0-LICENSE.txt +55 -0
  2. package/ARROW-NOTICE.txt +18 -0
  3. package/LICENSE +149 -40
  4. package/PROJ4-LICENSE.md +29 -0
  5. package/README.md +14 -0
  6. package/THIRD-PARTY-NOTICES.md +16 -0
  7. package/dist/classes/base/math-array.d.ts +1 -1
  8. package/dist/classes/base/math-array.d.ts.map +1 -1
  9. package/dist/classes/base/math-array.js +1 -1
  10. package/dist/classes/base/math-array.js.map +1 -1
  11. package/dist/classes/base/matrix.d.ts +1 -1
  12. package/dist/classes/base/matrix.d.ts.map +1 -1
  13. package/dist/classes/base/matrix.js +2 -2
  14. package/dist/classes/base/matrix.js.map +1 -1
  15. package/dist/classes/base/vector.d.ts +1 -1
  16. package/dist/classes/base/vector.d.ts.map +1 -1
  17. package/dist/classes/base/vector.js +2 -2
  18. package/dist/classes/base/vector.js.map +1 -1
  19. package/dist/classes/euler-types.js +1 -1
  20. package/dist/classes/euler-types.js.map +1 -1
  21. package/dist/classes/euler.d.ts +1 -1
  22. package/dist/classes/euler.d.ts.map +1 -1
  23. package/dist/classes/euler.js +4 -2
  24. package/dist/classes/euler.js.map +1 -1
  25. package/dist/classes/matrix3.d.ts +1 -1
  26. package/dist/classes/matrix3.d.ts.map +1 -1
  27. package/dist/classes/matrix3.js +2 -2
  28. package/dist/classes/matrix3.js.map +1 -1
  29. package/dist/classes/matrix4.d.ts +1 -1
  30. package/dist/classes/matrix4.d.ts.map +1 -1
  31. package/dist/classes/matrix4.js +2 -2
  32. package/dist/classes/matrix4.js.map +1 -1
  33. package/dist/classes/pose.d.ts +1 -1
  34. package/dist/classes/pose.d.ts.map +1 -1
  35. package/dist/classes/pose.js +2 -2
  36. package/dist/classes/pose.js.map +1 -1
  37. package/dist/classes/quaternion.d.ts +1 -1
  38. package/dist/classes/quaternion.d.ts.map +1 -1
  39. package/dist/classes/quaternion.js +2 -2
  40. package/dist/classes/quaternion.js.map +1 -1
  41. package/dist/classes/spherical-coordinates.js +2 -2
  42. package/dist/classes/spherical-coordinates.js.map +1 -1
  43. package/dist/classes/vector2.d.ts +1 -1
  44. package/dist/classes/vector2.d.ts.map +1 -1
  45. package/dist/classes/vector2.js +2 -2
  46. package/dist/classes/vector2.js.map +1 -1
  47. package/dist/classes/vector3.d.ts +1 -1
  48. package/dist/classes/vector3.d.ts.map +1 -1
  49. package/dist/classes/vector3.js +2 -2
  50. package/dist/classes/vector3.js.map +1 -1
  51. package/dist/classes/vector4.d.ts +1 -1
  52. package/dist/classes/vector4.d.ts.map +1 -1
  53. package/dist/classes/vector4.js +2 -2
  54. package/dist/classes/vector4.js.map +1 -1
  55. package/dist/expressions/expression-eval.d.ts +98 -0
  56. package/dist/expressions/expression-eval.d.ts.map +1 -0
  57. package/dist/expressions/expression-eval.js +302 -0
  58. package/dist/expressions/expression-eval.js.map +1 -0
  59. package/dist/expressions/function-libraries.d.ts +60 -0
  60. package/dist/expressions/function-libraries.d.ts.map +1 -0
  61. package/dist/expressions/function-libraries.js +69 -0
  62. package/dist/expressions/function-libraries.js.map +1 -0
  63. package/dist/expressions/function-registry.d.ts +93 -0
  64. package/dist/expressions/function-registry.d.ts.map +1 -0
  65. package/dist/expressions/function-registry.js +139 -0
  66. package/dist/expressions/function-registry.js.map +1 -0
  67. package/dist/expressions/get.d.ts +9 -0
  68. package/dist/expressions/get.d.ts.map +1 -0
  69. package/dist/expressions/get.js +32 -0
  70. package/dist/expressions/get.js.map +1 -0
  71. package/dist/expressions/index.cjs +1491 -0
  72. package/dist/expressions/index.cjs.map +6 -0
  73. package/dist/expressions/index.d.ts +7 -0
  74. package/dist/expressions/index.d.ts.map +1 -0
  75. package/dist/expressions/index.js +8 -0
  76. package/dist/expressions/index.js.map +1 -0
  77. package/dist/expressions/parse-expression-string.d.ts +21 -0
  78. package/dist/expressions/parse-expression-string.d.ts.map +1 -0
  79. package/dist/expressions/parse-expression-string.js +61 -0
  80. package/dist/expressions/parse-expression-string.js.map +1 -0
  81. package/dist/expressions/vendor/jsep/runtime.d.ts +3 -0
  82. package/dist/expressions/vendor/jsep/runtime.d.ts.map +1 -0
  83. package/dist/expressions/vendor/jsep/runtime.js +972 -0
  84. package/dist/expressions/vendor/jsep/runtime.js.map +1 -0
  85. package/dist/expressions/vendor/jsep/types.d.ts +141 -0
  86. package/dist/expressions/vendor/jsep/types.d.ts.map +1 -0
  87. package/dist/expressions/vendor/jsep/types.js +4 -0
  88. package/dist/expressions/vendor/jsep/types.js.map +1 -0
  89. package/dist/gl-matrix/common.d.ts +1 -1
  90. package/dist/gl-matrix/common.d.ts.map +1 -1
  91. package/dist/gl-matrix/common.js +5 -0
  92. package/dist/gl-matrix/common.js.map +1 -1
  93. package/dist/gl-matrix/mat3.d.ts.map +1 -1
  94. package/dist/gl-matrix/mat3.js +5 -0
  95. package/dist/gl-matrix/mat3.js.map +1 -1
  96. package/dist/gl-matrix/mat4.d.ts.map +1 -1
  97. package/dist/gl-matrix/mat4.js +5 -0
  98. package/dist/gl-matrix/mat4.js.map +1 -1
  99. package/dist/gl-matrix/quat.d.ts.map +1 -1
  100. package/dist/gl-matrix/quat.js +5 -0
  101. package/dist/gl-matrix/quat.js.map +1 -1
  102. package/dist/gl-matrix/vec2.d.ts +1 -1
  103. package/dist/gl-matrix/vec2.d.ts.map +1 -1
  104. package/dist/gl-matrix/vec2.js +5 -0
  105. package/dist/gl-matrix/vec2.js.map +1 -1
  106. package/dist/gl-matrix/vec3.d.ts.map +1 -1
  107. package/dist/gl-matrix/vec3.js +5 -0
  108. package/dist/gl-matrix/vec3.js.map +1 -1
  109. package/dist/gl-matrix/vec4.d.ts.map +1 -1
  110. package/dist/gl-matrix/vec4.js +5 -0
  111. package/dist/gl-matrix/vec4.js.map +1 -1
  112. package/dist/gl-matrix/wip/index.d.ts.map +1 -1
  113. package/dist/gl-matrix/wip/index.js +3 -1
  114. package/dist/gl-matrix/wip/index.js.map +1 -1
  115. package/dist/gl-matrix/wip/mat2.d.ts.map +1 -1
  116. package/dist/gl-matrix/wip/mat2.js +3 -1
  117. package/dist/gl-matrix/wip/mat2.js.map +1 -1
  118. package/dist/gl-matrix/wip/mat2d.d.ts.map +1 -1
  119. package/dist/gl-matrix/wip/mat2d.js +3 -1
  120. package/dist/gl-matrix/wip/mat2d.js.map +1 -1
  121. package/dist/gl-matrix/wip/quat2.d.ts.map +1 -1
  122. package/dist/gl-matrix/wip/quat2.js +3 -1
  123. package/dist/gl-matrix/wip/quat2.js.map +1 -1
  124. package/dist/index.cjs.map +1 -1
  125. package/dist/index.d.ts +3 -2
  126. package/dist/index.d.ts.map +1 -1
  127. package/dist/index.js +1 -1
  128. package/dist/index.js.map +1 -1
  129. package/dist/lib/assert.js +1 -1
  130. package/dist/lib/assert.js.map +1 -1
  131. package/dist/lib/common.d.ts +1 -1
  132. package/dist/lib/common.d.ts.map +1 -1
  133. package/dist/lib/common.js +1 -1
  134. package/dist/lib/common.js.map +1 -1
  135. package/dist/lib/gl-matrix-extras.d.ts +1 -1
  136. package/dist/lib/gl-matrix-extras.d.ts.map +1 -1
  137. package/dist/lib/gl-matrix-extras.js +1 -1
  138. package/dist/lib/gl-matrix-extras.js.map +1 -1
  139. package/dist/lib/math-utils.d.ts.map +1 -1
  140. package/dist/lib/math-utils.js +2 -1
  141. package/dist/lib/math-utils.js.map +1 -1
  142. package/dist/lib/validators.d.ts +1 -1
  143. package/dist/lib/validators.d.ts.map +1 -1
  144. package/dist/lib/validators.js +1 -1
  145. package/dist/lib/validators.js.map +1 -1
  146. package/dist/local-frame.cjs +139 -0
  147. package/dist/local-frame.cjs.map +6 -0
  148. package/dist/local-frame.d.ts +39 -0
  149. package/dist/local-frame.d.ts.map +1 -0
  150. package/dist/local-frame.js +157 -0
  151. package/dist/local-frame.js.map +1 -0
  152. package/dist/mat3.cjs.map +1 -1
  153. package/dist/mat3.js +1 -1
  154. package/dist/mat3.js.map +1 -1
  155. package/dist/mat4.cjs.map +1 -1
  156. package/dist/mat4.js +1 -1
  157. package/dist/mat4.js.map +1 -1
  158. package/dist/quat.cjs.map +1 -1
  159. package/dist/quat.js +1 -1
  160. package/dist/quat.js.map +1 -1
  161. package/dist/spheroid.cjs +147 -0
  162. package/dist/spheroid.cjs.map +6 -0
  163. package/dist/spheroid.d.ts +21 -0
  164. package/dist/spheroid.d.ts.map +1 -0
  165. package/dist/spheroid.js +175 -0
  166. package/dist/spheroid.js.map +1 -0
  167. package/dist/types/array-types.d.ts +98 -0
  168. package/dist/types/array-types.d.ts.map +1 -0
  169. package/dist/types/array-types.js +6 -0
  170. package/dist/types/array-types.js.map +1 -0
  171. package/dist/types/bigint.d.ts +21 -0
  172. package/dist/types/bigint.d.ts.map +1 -0
  173. package/dist/types/bigint.js +65 -0
  174. package/dist/types/bigint.js.map +1 -0
  175. package/dist/types/bounds-types.d.ts +11 -0
  176. package/dist/types/bounds-types.d.ts.map +1 -0
  177. package/dist/types/bounds-types.js +17 -0
  178. package/dist/types/bounds-types.js.map +1 -0
  179. package/dist/types/float16.d.ts +32 -0
  180. package/dist/types/float16.d.ts.map +1 -0
  181. package/dist/types/float16.js +41 -0
  182. package/dist/types/float16.js.map +1 -0
  183. package/dist/types/index.d.ts +6 -0
  184. package/dist/types/index.d.ts.map +1 -0
  185. package/dist/types/index.js +6 -0
  186. package/dist/types/index.js.map +1 -0
  187. package/dist/types/is-array.d.ts +22 -0
  188. package/dist/types/is-array.d.ts.map +1 -0
  189. package/dist/types/is-array.js +36 -0
  190. package/dist/types/is-array.js.map +1 -0
  191. package/dist/types/spheroid.d.ts +8 -0
  192. package/dist/types/spheroid.d.ts.map +1 -0
  193. package/dist/types/spheroid.js +5 -0
  194. package/dist/types/spheroid.js.map +1 -0
  195. package/dist/types/typed-array-brand.d.ts +2 -0
  196. package/dist/types/typed-array-brand.d.ts.map +1 -0
  197. package/dist/types/typed-array-brand.js +10 -0
  198. package/dist/types/typed-array-brand.js.map +1 -0
  199. package/dist/types.cjs +67 -0
  200. package/dist/types.cjs.map +6 -0
  201. package/dist/types.d.ts +2 -0
  202. package/dist/types.d.ts.map +1 -0
  203. package/dist/types.js +5 -0
  204. package/dist/types.js.map +1 -0
  205. package/dist/vec2.cjs.map +1 -1
  206. package/dist/vec2.js +1 -1
  207. package/dist/vec2.js.map +1 -1
  208. package/dist/vec3.cjs.map +1 -1
  209. package/dist/vec3.js +1 -1
  210. package/dist/vec3.js.map +1 -1
  211. package/dist/vec4.cjs.map +1 -1
  212. package/dist/vec4.js +1 -1
  213. package/dist/vec4.js.map +1 -1
  214. package/package.json +28 -6
  215. package/src/classes/base/math-array.ts +2 -2
  216. package/src/classes/base/matrix.ts +3 -3
  217. package/src/classes/base/vector.ts +3 -3
  218. package/src/classes/euler-types.ts +1 -1
  219. package/src/classes/euler.ts +5 -3
  220. package/src/classes/matrix3.ts +3 -3
  221. package/src/classes/matrix4.ts +3 -3
  222. package/src/classes/pose.ts +3 -3
  223. package/src/classes/quaternion.ts +3 -3
  224. package/src/classes/spherical-coordinates.ts +2 -2
  225. package/src/classes/vector2.ts +3 -3
  226. package/src/classes/vector3.ts +3 -3
  227. package/src/classes/vector4.ts +3 -3
  228. package/src/expressions/expression-eval.ts +435 -0
  229. package/src/expressions/function-libraries.ts +123 -0
  230. package/src/expressions/function-registry.ts +171 -0
  231. package/src/expressions/get.ts +37 -0
  232. package/src/expressions/index.ts +22 -0
  233. package/src/expressions/parse-expression-string.ts +80 -0
  234. package/src/expressions/vendor/jsep/LICENSE.txt +23 -0
  235. package/src/expressions/vendor/jsep/README.md +22 -0
  236. package/src/expressions/vendor/jsep/runtime.ts +949 -0
  237. package/src/expressions/vendor/jsep/types.ts +179 -0
  238. package/src/gl-matrix/common.js +5 -0
  239. package/src/gl-matrix/mat3.ts +5 -0
  240. package/src/gl-matrix/mat4.ts +5 -0
  241. package/src/gl-matrix/quat.ts +5 -0
  242. package/src/gl-matrix/vec2.ts +6 -1
  243. package/src/gl-matrix/vec3.ts +5 -0
  244. package/src/gl-matrix/vec4.ts +5 -0
  245. package/src/gl-matrix/wip/index.js +3 -1
  246. package/src/gl-matrix/wip/mat2.js +3 -1
  247. package/src/gl-matrix/wip/mat2d.js +3 -1
  248. package/src/gl-matrix/wip/quat2.ts +3 -1
  249. package/src/index.ts +5 -3
  250. package/src/lib/assert.ts +1 -1
  251. package/src/lib/common.ts +2 -2
  252. package/src/lib/gl-matrix-extras.ts +2 -2
  253. package/src/lib/gl-matrix.d.ts +1 -1
  254. package/src/lib/math-utils.ts +2 -1
  255. package/src/lib/validators.ts +2 -2
  256. package/src/local-frame.ts +253 -0
  257. package/src/mat3.ts +1 -1
  258. package/src/mat4.ts +1 -1
  259. package/src/quat.ts +1 -1
  260. package/src/spheroid.ts +230 -0
  261. package/src/types/array-types.ts +148 -0
  262. package/src/types/bigint.ts +74 -0
  263. package/src/types/bounds-types.ts +29 -0
  264. package/src/types/float16.ts +47 -0
  265. package/src/types/index.ts +45 -0
  266. package/src/types/is-array.ts +41 -0
  267. package/src/types/spheroid.ts +11 -0
  268. package/src/types/typed-array-brand.ts +14 -0
  269. package/src/types.ts +5 -0
  270. package/src/vec2.ts +1 -1
  271. package/src/vec3.ts +1 -1
  272. package/src/vec4.ts +1 -1
@@ -0,0 +1,175 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: 2014 Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf (proj4js)
4
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
5
+ // SPDX-FileComment: Forward geocentric equations and Hannover inverse moved/adapted from math.gl projection's proj4js 2.22.0 datumUtils.js port. See ../PROJ4-LICENSE.md. Safeguarded compensated nearest-footpoint inverse, thin-exterior/pole fixes and numeric output commit are original math.gl code, qualified with independent mathematics and offline GeographicLib 2.7 (Charles Karney, MIT).
6
+ const EPSILON = Number.EPSILON;
7
+ /** Caller supplies validated positive finite axes and eccentricity. No latitude wrapping. */
8
+ export function spheroidToCartesian(point, geometry, result = point) {
9
+ const longitude = point.x, latitude = point.y, height = point.z;
10
+ const { semiMajorAxis: a, semiMinorAxis: b, eccentricitySquared: es } = geometry;
11
+ const sin = Math.sin(latitude), cos = Math.abs(latitude) === Math.PI / 2 ? 0 : Math.cos(latitude);
12
+ // Use the axis ratio for very flat shapes: 1 - es*sin² loses polar precision.
13
+ const ratio = b / a;
14
+ const radius = es < 0.9 ? a / Math.sqrt(1 - es * sin * sin) : a / Math.hypot(cos, ratio * sin);
15
+ const x = (radius + height) * cos * Math.cos(longitude);
16
+ const y = (radius + height) * cos * Math.sin(longitude);
17
+ const z = (radius * (es < 0.9 ? 1 - es : ratio * ratio) + height) * sin;
18
+ return commit(result, x, y, z);
19
+ }
20
+ /**
21
+ * Bounded inverse. Sphere is analytic; ordinary spheroids use the retained Hannover
22
+ * iteration on exterior points. Interiors and thin-shape exteriors share a safeguarded nearest-footpoint solve.
23
+ * Equatorial interiors below the evolute cusp have two nearest normals: reject.
24
+ * false leaves output untouched, including the center and unresolved binary64 cases.
25
+ * Only exact poles canonicalize longitude; adapters may retain other conventions.
26
+ */
27
+ export function cartesianToSpheroid(point, geometry, result = point) {
28
+ const x = point.x, y = point.y, z = point.z;
29
+ const { semiMajorAxis: a, semiMinorAxis: b, eccentricitySquared: es } = geometry;
30
+ const longitude = Math.atan2(y, x);
31
+ const p = Math.hypot(x, y), rr = Math.hypot(x, y, z);
32
+ if (!(rr > 0) || !Number.isFinite(rr))
33
+ return false;
34
+ if (es === 0)
35
+ return commit(result, p === 0 ? 0 : longitude, Math.atan2(z, p), rr - a);
36
+ if (p === 0)
37
+ return commit(result, 0, (Math.sign(z) * Math.PI) / 2, Math.abs(z) - b);
38
+ const horizontal = p / a, vertical = z / b;
39
+ if (horizontal * horizontal + vertical * vertical < 1 - 16 * EPSILON)
40
+ return interiorInverse(x, y, z, p, a, b, result);
41
+ if (es >= 0.9)
42
+ return interiorInverse(x, y, z, p, a, b, result);
43
+ const ct = z / rr, st = p / rr;
44
+ let rx = 1 / Math.sqrt(1 - es * (2 - es) * st * st);
45
+ let cos = st * (1 - es) * rx, sin = ct * rx;
46
+ for (let i = 0; i < 30; i++) {
47
+ const rn = a / Math.sqrt(1 - es * sin * sin);
48
+ const height = p * cos + z * sin - rn * (1 - es * sin * sin);
49
+ const rk = (es * rn) / (rn + height);
50
+ rx = 1 / Math.sqrt(1 - rk * (2 - rk) * st * st);
51
+ const nextCos = st * (1 - rk) * rx, nextSin = ct * rx;
52
+ if (Math.abs(nextSin * cos - nextCos * sin) <= 1e-12) {
53
+ if (!Number.isFinite(height))
54
+ break;
55
+ return commit(result, longitude, Math.atan2(nextSin, Math.abs(nextCos)), height);
56
+ }
57
+ cos = nextCos;
58
+ sin = nextSin;
59
+ }
60
+ return interiorInverse(x, y, z, p, a, b, result);
61
+ }
62
+ /** Original nearest-normal solve in t = (lambda + b²)/a², avoiding interior cancellation and thin-exterior residual loss.
63
+ * The positive interval selects the globally nearest branch, rather than a stationary normal.
64
+ */
65
+ function interiorInverse(x, y, z, p, a, b, result) {
66
+ const longitude = Math.atan2(y, x);
67
+ const ratio = b / a, ratio2 = ratio * ratio;
68
+ const horizontal = p / a, vertical = z / a, delta = 1 - ratio2;
69
+ if (!(ratio2 > 0) || ratio > 1)
70
+ return false;
71
+ const aa = a * a, bb = b * b;
72
+ const ratioError = Number.isFinite(aa) && aa > 0
73
+ ? (bb -
74
+ ratio2 * aa +
75
+ productError(b, b, bb) -
76
+ ratio2 * productError(a, a, aa) -
77
+ productError(ratio2, aa, ratio2 * aa)) /
78
+ aa
79
+ : 0;
80
+ const pp = p * p, xx = x * x, yy = y * y, sum = xx + yy;
81
+ const radiusError = Number.isFinite(pp) && pp > 0
82
+ ? (sum -
83
+ pp +
84
+ sumError(xx, yy, sum) +
85
+ productError(x, x, xx) +
86
+ productError(y, y, yy) -
87
+ productError(p, p, pp)) /
88
+ (2 * p)
89
+ : 0;
90
+ const shift = a * ratio2, distance = p - a, base = distance + shift;
91
+ const correction = radiusError +
92
+ sumError(p, -a, distance) +
93
+ sumError(distance, shift, base) +
94
+ productError(a, ratio2, shift) +
95
+ a * ratioError;
96
+ if (z === 0) {
97
+ // A rounded hypot can equal the cusp for points just inside it. Include
98
+ // the radius/axis corrections before selecting a unique equatorial normal.
99
+ if (base + correction < 0)
100
+ return false;
101
+ return commit(result, longitude, 0, distance);
102
+ }
103
+ const weighted = Math.abs(vertical) * ratio;
104
+ let lower = 0, upper = ratio2 + Math.hypot(horizontal, vertical * ratio);
105
+ if (!Number.isFinite(upper))
106
+ return false;
107
+ // A lower bound near the short-axis singularity prevents thousands of bisections
108
+ // for deep, nearly equatorial interiors. No subtraction of lambda and -b².
109
+ let t = Math.max(weighted, horizontal - delta);
110
+ if (!(t > lower && t < upper))
111
+ t = upper / 2;
112
+ // Below the cusp, a vanishing polar input can make t subnormal. The
113
+ // limiting vertical footpoint remains well conditioned. Use it only when
114
+ // its bound t <= abs(z)*ratio/(a*v) is negligible relative to the cusp gap.
115
+ const gap = -(base + correction) / a;
116
+ const limiting = Math.sqrt(gap * (horizontal + delta)) / delta;
117
+ let latitude = gap > 0 && (Math.abs(z) / limiting / a) * ratio <= EPSILON * gap
118
+ ? Math.atan2((Math.sign(z) * limiting) / ratio, horizontal / delta)
119
+ : undefined;
120
+ for (let i = 0; i < 1024 && latitude === undefined; i++) {
121
+ const equatorial = delta + t;
122
+ const u = horizontal / equatorial,
123
+ // Divide by t first: both z/a and a*t can lose precision in the
124
+ // subnormal range although the near-cusp latitude is representable.
125
+ verticalAt = z / t / a, v = verticalAt * ratio;
126
+ const at = a * t, difference = base - at;
127
+ const offset = (difference + (sumError(base, -at, difference) + correction - productError(a, t, at))) /
128
+ (a * equatorial);
129
+ const term = offset * (u + 1);
130
+ const residual = term + v * v;
131
+ if (!Number.isFinite(residual))
132
+ return false;
133
+ if (residual > 0)
134
+ lower = t;
135
+ else
136
+ upper = t;
137
+ const derivative = -2 * ((u * u) / equatorial + (v * v) / t);
138
+ const next = t - residual / derivative;
139
+ const candidate = next > lower && next < upper ? next : lower + (upper - lower) / 2;
140
+ if (Math.abs(residual) <= 4 * EPSILON * (Math.abs(term) + v * v) ||
141
+ upper - lower <= 4 * EPSILON * t) {
142
+ latitude = Math.atan2(verticalAt, u);
143
+ break;
144
+ }
145
+ t = candidate;
146
+ }
147
+ return latitude !== undefined && commitNormal(result, longitude, latitude, p, z, a, ratio);
148
+ }
149
+ /** Error-free transforms on the finite squared-axis domain used by geometry adapters. */
150
+ function sumError(x, y, sum) {
151
+ const part = sum - x;
152
+ return x - (sum - part) + (y - part);
153
+ }
154
+ function productError(x, y, product) {
155
+ const sx = 134217729 * x, sy = 134217729 * y;
156
+ if (!Number.isFinite(sx) || !Number.isFinite(sy))
157
+ return 0;
158
+ const hx = sx - (sx - x), hy = sy - (sy - y), lx = x - hx, ly = y - hy;
159
+ return hx * hy - product + hx * ly + lx * hy + lx * ly;
160
+ }
161
+ /** Shared signed distance along the solved surface normal. */
162
+ function commitNormal(result, longitude, latitude, p, z, a, ratio) {
163
+ const sin = Math.sin(latitude), cos = Math.cos(latitude);
164
+ return commit(result, longitude, latitude, p * cos + z * sin - a * Math.hypot(cos, ratio * sin));
165
+ }
166
+ /** Values are captured before invoking application setters; recursive writes are safe. */
167
+ function commit(result, x, y, z) {
168
+ if (!Number.isFinite(x) || !Number.isFinite(y) || !Number.isFinite(z))
169
+ return false;
170
+ result.x = x;
171
+ result.y = y;
172
+ result.z = z;
173
+ return true;
174
+ }
175
+ //# sourceMappingURL=spheroid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spheroid.js","sourceRoot":"","sources":["../src/spheroid.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,yIAAyI;AACzI,4DAA4D;AAC5D,uYAAuY;AAOvY,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AA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KAAK,CAAC;IACpF,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;IACb,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,98 @@
1
+ /// <reference lib="es2025.float16" preserve="true" />
2
+ /**
3
+ * Type covering all non-big JavaScript typed arrays, including `Float16Array`.
4
+ *
5
+ * @remarks Including `Float16Array` does not guarantee that `globalThis.Float16Array` exists.
6
+ */
7
+ export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float16Array | Float32Array | Float64Array;
8
+ /**
9
+ * Type covering constructors for all non-big JavaScript typed arrays, including
10
+ * `Float16ArrayConstructor`.
11
+ *
12
+ * @remarks Including `Float16ArrayConstructor` does not install `globalThis.Float16Array`.
13
+ */
14
+ export type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float16ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
15
+ /**
16
+ * Type covering all big typed arrays
17
+ */
18
+ export type BigTypedArray = BigInt64Array | BigUint64Array;
19
+ /**
20
+ * Type covering constructors for all big typed arrays
21
+ */
22
+ export type BigTypedArrayConstructor = BigInt64ArrayConstructor | BigUint64ArrayConstructor;
23
+ /**
24
+ * Type for classic arrays consisting of numbers
25
+ * @note Included for completeness / orthogonality, prefer `number[]` in actual use
26
+ */
27
+ export type NumberArray = number[];
28
+ /** Array with exactly 1 number */
29
+ export type NumberArray1 = [number];
30
+ /** Array with exactly 2 numbers */
31
+ export type NumberArray2 = [number, number];
32
+ /** Array with exactly 3 numbers */
33
+ export type NumberArray3 = [number, number, number];
34
+ /** Array with exactly 4 numbers */
35
+ export type NumberArray4 = [number, number, number, number];
36
+ /** Array with exactly 6 numbers */
37
+ export type NumberArray6 = [number, number, number, number, number, number];
38
+ /** Array with exactly 8 numbers */
39
+ export type NumberArray8 = [number, number, number, number, number, number, number, number];
40
+ /** Array with exactly 9 numbers */
41
+ export type NumberArray9 = [number, number, number, number, number, number, number, number, number];
42
+ /** Array with exactly 12 numbers */
43
+ export type NumberArray12 = [
44
+ number,
45
+ number,
46
+ number,
47
+ number,
48
+ number,
49
+ number,
50
+ number,
51
+ number,
52
+ number,
53
+ number,
54
+ number,
55
+ number
56
+ ];
57
+ /** Array with exactly 16 numbers */
58
+ export type NumberArray16 = [
59
+ number,
60
+ number,
61
+ number,
62
+ number,
63
+ number,
64
+ number,
65
+ number,
66
+ number,
67
+ number,
68
+ number,
69
+ number,
70
+ number,
71
+ number,
72
+ number,
73
+ number,
74
+ number
75
+ ];
76
+ /**
77
+ * Type covering classic arrays consisting of numbers as well as typed arrays
78
+ */
79
+ export type NumericArray = TypedArray | number[];
80
+ /** Array with exactly 1 number, or a typed array */
81
+ export type NumericArray1 = NumberArray1 | TypedArray;
82
+ /** Array with exactly 2 numbers, or a typed array */
83
+ export type NumericArray2 = NumberArray2 | TypedArray;
84
+ /** Array with exactly 3 numbers, or a typed array */
85
+ export type NumericArray3 = NumberArray3 | TypedArray;
86
+ /** Array with exactly 4 numbers, or a typed array */
87
+ export type NumericArray4 = NumberArray4 | TypedArray;
88
+ /** Array with exactly 6 numbers, or a typed array */
89
+ export type NumericArray6 = NumberArray6 | TypedArray;
90
+ /** Array with exactly 8 numbers, or a typed array */
91
+ export type NumericArray8 = NumberArray8 | TypedArray;
92
+ /** Array with exactly 9 numbers, or a typed array */
93
+ export type NumericArray9 = NumberArray9 | TypedArray;
94
+ /** Array with exactly 12 numbers, or a typed array */
95
+ export type NumericArray12 = NumberArray12 | TypedArray;
96
+ /** Array with exactly 16 numbers, or a typed array */
97
+ export type NumericArray16 = NumberArray16 | TypedArray;
98
+ //# sourceMappingURL=array-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file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CAAC;AAExD,sDAAsD;AACtD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,UAAU,CAAC"}
@@ -0,0 +1,6 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ /// <reference lib="es2025.float16" preserve="true" />
5
+ export {};
6
+ //# sourceMappingURL=array-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-types.js","sourceRoot":"","sources":["../../src/types/array-types.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAK5D,sDAAsD"}
@@ -0,0 +1,21 @@
1
+ declare function BigIntUnavailable(): void;
2
+ declare namespace BigIntUnavailable {
3
+ var asIntN: () => never;
4
+ var asUintN: () => never;
5
+ }
6
+ declare class BigInt64ArrayUnavailable {
7
+ static get BYTES_PER_ELEMENT(): number;
8
+ static of(): void;
9
+ static from(): void;
10
+ constructor();
11
+ }
12
+ export declare const BigIntAvailable: boolean;
13
+ export declare const BigInt64ArrayAvailable: boolean;
14
+ export declare const BigUint64ArrayAvailable: boolean;
15
+ declare const BigIntCtor: typeof BigIntUnavailable | BigIntConstructor;
16
+ declare const BigInt64ArrayCtor: BigInt64ArrayConstructor | typeof BigInt64ArrayUnavailable;
17
+ declare const BigUint64ArrayCtor: BigUint64ArrayConstructor | typeof BigInt64ArrayUnavailable;
18
+ export { BigIntCtor as BigInt };
19
+ export { BigInt64ArrayCtor as BigInt64Array };
20
+ export { BigUint64ArrayCtor as BigUint64Array };
21
+ //# sourceMappingURL=bigint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../src/types/bigint.ts"],"names":[],"mappings":"AA8BA,iBAAS,iBAAiB,SAEzB;kBAFQ,iBAAiB;;;;AAU1B,cAAM,wBAAwB;IAC5B,MAAM,KAAK,iBAAiB,WAE3B;IACD,MAAM,CAAC,EAAE;IAGT,MAAM,CAAC,IAAI;;CAMZ;AAED,eAAO,MAAM,eAAe,SAAgC,CAAC;AAC7D,eAAO,MAAM,sBAAsB,SAAuC,CAAC;AAC3E,eAAO,MAAM,uBAAuB,SAAwC,CAAC;AAE7E,QAAA,MAAM,UAAU,8CAEZ,CAAC;AAEL,QAAA,MAAM,iBAAiB,4DAEnB,CAAC;AAEL,QAAA,MAAM,kBAAkB,6DAEpB,CAAC;AAEL,OAAO,EAAC,UAAU,IAAI,MAAM,EAAC,CAAC;AAC9B,OAAO,EAAC,iBAAiB,IAAI,aAAa,EAAC,CAAC;AAC5C,OAAO,EAAC,kBAAkB,IAAI,cAAc,EAAC,CAAC"}
@@ -0,0 +1,65 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT AND Apache-2.0
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // SPDX-FileCopyrightText: Copyright 2016-2019 The Apache Software Foundation
5
+ // SPDX-FileComment: BigInt availability/fallback structure adapted from Apache Arrow JS util/compat.ts; compared with apache-arrow-4.0.0. See ../../ARROW-NOTICE.txt and ../../APACHE-2.0-LICENSE.txt. Modified to separate availability flags, share errors and narrow exports.
6
+ // Licensed to the Apache Software Foundation (ASF) under one
7
+ // or more contributor license agreements. See the NOTICE file
8
+ // distributed with this work for additional information
9
+ // regarding copyright ownership. The ASF licenses this file
10
+ // to you under the Apache License, Version 2.0 (the
11
+ // "License"); you may not use this file except in compliance
12
+ // with the License. You may obtain a copy of the License at
13
+ //
14
+ // http://www.apache.org/licenses/LICENSE-2.0
15
+ //
16
+ // Unless required by applicable law or agreed to in writing,
17
+ // software distributed under the License is distributed on an
18
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19
+ // KIND, either express or implied. See the License for the
20
+ // specific language governing permissions and limitations
21
+ // under the License.
22
+ // BigInt compatibility layer
23
+ // Source comparison: https://github.com/apache/arrow/blob/apache-arrow-4.0.0/js/src/util/compat.ts
24
+ // Requires tsconfig.json: target=esnext or (lib: esnext.bigint)
25
+ // Requires eslint: env: {es2020: true}
26
+ const ERR_BIGINT_UNAVAILABLE = 'BigInt is not available in this environment';
27
+ function BigIntUnavailable() {
28
+ throw new Error(ERR_BIGINT_UNAVAILABLE);
29
+ }
30
+ BigIntUnavailable.asIntN = () => {
31
+ throw new Error(ERR_BIGINT_UNAVAILABLE);
32
+ };
33
+ BigIntUnavailable.asUintN = () => {
34
+ throw new Error(ERR_BIGINT_UNAVAILABLE);
35
+ };
36
+ class BigInt64ArrayUnavailable {
37
+ static get BYTES_PER_ELEMENT() {
38
+ return 8;
39
+ }
40
+ static of() {
41
+ throw new Error(ERR_BIGINT_UNAVAILABLE);
42
+ }
43
+ static from() {
44
+ throw new Error(ERR_BIGINT_UNAVAILABLE);
45
+ }
46
+ constructor() {
47
+ throw new Error(ERR_BIGINT_UNAVAILABLE);
48
+ }
49
+ }
50
+ export const BigIntAvailable = typeof BigInt !== 'undefined';
51
+ export const BigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined';
52
+ export const BigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined';
53
+ const BigIntCtor = (() => {
54
+ return BigIntAvailable ? BigInt : BigIntUnavailable;
55
+ })();
56
+ const BigInt64ArrayCtor = (() => {
57
+ return BigInt64ArrayAvailable ? BigInt64Array : BigInt64ArrayUnavailable;
58
+ })();
59
+ const BigUint64ArrayCtor = (() => {
60
+ return BigUint64ArrayAvailable ? BigUint64Array : BigInt64ArrayUnavailable;
61
+ })();
62
+ export { BigIntCtor as BigInt };
63
+ export { BigInt64ArrayCtor as BigInt64Array };
64
+ export { BigUint64ArrayCtor as BigUint64Array };
65
+ //# sourceMappingURL=bigint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigint.js","sourceRoot":"","sources":["../../src/types/bigint.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,8CAA8C;AAC9C,4DAA4D;AAC5D,6EAA6E;AAC7E,iRAAiR;AAEjR,6DAA6D;AAC7D,+DAA+D;AAC/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,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACtD,CAAC,CAAC,EAAE,CAAC;AAEL,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE;IAC9B,OAAO,sBAAsB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,wBAAwB,CAAC;AAC3E,CAAC,CAAC,EAAE,CAAC;AAEL,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE;IAC/B,OAAO,uBAAuB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,wBAAwB,CAAC;AAC7E,CAAC,CAAC,EAAE,CAAC;AAEL,OAAO,EAAC,UAAU,IAAI,MAAM,EAAC,CAAC;AAC9B,OAAO,EAAC,iBAAiB,IAAI,aAAa,EAAC,CAAC;AAC5C,OAAO,EAAC,kBAAkB,IAAI,cAAc,EAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** 2 dimensional bounds [[minX, minY], [maxX, maxY]] */
2
+ export type Bounds2D = [[number, number], [number, number]];
3
+ /** 3 dimensional bounds [[minX, minY, minZ], [maxX, maxY, maxZ]] */
4
+ export type Bounds3D = [[number, number, number], [number, number, number]];
5
+ /** 2 or 3 dimensional bounds [[minX, minY], [maxX, maxY]] or [[minX, minY, minZ], [maxX, maxY, maxZ]] */
6
+ export type Bounds = [[number, number], [number, number]] | [[number, number, number], [number, number, number]];
7
+ /** Checks if a `Bounds` is a `Bounds2D` */
8
+ export declare function isBounds2D(bounds: Bounds): bounds is Bounds2D;
9
+ /** Accepts 2D and 3D bounds and returns a 2D bound, truncating 3D dimension if necessary */
10
+ export declare function getBounds2D(bounds: Bounds): Bounds2D;
11
+ //# sourceMappingURL=bounds-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounds-types.d.ts","sourceRoot":"","sources":["../../src/types/bounds-types.ts"],"names":[],"mappings":"AAIA,wDAAwD;AACxD,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5D,oEAAoE;AACpE,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5E,yGAAyG;AACzG,MAAM,MAAM,MAAM,GACd,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACpC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEzD,2CAA2C;AAC3C,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,QAAQ,CAE7D;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAOpD"}
@@ -0,0 +1,17 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ /** Checks if a `Bounds` is a `Bounds2D` */
5
+ export function isBounds2D(bounds) {
6
+ return bounds.length === 2 && bounds[0].length === 2 && bounds[1].length === 2;
7
+ }
8
+ /** Accepts 2D and 3D bounds and returns a 2D bound, truncating 3D dimension if necessary */
9
+ export function getBounds2D(bounds) {
10
+ return isBounds2D(bounds)
11
+ ? bounds
12
+ : [
13
+ [bounds[0][0], bounds[0][1]],
14
+ [bounds[1][0], bounds[1][1]]
15
+ ];
16
+ }
17
+ //# sourceMappingURL=bounds-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounds-types.js","sourceRoot":"","sources":["../../src/types/bounds-types.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAa5D,2CAA2C;AAC3C,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACjF,CAAC;AAED,4FAA4F;AAC5F,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,CAAC,CAAC,MAAM;QACR,CAAC,CAAC;YACE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5B,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC7B,CAAC;AACR,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { TypedArrayConstructor } from "./array-types.js";
2
+ /**
3
+ * Checks for native Float16Array values, including arrays from other realms.
4
+ * Does not identify Uint16Array binary16 storage as a decoded Float16Array.
5
+ * Does not require a Float16Array constructor in the current realm.
6
+ */
7
+ export declare function isFloat16Array(value: unknown): value is Float16Array;
8
+ /**
9
+ * The native `Float16Array` constructor exposed by the current JavaScript runtime.
10
+ *
11
+ * @remarks This is `undefined` when the runtime does not provide `Float16Array`. The value is
12
+ * captured when this module is evaluated, so a polyfill must be installed before importing
13
+ * `@math.gl/core/types`.
14
+ */
15
+ export declare const NativeFloat16ArrayConstructor: TypedArrayConstructor | undefined;
16
+ /**
17
+ * Returns the typed array constructor used for half-precision storage.
18
+ *
19
+ * @returns The native `Float16Array` constructor when available, otherwise `Uint16Array`.
20
+ * @remarks The `Uint16Array` fallback stores encoded IEEE 754 binary16 bit patterns. Unlike a
21
+ * native `Float16Array`, it does not encode numeric assignments or decode values when read.
22
+ */
23
+ export declare function getFloat16ArrayConstructor(): TypedArrayConstructor;
24
+ /**
25
+ * Checks whether a value is the native `Float16Array` constructor for the current runtime.
26
+ *
27
+ * @param value The value to test.
28
+ * @returns `true` when `value` matches `NativeFloat16ArrayConstructor`. Returns `false` for the
29
+ * `Uint16Array` fallback.
30
+ */
31
+ export declare function isFloat16ArrayConstructor(value: unknown): boolean;
32
+ //# sourceMappingURL=float16.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"float16.d.ts","sourceRoot":"","sources":["../../src/types/float16.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,qBAAqB,EAAC,yBAAsB;AAGzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,EAAE,qBAAqB,GAAG,SAC3C,CAAC;AAE1B;;;;;;GAMG;AACH,wBAAgB,0BAA0B,IAAI,qBAAqB,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEjE"}
@@ -0,0 +1,41 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { getTypedArrayName } from "./typed-array-brand.js";
5
+ /**
6
+ * Checks for native Float16Array values, including arrays from other realms.
7
+ * Does not identify Uint16Array binary16 storage as a decoded Float16Array.
8
+ * Does not require a Float16Array constructor in the current realm.
9
+ */
10
+ export function isFloat16Array(value) {
11
+ return getTypedArrayName(value) === 'Float16Array';
12
+ }
13
+ /**
14
+ * The native `Float16Array` constructor exposed by the current JavaScript runtime.
15
+ *
16
+ * @remarks This is `undefined` when the runtime does not provide `Float16Array`. The value is
17
+ * captured when this module is evaluated, so a polyfill must be installed before importing
18
+ * `@math.gl/core/types`.
19
+ */
20
+ export const NativeFloat16ArrayConstructor = globalThis.Float16Array;
21
+ /**
22
+ * Returns the typed array constructor used for half-precision storage.
23
+ *
24
+ * @returns The native `Float16Array` constructor when available, otherwise `Uint16Array`.
25
+ * @remarks The `Uint16Array` fallback stores encoded IEEE 754 binary16 bit patterns. Unlike a
26
+ * native `Float16Array`, it does not encode numeric assignments or decode values when read.
27
+ */
28
+ export function getFloat16ArrayConstructor() {
29
+ return NativeFloat16ArrayConstructor ?? Uint16Array;
30
+ }
31
+ /**
32
+ * Checks whether a value is the native `Float16Array` constructor for the current runtime.
33
+ *
34
+ * @param value The value to test.
35
+ * @returns `true` when `value` matches `NativeFloat16ArrayConstructor`. Returns `false` for the
36
+ * `Uint16Array` fallback.
37
+ */
38
+ export function isFloat16ArrayConstructor(value) {
39
+ return Boolean(NativeFloat16ArrayConstructor && value === NativeFloat16ArrayConstructor);
40
+ }
41
+ //# sourceMappingURL=float16.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"float16.js","sourceRoot":"","sources":["../../src/types/float16.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAG5D,OAAO,EAAC,iBAAiB,EAAC,+BAA4B;AAEtD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,iBAAiB,CAAC,KAAK,CAAC,KAAK,cAAc,CAAC;AACrD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GACxC,UAAU,CAAC,YAAY,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,6BAA6B,IAAI,WAAW,CAAC;AACtD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAc;IACtD,OAAO,OAAO,CAAC,6BAA6B,IAAI,KAAK,KAAK,6BAA6B,CAAC,CAAC;AAC3F,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type { TypedArray, TypedArrayConstructor, BigTypedArray, BigTypedArrayConstructor, NumberArray, NumberArray1, NumberArray2, NumberArray3, NumberArray4, NumberArray6, NumberArray8, NumberArray9, NumberArray12, NumberArray16, NumericArray, NumericArray1, NumericArray2, NumericArray3, NumericArray4, NumericArray6, NumericArray8, NumericArray9, NumericArray12, NumericArray16 } from "./array-types.js";
2
+ export { isTypedArray, isUint16Array, isNumberArray, isNumericArray } from "./is-array.js";
3
+ export { NativeFloat16ArrayConstructor, getFloat16ArrayConstructor, isFloat16ArrayConstructor, isFloat16Array } from "./float16.js";
4
+ export type { Bounds, Bounds2D, Bounds3D } from "./bounds-types.js";
5
+ export type { SpheroidParameters } from "./spheroid.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAEV,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,wBAAwB,EAExB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EAEb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACf,yBAAsB;AAEvB,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAC,sBAAmB;AACtF,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,cAAc,EACf,qBAAkB;AAEnB,YAAY,EAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAC,0BAAuB;AAE/D,YAAY,EAAC,kBAAkB,EAAC,sBAAmB"}
@@ -0,0 +1,6 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ export { isTypedArray, isUint16Array, isNumberArray, isNumericArray } from "./is-array.js";
5
+ export { NativeFloat16ArrayConstructor, getFloat16ArrayConstructor, isFloat16ArrayConstructor, isFloat16Array } from "./float16.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAgC5D,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAC,sBAAmB;AACtF,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,cAAc,EACf,qBAAkB"}
@@ -0,0 +1,22 @@
1
+ import { TypedArray, NumericArray, NumberArray } from "./array-types.js";
2
+ /** Checks for unsigned 16-bit samples, including typed arrays from other realms. */
3
+ export declare function isUint16Array(value: unknown): value is Uint16Array;
4
+ /**
5
+ * Check is an array is a typed array
6
+ * @param value value to be tested
7
+ * @returns input with type narrowed to TypedArray, or null
8
+ */
9
+ export declare function isTypedArray(value: unknown): value is TypedArray;
10
+ /**
11
+ * Check is an array is an array of numbers)
12
+ * @param value value to be tested
13
+ * @returns input with type narrowed to NumberArray, or null
14
+ */
15
+ export declare function isNumberArray(value: unknown): value is NumberArray;
16
+ /**
17
+ * Check is an array is a numeric array (typed array or array of numbers)
18
+ * @param value value to be tested
19
+ * @returns input with type narrowed to NumericArray, or null
20
+ */
21
+ export declare function isNumericArray(value: unknown): value is NumericArray;
22
+ //# sourceMappingURL=is-array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-array.d.ts","sourceRoot":"","sources":["../../src/types/is-array.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,YAAY,EAAE,WAAW,EAAC,yBAAsB;AAGpE,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAKlE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE"}
@@ -0,0 +1,36 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { getTypedArrayName } from "./typed-array-brand.js";
5
+ /** Checks for unsigned 16-bit samples, including typed arrays from other realms. */
6
+ export function isUint16Array(value) {
7
+ return getTypedArrayName(value) === 'Uint16Array';
8
+ }
9
+ /**
10
+ * Check is an array is a typed array
11
+ * @param value value to be tested
12
+ * @returns input with type narrowed to TypedArray, or null
13
+ */
14
+ export function isTypedArray(value) {
15
+ return ArrayBuffer.isView(value) && !(value instanceof DataView);
16
+ }
17
+ /**
18
+ * Check is an array is an array of numbers)
19
+ * @param value value to be tested
20
+ * @returns input with type narrowed to NumberArray, or null
21
+ */
22
+ export function isNumberArray(value) {
23
+ if (Array.isArray(value)) {
24
+ return value.length === 0 || typeof value[0] === 'number';
25
+ }
26
+ return false;
27
+ }
28
+ /**
29
+ * Check is an array is a numeric array (typed array or array of numbers)
30
+ * @param value value to be tested
31
+ * @returns input with type narrowed to NumericArray, or null
32
+ */
33
+ export function isNumericArray(value) {
34
+ return isTypedArray(value) || isNumberArray(value);
35
+ }
36
+ //# sourceMappingURL=is-array.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-array.js","sourceRoot":"","sources":["../../src/types/is-array.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAG5D,OAAO,EAAC,iBAAiB,EAAC,+BAA4B;AAEtD,oFAAoF;AACpF,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,iBAAiB,CAAC,KAAK,CAAC,KAAK,aAAa,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,YAAY,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC;IAC5D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** Geometry of a sphere or oblate spheroid, in metres. No datum, axes or epoch metadata.
2
+ * Both axes must be finite and positive, with semiMinorAxis <= semiMajorAxis.
3
+ */
4
+ export type SpheroidParameters = {
5
+ readonly semiMajorAxis: number;
6
+ readonly semiMinorAxis: number;
7
+ };
8
+ //# sourceMappingURL=spheroid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spheroid.d.ts","sourceRoot":"","sources":["../../src/types/spheroid.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,CAAC"}