@ac-kit/math-geodesy 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/LICENSE +57 -0
  3. package/README.md +89 -2
  4. package/dist/_brand.d.ts +14 -0
  5. package/dist/_brand.d.ts.map +1 -0
  6. package/dist/_brand.js +2 -0
  7. package/dist/_brand.js.map +1 -0
  8. package/dist/_ecef-forward-bound.d.ts +7 -0
  9. package/dist/_ecef-forward-bound.d.ts.map +1 -0
  10. package/dist/_ecef-forward-bound.js +7 -0
  11. package/dist/_ecef-forward-bound.js.map +1 -0
  12. package/dist/_ecef-height.d.ts +33 -0
  13. package/dist/_ecef-height.d.ts.map +1 -0
  14. package/dist/_ecef-height.js +173 -0
  15. package/dist/_ecef-height.js.map +1 -0
  16. package/dist/ellipsoid.d.ts +52 -0
  17. package/dist/ellipsoid.d.ts.map +1 -0
  18. package/dist/ellipsoid.js +75 -0
  19. package/dist/ellipsoid.js.map +1 -0
  20. package/dist/geodesic/_angle.d.ts +46 -0
  21. package/dist/geodesic/_angle.d.ts.map +1 -0
  22. package/dist/geodesic/_angle.js +144 -0
  23. package/dist/geodesic/_angle.js.map +1 -0
  24. package/dist/geodesic/_constants.d.ts +38 -0
  25. package/dist/geodesic/_constants.d.ts.map +1 -0
  26. package/dist/geodesic/_constants.js +142 -0
  27. package/dist/geodesic/_constants.js.map +1 -0
  28. package/dist/geodesic/_inverse.d.ts +22 -0
  29. package/dist/geodesic/_inverse.d.ts.map +1 -0
  30. package/dist/geodesic/_inverse.js +720 -0
  31. package/dist/geodesic/_inverse.js.map +1 -0
  32. package/dist/geodesic/_line.d.ts +37 -0
  33. package/dist/geodesic/_line.d.ts.map +1 -0
  34. package/dist/geodesic/_line.js +219 -0
  35. package/dist/geodesic/_line.js.map +1 -0
  36. package/dist/geodesic/_series.d.ts +69 -0
  37. package/dist/geodesic/_series.d.ts.map +1 -0
  38. package/dist/geodesic/_series.js +203 -0
  39. package/dist/geodesic/_series.js.map +1 -0
  40. package/dist/geodesic.d.ts +97 -0
  41. package/dist/geodesic.d.ts.map +1 -0
  42. package/dist/geodesic.js +245 -0
  43. package/dist/geodesic.js.map +1 -0
  44. package/dist/geodetic.d.ts +195 -0
  45. package/dist/geodetic.d.ts.map +1 -0
  46. package/dist/geodetic.js +456 -0
  47. package/dist/geodetic.js.map +1 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +5 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/local-frame.d.ts +19 -0
  53. package/dist/local-frame.d.ts.map +1 -0
  54. package/dist/local-frame.js +66 -0
  55. package/dist/local-frame.js.map +1 -0
  56. package/package.json +73 -3
@@ -0,0 +1,456 @@
1
+ import { isCloseAbsolute, numberAtOrNaN } from "@ac-kit/core";
2
+ import { geometryConfig } from "@ac-kit/math-geometry";
3
+ import { vec3ArrayIsFinite, vec3Create } from "@ac-kit/math-linear";
4
+ import { atan2DegInPlace, DEG_TO_RAD, sinCosDegInPlace, } from "@ac-kit/math-scalar";
5
+ import { HEIGHT_FLATTENING_, HEIGHT_RESULT_, HEIGHT_SEMI_MAJOR_AXIS_, HEIGHT_SINE_, HEIGHT_X_, HEIGHT_Y_, HEIGHT_Z_, heightAboveEllipsoid_, heightRegisters_, } from "./_ecef-height.js";
6
+ /**
7
+ * Every creator copies this array, which holds non-integer doubles and is never
8
+ * exposed.
9
+ */
10
+ const TEMPLATE_ = [0.5, 0.5, 0.5];
11
+ /**
12
+ * Creates the position `[0, 0, 0]`.
13
+ *
14
+ * Allocates; keep it out of hot loops.
15
+ */
16
+ export function geodeticCreate() {
17
+ const out = TEMPLATE_.slice();
18
+ out[0] = 0;
19
+ out[1] = 0;
20
+ out[2] = 0;
21
+ return out;
22
+ }
23
+ /**
24
+ * Creates the position `longitudeDeg, latitudeDeg, heightM`.
25
+ *
26
+ * Allocates; keep it out of hot loops.
27
+ */
28
+ export function geodeticOf(longitudeDeg, latitudeDeg, heightM) {
29
+ const out = TEMPLATE_.slice();
30
+ out[0] = longitudeDeg;
31
+ out[1] = latitudeDeg;
32
+ out[2] = heightM;
33
+ return out;
34
+ }
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 function geodeticClone(a) {
41
+ const out = TEMPLATE_.slice();
42
+ out[0] = a[0];
43
+ out[1] = a[1];
44
+ out[2] = a[2];
45
+ return out;
46
+ }
47
+ /** Writes the components, in storage order, into `out`. */
48
+ export function geodeticSet(out, longitudeDeg, latitudeDeg, heightM) {
49
+ out[0] = longitudeDeg;
50
+ out[1] = latitudeDeg;
51
+ out[2] = heightM;
52
+ return out;
53
+ }
54
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
55
+ export function geodeticCopy(out, a) {
56
+ out[0] = a[0];
57
+ out[1] = a[1];
58
+ out[2] = a[2];
59
+ return out;
60
+ }
61
+ /**
62
+ * Exact component-wise equality: `−0` equals `+0`, `NaN` equals nothing, itself
63
+ * included. A longitude of 180° and one of −180° are different numbers. See
64
+ * {@link geodeticIsClose} for a tolerant test.
65
+ */
66
+ export function geodeticEquals(a, b) {
67
+ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
68
+ }
69
+ /**
70
+ * Component-wise approximate equality: every pair differs by at most
71
+ * `tolerance`, the same absolute bound for degrees and metres (pass one that
72
+ * suits both, or compare the parts yourself). Longitudes are compared as
73
+ * numbers, not around the antimeridian.
74
+ *
75
+ * @param tolerance Defaults to `geometryConfig.defaultLinearTolerance`.
76
+ */
77
+ export function geodeticIsClose(a, b, tolerance = geometryConfig.defaultLinearTolerance) {
78
+ return (isCloseAbsolute(a[0], b[0], tolerance) &&
79
+ isCloseAbsolute(a[1], b[1], tolerance) &&
80
+ isCloseAbsolute(a[2], b[2], tolerance));
81
+ }
82
+ /**
83
+ * The checked way in from untyped data: `source[offset … offset + 3)` copied
84
+ * into `out`, each element that is not a number written as `NaN`, an index past
85
+ * the end too. A cold path: buffers use {@link geodeticLoad}. `source` may be
86
+ * `out`. O(1).
87
+ */
88
+ export function geodeticFromArray(out, source, offset = 0) {
89
+ const value0 = numberAtOrNaN(source, offset);
90
+ const value1 = numberAtOrNaN(source, offset + 1);
91
+ const value2 = numberAtOrNaN(source, offset + 2);
92
+ out[0] = value0;
93
+ out[1] = value1;
94
+ out[2] = value2;
95
+ return out;
96
+ }
97
+ /**
98
+ * Whether every component is a finite number: the check after parsing untrusted
99
+ * data.
100
+ */
101
+ export function geodeticIsFinite(value) {
102
+ return (Number.isFinite(value[0]) &&
103
+ Number.isFinite(value[1]) &&
104
+ Number.isFinite(value[2]));
105
+ }
106
+ /**
107
+ * Writes element `index` of `array`, the numbers at `[index·3, index·3 + 3)`,
108
+ * into `out`. Each component is written as `+array[i]`, so an index past the
109
+ * end gives `NaN`, never `undefined`. O(1).
110
+ */
111
+ export function geodeticLoad(out, array, index) {
112
+ const base = index * 3;
113
+ // The `!` is for the compiler: past the end `+undefined` is `NaN`.
114
+ out[0] = +array[base];
115
+ out[1] = +array[base + 1];
116
+ out[2] = +array[base + 2];
117
+ return out;
118
+ }
119
+ /**
120
+ * Writes `value` into `array` as element `index`. An element past the end of
121
+ * `array` writes nothing. O(1).
122
+ */
123
+ export function geodeticStore(array, index, value) {
124
+ const base = index * 3;
125
+ array[base] = value[0];
126
+ array[base + 1] = value[1];
127
+ array[base + 2] = value[2];
128
+ }
129
+ /**
130
+ * Like {@link geodeticLoad} for interleaved data: element `index` starts at
131
+ * `offset + index·stride`, both counted in numbers. O(1).
132
+ */
133
+ export function geodeticLoadStrided(out, array, offset, stride, index) {
134
+ const base = offset + index * stride;
135
+ out[0] = +array[base];
136
+ out[1] = +array[base + 1];
137
+ out[2] = +array[base + 2];
138
+ return out;
139
+ }
140
+ /**
141
+ * Like {@link geodeticStore} for interleaved data: element `index` starts at
142
+ * `offset + index·stride`, both counted in numbers. O(1).
143
+ */
144
+ export function geodeticStoreStrided(array, offset, stride, index, value) {
145
+ const base = offset + index * stride;
146
+ array[base] = value[0];
147
+ array[base + 1] = value[1];
148
+ array[base + 2] = value[2];
149
+ }
150
+ /**
151
+ * Whether every number of `array` is finite (`vec3ArrayIsFinite`: a buffer of
152
+ * triples). O(n).
153
+ */
154
+ export function geodeticArrayIsFinite(array) {
155
+ return vec3ArrayIsFinite(array);
156
+ }
157
+ /** Creates the result `[0, 0, 0]`. Allocates; keep it out of hot loops. */
158
+ export function geodesicInverseCreate() {
159
+ const out = TEMPLATE_.slice();
160
+ out[0] = 0;
161
+ out[1] = 0;
162
+ out[2] = 0;
163
+ return out;
164
+ }
165
+ /** Creates the result `distanceM, azimuth1Deg, azimuth2Deg`. Allocates. */
166
+ export function geodesicInverseOf(distanceM, azimuth1Deg, azimuth2Deg) {
167
+ const out = TEMPLATE_.slice();
168
+ out[0] = distanceM;
169
+ out[1] = azimuth1Deg;
170
+ out[2] = azimuth2Deg;
171
+ return out;
172
+ }
173
+ /** Creates a copy of `a`. Allocates. */
174
+ export function geodesicInverseClone(a) {
175
+ const out = TEMPLATE_.slice();
176
+ out[0] = a[0];
177
+ out[1] = a[1];
178
+ out[2] = a[2];
179
+ return out;
180
+ }
181
+ /** Writes the components into `out`. */
182
+ export function geodesicInverseSet(out, distanceM, azimuth1Deg, azimuth2Deg) {
183
+ out[0] = distanceM;
184
+ out[1] = azimuth1Deg;
185
+ out[2] = azimuth2Deg;
186
+ return out;
187
+ }
188
+ /** Writes a copy of `a` into `out`. `out` may be `a`. */
189
+ export function geodesicInverseCopy(out, a) {
190
+ out[0] = a[0];
191
+ out[1] = a[1];
192
+ out[2] = a[2];
193
+ return out;
194
+ }
195
+ /** Exact component-wise equality: `NaN` equals nothing, itself included. */
196
+ export function geodesicInverseEquals(a, b) {
197
+ return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
198
+ }
199
+ /**
200
+ * Component-wise approximate equality with one absolute `tolerance` for the
201
+ * metres and the degrees. Azimuths are compared as numbers, not around ±180°.
202
+ *
203
+ * @param tolerance Defaults to `geometryConfig.defaultLinearTolerance`.
204
+ */
205
+ export function geodesicInverseIsClose(a, b, tolerance = geometryConfig.defaultLinearTolerance) {
206
+ return (isCloseAbsolute(a[0], b[0], tolerance) &&
207
+ isCloseAbsolute(a[1], b[1], tolerance) &&
208
+ isCloseAbsolute(a[2], b[2], tolerance));
209
+ }
210
+ /**
211
+ * Whether every component is a finite number: `false` for the `NaN` result of
212
+ * an undefined problem.
213
+ */
214
+ export function geodesicInverseIsFinite(value) {
215
+ return (Number.isFinite(value[0]) &&
216
+ Number.isFinite(value[1]) &&
217
+ Number.isFinite(value[2]));
218
+ }
219
+ /**
220
+ * Writes the Earth-centred, Earth-fixed coordinates, metres, of the geodetic
221
+ * `position` on `ellipsoid` into `out`: x through the equator at longitude 0, z
222
+ * through the north pole.
223
+ *
224
+ * The closed form `x = (N + h)·cosφ·cosλ`, `y = (N + h)·cosφ·sinλ`, `z = (N(1 −
225
+ * e²) + h)·sinφ` with the prime-vertical radius `N = a / √(cos²φ + (1 −
226
+ * f)²·sin²φ)`, using the polar ratio `1 − f` itself so that an extreme
227
+ * flattening (whose `e²` rounds to 1) still works. Each angle is reduced
228
+ * exactly in degrees to within 45° of a multiple of 90°, as `sinDeg` does; the
229
+ * remainder's sine comes from `Math.sin` and its cosine from `√(1 − sin²)`, so
230
+ * the poles and the cardinal meridians are exact. Each coordinate is within
231
+ * `5·2⁻⁵³·(a + |h|)` of the exact value, 3.5 nm at sea level (see the README).
232
+ * A component that is not finite gives `NaN` in all three; any finite height
233
+ * works. O(1).
234
+ */
235
+ export function ecefFromGeodetic(out, position, ellipsoid) {
236
+ // Read before the scratch is written, and the result before `out` is: a
237
+ // getter on `position` or a setter on `out` may run another conversion.
238
+ const longitude = position[0];
239
+ const latitude = position[1];
240
+ const height = position[2];
241
+ ecefInputScratch_[0] = longitude;
242
+ ecefInputScratch_[1] = latitude;
243
+ ecefInputScratch_[2] = height;
244
+ ecefWrite_(ecefOutputScratch_, ecefInputScratch_, 0, ellipsoid);
245
+ const x = ecefOutputScratch_[0];
246
+ const y = ecefOutputScratch_[1];
247
+ const z = ecefOutputScratch_[2];
248
+ out[0] = x;
249
+ out[1] = y;
250
+ out[2] = z;
251
+ return out;
252
+ }
253
+ const ecefInputScratch_ = new Float64Array(3);
254
+ const ecefOutputScratch_ = new Float64Array(3);
255
+ const ONE_NINETIETH_ = 1 / 90;
256
+ /**
257
+ * The forward conversion of the triple at `input[base … base + 3)` into
258
+ * `out[base … base + 3)`, reading before writing. Its parameters are arrays, an
259
+ * index and the record, never a double, so V8 boxes nothing when it does not
260
+ * inline it. Multiplying by `1/90` rather than dividing may round a quotient
261
+ * near an odd multiple of 45° the other way, which only picks the other
262
+ * quadrant of two equally accurate ones; the multiples of 90° stay exact.
263
+ */
264
+ function ecefWrite_(out, input, base, ellipsoid) {
265
+ const longitude = input[base];
266
+ const latitude = input[base + 1];
267
+ const height = input[base + 2];
268
+ if (!(Number.isFinite(longitude) &&
269
+ Number.isFinite(latitude) &&
270
+ Number.isFinite(height))) {
271
+ out[base] = Number.NaN;
272
+ out[base + 1] = Number.NaN;
273
+ out[base + 2] = Number.NaN;
274
+ return;
275
+ }
276
+ // Longitude and latitude reduced to (−180, 180], then to a remainder within
277
+ // 45° of the multiple `quadrant`·90°.
278
+ let longitudeReduced = longitude > -180 && longitude <= 180 ? longitude : longitude % 360;
279
+ if (longitudeReduced > 180) {
280
+ longitudeReduced -= 360;
281
+ }
282
+ else if (longitudeReduced <= -180) {
283
+ longitudeReduced += 360;
284
+ }
285
+ const longitudeQuarters = longitudeReduced * ONE_NINETIETH_;
286
+ const longitudeQuadrant = Math.round(longitudeQuarters);
287
+ const longitudeSine0 = Math.sin((longitudeReduced - 90 * longitudeQuadrant) * DEG_TO_RAD);
288
+ const longitudeCosine0 = Math.sqrt(1 - longitudeSine0 * longitudeSine0);
289
+ let latitudeReduced = latitude > -180 && latitude <= 180 ? latitude : latitude % 360;
290
+ if (latitudeReduced > 180) {
291
+ latitudeReduced -= 360;
292
+ }
293
+ else if (latitudeReduced <= -180) {
294
+ latitudeReduced += 360;
295
+ }
296
+ const latitudeQuarters = latitudeReduced * ONE_NINETIETH_;
297
+ const latitudeQuadrant = Math.round(latitudeQuarters);
298
+ const latitudeSine0 = Math.sin((latitudeReduced - 90 * latitudeQuadrant) * DEG_TO_RAD);
299
+ const latitudeCosine0 = Math.sqrt(1 - latitudeSine0 * latitudeSine0);
300
+ // The quadrant's swap and signs as factors 0, 1 and ±1 (exact products), not
301
+ // branches: random quadrants would mispredict them.
302
+ const longitudeSwap = longitudeQuadrant & 1;
303
+ const latitudeSwap = latitudeQuadrant & 1;
304
+ const sinLongitude = (1 - (longitudeQuadrant & 2)) *
305
+ (longitudeSine0 * (1 - longitudeSwap) + longitudeCosine0 * longitudeSwap);
306
+ const cosLongitude = (1 - ((longitudeQuadrant + 1) & 2)) *
307
+ (longitudeCosine0 * (1 - longitudeSwap) + longitudeSine0 * longitudeSwap);
308
+ const sinLatitude = (1 - (latitudeQuadrant & 2)) *
309
+ (latitudeSine0 * (1 - latitudeSwap) + latitudeCosine0 * latitudeSwap);
310
+ const cosLatitude = (1 - ((latitudeQuadrant + 1) & 2)) *
311
+ (latitudeCosine0 * (1 - latitudeSwap) + latitudeSine0 * latitudeSwap);
312
+ const polarRatio = 1 - ellipsoid.flattening;
313
+ const polarRatioSquared = polarRatio * polarRatio;
314
+ const primeVertical = ellipsoid.semiMajorAxisM /
315
+ Math.sqrt(cosLatitude * cosLatitude +
316
+ polarRatioSquared * (sinLatitude * sinLatitude));
317
+ const radial = (primeVertical + height) * cosLatitude;
318
+ // `+ 0` turns the −0 of a zero cosine into +0.
319
+ out[base] = radial * cosLongitude + 0;
320
+ out[base + 1] = radial * sinLongitude + 0;
321
+ out[base + 2] = (primeVertical * polarRatioSquared + height) * sinLatitude;
322
+ }
323
+ /**
324
+ * Writes the geodetic position of the Earth-centred point `point`, metres, on
325
+ * `ellipsoid` into `out`: longitude in `(−180, 180]`, latitude in `[−90, 90]`,
326
+ * and the height along the ellipsoid normal.
327
+ *
328
+ * Vermeille's closed form (J. Geodesy 76 (2002) 451–454, which solves a quartic
329
+ * for the latitude without iteration) gives the latitude, to 1e−13°. The height
330
+ * is the offset of the point from its foot on the ellipsoid along the normal,
331
+ * which is stationary in the latitude, evaluated in double-double arithmetic
332
+ * (`_ecef-height.ts`): the rounding of 6 400 km terms, 1 to 3 nm in plain
333
+ * doubles, costs nothing. Against 80-digit references of the exact point, for
334
+ * heights from −6 000 km to 10 000 km: see the README. The centre of the Earth
335
+ * has no geodetic position, and a component that is not finite gives `NaN` in
336
+ * all three. Valid for coordinates within `[1e−150, 1e150]`: the squares stay
337
+ * finite, and far from the Earth the quartic, which depends only on `p/e⁴` and
338
+ * `q/e⁴`, is scaled by a power of two so its cubes do not overflow. Allocates
339
+ * nothing, whatever the engine inlines: no double crosses a call. O(1).
340
+ */
341
+ export function geodeticFromEcef(out, point, ellipsoid) {
342
+ const x = point[0];
343
+ const y = point[1];
344
+ const z = point[2];
345
+ const equatorialSquared = x * x + y * y;
346
+ if (!(Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(z)) ||
347
+ !(equatorialSquared + z * z > 0)) {
348
+ // Not finite, or the centre of the Earth, which has no geodetic position.
349
+ out[0] = Number.NaN;
350
+ out[1] = Number.NaN;
351
+ out[2] = Number.NaN;
352
+ return out;
353
+ }
354
+ // Every input is read before a register is written, and the results before
355
+ // `out` is: a getter on the ellipsoid or a setter on `out` may run another
356
+ // conversion, which shares the registers.
357
+ const semiMajorAxis = ellipsoid.semiMajorAxisM;
358
+ const flattening = ellipsoid.flattening;
359
+ let eccentricitySquared = ellipsoid.eccentricitySquared;
360
+ const polarRatio = 1 - flattening;
361
+ const equatorial = Math.sqrt(equatorialSquared);
362
+ let p = equatorialSquared / (semiMajorAxis * semiMajorAxis);
363
+ let q = ((polarRatio * polarRatio) / (semiMajorAxis * semiMajorAxis)) * z * z;
364
+ // The solution depends only on p/e⁴ and q/e⁴: far from the Earth, scale p,
365
+ // q and e⁴ by a power of two (exact), so that p·q and r³ do not overflow.
366
+ if (p + q > LARGE_QUARTIC_) {
367
+ const halfExponent = Math.ceil(Math.log2(p + q) / 2);
368
+ const scale = 2 ** -halfExponent;
369
+ p *= scale * scale;
370
+ q *= scale * scale;
371
+ eccentricitySquared *= scale;
372
+ }
373
+ const eccentricityFourth = eccentricitySquared * eccentricitySquared;
374
+ const r = (p + q - eccentricityFourth) / 6;
375
+ const s = (eccentricityFourth * p * q) / (4 * r * r * r);
376
+ const t = Math.cbrt(1 + s + Math.sqrt(s * (2 + s)));
377
+ const u = r * (1 + t + 1 / t);
378
+ const v = Math.sqrt(u * u + eccentricityFourth * q);
379
+ const w = (eccentricitySquared * (u + v - q)) / (2 * v);
380
+ const k = Math.sqrt(u + v + w * w) - w;
381
+ const d = (k * equatorial) / (k + eccentricitySquared);
382
+ const rho = Math.sqrt(d * d + z * z);
383
+ // Through `angleRegisters_`, as the height goes through its registers: a
384
+ // double crossing a call the engine does not inline is boxed.
385
+ angleRegisters_[0] = z;
386
+ angleRegisters_[1] = d + rho;
387
+ atan2DegInPlace(angleRegisters_);
388
+ const latitude = 2 * angleRegisters_[0];
389
+ angleRegisters_[0] = y;
390
+ angleRegisters_[1] = x;
391
+ atan2DegInPlace(angleRegisters_);
392
+ const longitude = angleRegisters_[0];
393
+ angleRegisters_[0] = latitude;
394
+ sinCosDegInPlace(angleRegisters_);
395
+ heightRegisters_[HEIGHT_X_] = x;
396
+ heightRegisters_[HEIGHT_Y_] = y;
397
+ heightRegisters_[HEIGHT_Z_] = z;
398
+ heightRegisters_[HEIGHT_SINE_] = angleRegisters_[0];
399
+ heightRegisters_[HEIGHT_SEMI_MAJOR_AXIS_] = semiMajorAxis;
400
+ heightRegisters_[HEIGHT_FLATTENING_] = flattening;
401
+ heightAboveEllipsoid_();
402
+ const height = heightRegisters_[HEIGHT_RESULT_];
403
+ out[0] = longitude;
404
+ out[1] = latitude;
405
+ out[2] = height;
406
+ return out;
407
+ }
408
+ function assertBulk_(name, out, input) {
409
+ if (out.length !== input.length || input.length % 3 !== 0) {
410
+ throw new RangeError(`${name}: out and input must have the same length, a multiple of 3 (got ${out.length} and ${input.length}).`);
411
+ }
412
+ }
413
+ const geodeticScratch_ = geodeticCreate();
414
+ const pointScratch_ = vec3Create();
415
+ const angleRegisters_ = new Float64Array(2);
416
+ /**
417
+ * Above this `p + q` (a point farther than about `a·2¹⁵⁰`), Vermeille's quartic
418
+ * is scaled: its cube of `r` would overflow from about 1e102.
419
+ */
420
+ const LARGE_QUARTIC_ = 2 ** 300;
421
+ /**
422
+ * Writes the Earth-centred coordinates of every geodetic triple of `input`
423
+ * (`[longitudeDeg, latitudeDeg, heightM, …]`) into `out` (as
424
+ * {@link ecefFromGeodetic}), the count taken from the length. `out` may be
425
+ * `input` (in place). O(n).
426
+ *
427
+ * @throws {RangeError} Unless both have the same length, a multiple of 3.
428
+ */
429
+ export function ecefArrayFromGeodetic(out, input, ellipsoid) {
430
+ assertBulk_("ecefArrayFromGeodetic", out, input);
431
+ for (let base = 0; base < input.length; base += 3) {
432
+ ecefWrite_(out, input, base, ellipsoid);
433
+ }
434
+ return out;
435
+ }
436
+ /**
437
+ * Writes the geodetic triple of every Earth-centred point of `input` into `out`
438
+ * (as {@link geodeticFromEcef}), the count taken from the length. `out` may be
439
+ * `input` (in place). O(n).
440
+ *
441
+ * @throws {RangeError} Unless both have the same length, a multiple of 3.
442
+ */
443
+ export function geodeticArrayFromEcef(out, input, ellipsoid) {
444
+ assertBulk_("geodeticArrayFromEcef", out, input);
445
+ for (let base = 0; base < input.length; base += 3) {
446
+ pointScratch_[0] = input[base];
447
+ pointScratch_[1] = input[base + 1];
448
+ pointScratch_[2] = input[base + 2];
449
+ geodeticFromEcef(geodeticScratch_, pointScratch_, ellipsoid);
450
+ out[base] = geodeticScratch_[0];
451
+ out[base + 1] = geodeticScratch_[1];
452
+ out[base + 2] = geodeticScratch_[2];
453
+ }
454
+ return out;
455
+ }
456
+ //# sourceMappingURL=geodetic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geodetic.js","sourceRoot":"","sources":["../src/geodetic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EACN,eAAe,EACf,UAAU,EACV,gBAAgB,GAChB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACN,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,SAAS,EACT,SAAS,EACT,SAAS,EACT,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,mBAAmB,CAAC;AAwD3B;;;GAGG;AACH,MAAM,SAAS,GAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAErD;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC7B,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAc,CAAC;IAC1C,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACX,OAAO,GAAG,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACzB,YAAoB,EACpB,WAAmB,EACnB,OAAe;IAEf,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAc,CAAC;IAC1C,GAAG,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC;IACtB,GAAG,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC;IACrB,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IACjB,OAA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AuB,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACjD,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,KAAK,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC;QACnD,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAE,CAAC;QAChC,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,CAAE,CAAC;QACpC,aAAa,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC,CAAE,CAAC;QACpC,gBAAgB,CAAC,gBAAgB,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;QAC7D,GAAG,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QAChC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACpC,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./ellipsoid.js";
2
+ export * from "./geodesic.js";
3
+ export * from "./geodetic.js";
4
+ export * from "./local-frame.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./ellipsoid.js";
2
+ export * from "./geodesic.js";
3
+ export * from "./geodetic.js";
4
+ export * from "./local-frame.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type LocalAxes } from "@ac-kit/math-geometry";
2
+ import { type Affine3 } from "@ac-kit/math-linear";
3
+ import type { Ellipsoid } from "./ellipsoid.js";
4
+ import { type ReadonlyGeodetic } from "./geodetic.js";
5
+ /**
6
+ * Writes into `out` the transform from Earth-centred metres to local metres at
7
+ * `origin`: `local = R·(ecef − ecef(origin))`, where `R` is
8
+ * `mat3x3FromLocalFrame` at the origin's longitude and geodetic latitude, so
9
+ * the up axis is the ellipsoid normal (not the direction to the Earth's
10
+ * centre). The origin maps to `0`. Apply it with `vec3TransformAffine3` or
11
+ * `vec3ArrayTransformAffine3`.
12
+ *
13
+ * Built once per origin (a frame is a builder: it throws).
14
+ *
15
+ * @param axes `"east-north-up"` or `"north-east-down"`.
16
+ * @throws {RangeError} For `axes` other than the two named.
17
+ */
18
+ export declare function affine3FromLocalFrame(out: Affine3, origin: ReadonlyGeodetic, ellipsoid: Ellipsoid, axes: LocalAxes): Affine3;
19
+ //# sourceMappingURL=local-frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-frame.d.ts","sourceRoot":"","sources":["../src/local-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,SAAS,EAGd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,KAAK,OAAO,EAIZ,MAAM,qBAAqB,CAAC;AAG7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAGN,KAAK,gBAAgB,EACrB,MAAM,eAAe,CAAC;AAQvB;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACpC,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,SAAS,GACb,OAAO,CA0CT"}
@@ -0,0 +1,66 @@
1
+ import { longitudeLatitudeCreate, mat3x3FromLocalFrame, } from "@ac-kit/math-geometry";
2
+ import { mat3x3Create, vec3Create, vec3TransformMat3x3, } from "@ac-kit/math-linear";
3
+ import { angleNormalizeDeg, DEG_TO_RAD } from "@ac-kit/math-scalar";
4
+ import { ecefFromGeodetic, geodeticCreate, } from "./geodetic.js";
5
+ const rotationScratch_ = mat3x3Create();
6
+ const anglesScratch_ = longitudeLatitudeCreate();
7
+ const originGeodeticScratch_ = geodeticCreate();
8
+ const originScratch_ = vec3Create();
9
+ const translationScratch_ = vec3Create();
10
+ /**
11
+ * Writes into `out` the transform from Earth-centred metres to local metres at
12
+ * `origin`: `local = R·(ecef − ecef(origin))`, where `R` is
13
+ * `mat3x3FromLocalFrame` at the origin's longitude and geodetic latitude, so
14
+ * the up axis is the ellipsoid normal (not the direction to the Earth's
15
+ * centre). The origin maps to `0`. Apply it with `vec3TransformAffine3` or
16
+ * `vec3ArrayTransformAffine3`.
17
+ *
18
+ * Built once per origin (a frame is a builder: it throws).
19
+ *
20
+ * @param axes `"east-north-up"` or `"north-east-down"`.
21
+ * @throws {RangeError} For `axes` other than the two named.
22
+ */
23
+ export function affine3FromLocalFrame(out, origin, ellipsoid, axes) {
24
+ // Every input is read, and every result computed into the scratch, before
25
+ // `out` is written; the results are read into locals before the first
26
+ // write: a getter on `origin` or `ellipsoid`, or a setter on `out`, may run
27
+ // another frame or conversion, which shares the scratch.
28
+ const longitude = origin[0];
29
+ const latitude = origin[1];
30
+ const height = origin[2];
31
+ originGeodeticScratch_[0] = longitude;
32
+ originGeodeticScratch_[1] = latitude;
33
+ originGeodeticScratch_[2] = height;
34
+ ecefFromGeodetic(originScratch_, originGeodeticScratch_, ellipsoid);
35
+ // Reduced in degrees first: a huge longitude loses its turns in radians.
36
+ anglesScratch_[0] = angleNormalizeDeg(longitude) * DEG_TO_RAD;
37
+ anglesScratch_[1] = angleNormalizeDeg(latitude) * DEG_TO_RAD;
38
+ mat3x3FromLocalFrame(rotationScratch_, anglesScratch_, axes);
39
+ vec3TransformMat3x3(translationScratch_, originScratch_, rotationScratch_);
40
+ const m0 = rotationScratch_[0];
41
+ const m1 = rotationScratch_[1];
42
+ const m2 = rotationScratch_[2];
43
+ const m3 = rotationScratch_[3];
44
+ const m4 = rotationScratch_[4];
45
+ const m5 = rotationScratch_[5];
46
+ const m6 = rotationScratch_[6];
47
+ const m7 = rotationScratch_[7];
48
+ const m8 = rotationScratch_[8];
49
+ const tx = -translationScratch_[0];
50
+ const ty = -translationScratch_[1];
51
+ const tz = -translationScratch_[2];
52
+ out[0] = m0;
53
+ out[1] = m1;
54
+ out[2] = m2;
55
+ out[3] = m3;
56
+ out[4] = m4;
57
+ out[5] = m5;
58
+ out[6] = m6;
59
+ out[7] = m7;
60
+ out[8] = m8;
61
+ out[9] = tx;
62
+ out[10] = ty;
63
+ out[11] = tz;
64
+ return out;
65
+ }
66
+ //# sourceMappingURL=local-frame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-frame.js","sourceRoot":"","sources":["../src/local-frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,uBAAuB,EACvB,oBAAoB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAEN,YAAY,EACZ,UAAU,EACV,mBAAmB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGpE,OAAO,EACN,gBAAgB,EAChB,cAAc,GAEd,MAAM,eAAe,CAAC;AAEvB,MAAM,gBAAgB,GAAG,YAAY,EAAE,CAAC;AACxC,MAAM,cAAc,GAAG,uBAAuB,EAAE,CAAC;AACjD,MAAM,sBAAsB,GAAG,cAAc,EAAE,CAAC;AAChD,MAAM,cAAc,GAAG,UAAU,EAAE,CAAC;AACpC,MAAM,mBAAmB,GAAG,UAAU,EAAE,CAAC;AAEzC;;;;;;;;;;;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