@wemap/geo 14.6.0-beta.2 → 14.6.0-beta.4
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.
- package/LICENSE +23 -0
- package/dist/index.js +275 -607
- package/dist/src/coordinates/Coordinates.d.ts +1 -1
- package/dist/src/coordinates/Coordinates.d.ts.map +1 -1
- package/dist/src/coordinates/GeoRef.d.ts +1 -1
- package/dist/src/coordinates/GeoRef.d.ts.map +1 -1
- package/dist/src/coordinates/Level.d.ts +5 -0
- package/dist/src/coordinates/Level.d.ts.map +1 -1
- package/dist/src/rotations/Attitude.d.ts +1 -1
- package/dist/src/rotations/Attitude.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/vitest.config.d.ts.map +1 -1
- package/package.json +22 -3
package/dist/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { Quaternion, Rotations, Vector3, deg2rad, positiveMod, rad2deg, wrap } from "@wemap/maths";
|
|
1
2
|
import booleanPointInPolygon from "@turf/boolean-point-in-polygon";
|
|
2
|
-
var __defProp
|
|
3
|
-
let
|
|
4
|
-
for (var
|
|
5
|
-
get: e[
|
|
3
|
+
var __defProp = Object.defineProperty, __export = (e) => {
|
|
4
|
+
let y = {};
|
|
5
|
+
for (var b in e) __defProp(y, b, {
|
|
6
|
+
get: e[b],
|
|
6
7
|
enumerable: !0
|
|
7
8
|
});
|
|
8
|
-
return
|
|
9
|
+
return y;
|
|
9
10
|
}, Constants_exports = /* @__PURE__ */ __export({
|
|
10
11
|
CIRCUMFERENCE: () => CIRCUMFERENCE,
|
|
11
12
|
EARTH_GRAVITY: () => EARTH_GRAVITY,
|
|
@@ -22,428 +23,95 @@ var __defProp$1 = Object.defineProperty, __export = (e) => {
|
|
|
22
23
|
R_MINOR_4: () => R_MINOR_4
|
|
23
24
|
});
|
|
24
25
|
const R_MAJOR = 6378137, R_MINOR = 6356752.3142, EARTH_GRAVITY = 9.80665, EPS_DEG_MM = 1e-8, EPS_MM = .001, ELLIPSOID_FLATNESS = (R_MAJOR - R_MINOR) / R_MAJOR, ECCENTRICITY = Math.sqrt(ELLIPSOID_FLATNESS * (2 - ELLIPSOID_FLATNESS)), ECCENTRICITY_2 = ECCENTRICITY * ECCENTRICITY, R_MAJOR_2 = R_MAJOR * R_MAJOR, R_MAJOR_4 = R_MAJOR_2 * R_MAJOR_2, R_MINOR_2 = R_MINOR * R_MINOR, R_MINOR_4 = R_MINOR_2 * R_MINOR_2, CIRCUMFERENCE = R_MAJOR * 2 * Math.PI;
|
|
25
|
-
var
|
|
26
|
-
enumerable: !0,
|
|
27
|
-
configurable: !0,
|
|
28
|
-
writable: !0,
|
|
29
|
-
value: T
|
|
30
|
-
}) : e[w] = T, __publicField = (e, w, T) => (__defNormalProp(e, typeof w == "symbol" ? w : w + "", T), T), Vector = class {
|
|
31
|
-
static concat(e, w) {
|
|
32
|
-
return e.concat(w);
|
|
33
|
-
}
|
|
34
|
-
}, Vector3 = class e extends Vector {
|
|
35
|
-
static norm(e) {
|
|
36
|
-
return Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2]);
|
|
37
|
-
}
|
|
38
|
-
static normalize(e) {
|
|
39
|
-
let w = this.norm(e), T = [
|
|
40
|
-
,
|
|
41
|
-
,
|
|
42
|
-
,
|
|
43
|
-
];
|
|
44
|
-
for (let E = 0; E < 3; E++) T[E] = e[E] / w;
|
|
45
|
-
return T;
|
|
46
|
-
}
|
|
47
|
-
static sum(e, w) {
|
|
48
|
-
return [
|
|
49
|
-
e[0] + w[0],
|
|
50
|
-
e[1] + w[1],
|
|
51
|
-
e[2] + w[2]
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
static subtract(e, w) {
|
|
55
|
-
return [
|
|
56
|
-
e[0] - w[0],
|
|
57
|
-
e[1] - w[1],
|
|
58
|
-
e[2] - w[2]
|
|
59
|
-
];
|
|
60
|
-
}
|
|
61
|
-
static distance(w, T) {
|
|
62
|
-
return e.norm(e.subtract(w, T));
|
|
63
|
-
}
|
|
64
|
-
static cross(e, w) {
|
|
65
|
-
return [
|
|
66
|
-
e[1] * w[2] - e[2] * w[1],
|
|
67
|
-
e[2] * w[0] - e[0] * w[2],
|
|
68
|
-
e[0] * w[1] - e[1] * w[0]
|
|
69
|
-
];
|
|
70
|
-
}
|
|
71
|
-
static dot(e, w) {
|
|
72
|
-
return e[0] * w[0] + e[1] * w[1] + e[2] * w[2];
|
|
73
|
-
}
|
|
74
|
-
static multiplyScalar(e, w) {
|
|
75
|
-
let T = [
|
|
76
|
-
,
|
|
77
|
-
,
|
|
78
|
-
,
|
|
79
|
-
];
|
|
80
|
-
for (let E = 0; E < 3; E++) T[E] = e[E] * w;
|
|
81
|
-
return T;
|
|
82
|
-
}
|
|
83
|
-
}, _Quaternion = class e {
|
|
84
|
-
static get identity() {
|
|
85
|
-
return [
|
|
86
|
-
1,
|
|
87
|
-
0,
|
|
88
|
-
0,
|
|
89
|
-
0
|
|
90
|
-
];
|
|
91
|
-
}
|
|
92
|
-
static sum(e, w) {
|
|
93
|
-
return [
|
|
94
|
-
e[0] + w[0],
|
|
95
|
-
e[1] + w[1],
|
|
96
|
-
e[2] + w[2],
|
|
97
|
-
e[3] + w[3]
|
|
98
|
-
];
|
|
99
|
-
}
|
|
100
|
-
static rotateMatlab(e, w) {
|
|
101
|
-
let [T, E, D, O] = e, [k, A, j] = w;
|
|
102
|
-
return [
|
|
103
|
-
T * (T * k - D * j + O * A) - D * (T * j - E * A + D * k) + E * (E * k + D * A + O * j) + O * (T * A + E * j - O * k),
|
|
104
|
-
T * (T * A + E * j - O * k) + E * (T * j - E * A + D * k) + D * (E * k + D * A + O * j) - O * (T * k - D * j + O * A),
|
|
105
|
-
T * (T * j - E * A + D * k) - E * (T * A + E * j - O * k) + D * (T * k - D * j + O * A) + O * (E * k + D * A + O * j)
|
|
106
|
-
];
|
|
107
|
-
}
|
|
108
|
-
static rotate(e, w) {
|
|
109
|
-
let [T, E, D, O] = e, k = [
|
|
110
|
-
E,
|
|
111
|
-
D,
|
|
112
|
-
O
|
|
113
|
-
], A = Vector3.cross(k, w);
|
|
114
|
-
A = Vector3.sum(A, A);
|
|
115
|
-
let j = Vector3.sum(w, Vector3.multiplyScalar(A, T));
|
|
116
|
-
return Vector3.sum(j, Vector3.cross(k, A));
|
|
117
|
-
}
|
|
118
|
-
static inverse(e) {
|
|
119
|
-
return [
|
|
120
|
-
-e[0],
|
|
121
|
-
e[1],
|
|
122
|
-
e[2],
|
|
123
|
-
e[3]
|
|
124
|
-
];
|
|
125
|
-
}
|
|
126
|
-
static multiply(...w) {
|
|
127
|
-
if (w.length === 2) {
|
|
128
|
-
let [e, T, E, D] = w[0], [O, k, A, j] = w[1];
|
|
129
|
-
return [
|
|
130
|
-
e * O - T * k - E * A - D * j,
|
|
131
|
-
e * k + O * T + E * j - D * A,
|
|
132
|
-
e * A + O * E + D * k - T * j,
|
|
133
|
-
e * j + O * D + T * A - E * k
|
|
134
|
-
];
|
|
135
|
-
}
|
|
136
|
-
return w.reduce((e, w) => this.multiply(e, w), e.identity);
|
|
137
|
-
}
|
|
138
|
-
static fromAxisAngle(e, w) {
|
|
139
|
-
let T = Math.sin(w / 2);
|
|
140
|
-
return [
|
|
141
|
-
Math.cos(w / 2),
|
|
142
|
-
e[0] * T,
|
|
143
|
-
e[1] * T,
|
|
144
|
-
e[2] * T
|
|
145
|
-
];
|
|
146
|
-
}
|
|
147
|
-
static rotX(e) {
|
|
148
|
-
return this.fromAxisAngle([
|
|
149
|
-
1,
|
|
150
|
-
0,
|
|
151
|
-
0
|
|
152
|
-
], e);
|
|
153
|
-
}
|
|
154
|
-
static rotY(e) {
|
|
155
|
-
return this.fromAxisAngle([
|
|
156
|
-
0,
|
|
157
|
-
1,
|
|
158
|
-
0
|
|
159
|
-
], e);
|
|
160
|
-
}
|
|
161
|
-
static rotZ(e) {
|
|
162
|
-
return this.fromAxisAngle([
|
|
163
|
-
0,
|
|
164
|
-
0,
|
|
165
|
-
1
|
|
166
|
-
], e);
|
|
167
|
-
}
|
|
168
|
-
static fromMatrix3(e) {
|
|
169
|
-
let w = Math.sqrt(1 + e[0][0] + e[1][1] + e[2][2]) / 2;
|
|
170
|
-
return [
|
|
171
|
-
w,
|
|
172
|
-
(e[2][1] - e[1][2]) / (4 * w),
|
|
173
|
-
(e[0][2] - e[2][0]) / (4 * w),
|
|
174
|
-
(e[1][0] - e[0][1]) / (4 * w)
|
|
175
|
-
];
|
|
176
|
-
}
|
|
177
|
-
static fromMatrix3Matlab(e) {
|
|
178
|
-
let w = Math.sqrt(1 + e[0][0] + e[1][1] + e[2][2]) / 2;
|
|
179
|
-
return [
|
|
180
|
-
w,
|
|
181
|
-
(e[1][2] - e[2][1]) / (4 * w),
|
|
182
|
-
(e[2][0] - e[0][2]) / (4 * w),
|
|
183
|
-
(e[0][1] - e[1][0]) / (4 * w)
|
|
184
|
-
];
|
|
185
|
-
}
|
|
186
|
-
static toMatrix3(e) {
|
|
187
|
-
let [w, T, E, D] = e, O = w * T, k = w * E, A = w * D, j = T * T, M = T * E, N = T * D, P = E * E, F = E * D, I = D * D;
|
|
188
|
-
return [
|
|
189
|
-
[
|
|
190
|
-
1 - 2 * (P + I),
|
|
191
|
-
2 * (M - A),
|
|
192
|
-
2 * (N + k)
|
|
193
|
-
],
|
|
194
|
-
[
|
|
195
|
-
2 * (M + A),
|
|
196
|
-
1 - 2 * (j + I),
|
|
197
|
-
2 * (F - O)
|
|
198
|
-
],
|
|
199
|
-
[
|
|
200
|
-
2 * (N - k),
|
|
201
|
-
2 * (F + O),
|
|
202
|
-
1 - 2 * (j + P)
|
|
203
|
-
]
|
|
204
|
-
];
|
|
205
|
-
}
|
|
206
|
-
static wxyz2xyzw(e) {
|
|
207
|
-
return [
|
|
208
|
-
e[1],
|
|
209
|
-
e[2],
|
|
210
|
-
e[3],
|
|
211
|
-
e[0]
|
|
212
|
-
];
|
|
213
|
-
}
|
|
214
|
-
static xyzw2wxyz(e) {
|
|
215
|
-
return [
|
|
216
|
-
e[3],
|
|
217
|
-
e[0],
|
|
218
|
-
e[1],
|
|
219
|
-
e[2]
|
|
220
|
-
];
|
|
221
|
-
}
|
|
222
|
-
static distance(w, T) {
|
|
223
|
-
return Math.acos(Math.min(2 * e.dot(w, T) ** 2 - 1, 1));
|
|
224
|
-
}
|
|
225
|
-
static equals(w, T) {
|
|
226
|
-
return e.distance(w, T) < 1e-8;
|
|
227
|
-
}
|
|
228
|
-
static normalize(e) {
|
|
229
|
-
let w = this.norm(e), T = [
|
|
230
|
-
,
|
|
231
|
-
,
|
|
232
|
-
,
|
|
233
|
-
,
|
|
234
|
-
];
|
|
235
|
-
for (let E = 0; E < 4; E++) T[E] = e[E] / w;
|
|
236
|
-
return T;
|
|
237
|
-
}
|
|
238
|
-
static norm(e) {
|
|
239
|
-
return Math.sqrt(e[0] ** 2 + e[1] ** 2 + e[2] ** 2 + e[3] ** 2);
|
|
240
|
-
}
|
|
241
|
-
static dot(e, w) {
|
|
242
|
-
return e[0] * w[0] + e[1] * w[1] + e[2] * w[2] + e[3] * w[3];
|
|
243
|
-
}
|
|
244
|
-
static getRotationBetweenTwoVectors(w, T) {
|
|
245
|
-
let E = Vector3.normalize(w), D = Vector3.normalize(T), O = Vector3.dot(E, D), k;
|
|
246
|
-
if (O < -.999999) return k = Vector3.cross([
|
|
247
|
-
1,
|
|
248
|
-
0,
|
|
249
|
-
0
|
|
250
|
-
], E), Vector3.norm(k) < 1e-6 && (k = Vector3.cross([
|
|
251
|
-
0,
|
|
252
|
-
1,
|
|
253
|
-
0
|
|
254
|
-
], E)), k = Vector3.normalize(k), e.fromAxisAngle(k, Math.PI);
|
|
255
|
-
if (O > .999999) return e.identity;
|
|
256
|
-
k = Vector3.cross(E, D);
|
|
257
|
-
let A = [
|
|
258
|
-
1 + O,
|
|
259
|
-
k[0],
|
|
260
|
-
k[1],
|
|
261
|
-
k[2]
|
|
262
|
-
];
|
|
263
|
-
return e.normalize(A);
|
|
264
|
-
}
|
|
265
|
-
static slerp(w, T, E) {
|
|
266
|
-
let D = w[1], O = w[2], k = w[3], A = w[0], j = T[1], M = T[2], N = T[3], P = T[0], F, I, L;
|
|
267
|
-
F = D * j + O * M + k * N + A * P, F < 0 && (F = -F, P = -P, j = -j, M = -M, N = -N);
|
|
268
|
-
let R = 1 - F < 1e-6;
|
|
269
|
-
if (R) I = 1 - E, L = E;
|
|
270
|
-
else {
|
|
271
|
-
let e = Math.acos(F), w = Math.sin(e);
|
|
272
|
-
I = Math.sin((1 - E) * e) / w, L = Math.sin(E * e) / w;
|
|
273
|
-
}
|
|
274
|
-
let z = [
|
|
275
|
-
I * A + L * P,
|
|
276
|
-
I * D + L * j,
|
|
277
|
-
I * O + L * M,
|
|
278
|
-
I * k + L * N
|
|
279
|
-
];
|
|
280
|
-
return R && (z = e.normalize(z)), z;
|
|
281
|
-
}
|
|
282
|
-
static toString(e) {
|
|
283
|
-
return `[${e[0].toFixed(2)}, ${e[1].toFixed(2)}, ${e[2].toFixed(2)}, ${e[3].toFixed(2)}]`;
|
|
284
|
-
}
|
|
285
|
-
static fromUnitVectors(w, T) {
|
|
286
|
-
let E = Vector3.dot(w, T) + 1, D, O, k, A;
|
|
287
|
-
E < 2 ** -52 ? (E = 0, Math.abs(w[1]) > Math.abs(w[2]) ? (D = -w[1], O = w[0], k = 0, A = E) : (D = 0, O = -w[2], k = w[1], A = E)) : (D = w[1] * T[2] - w[2] * T[1], O = w[2] * T[0] - w[0] * T[2], k = w[0] * T[1] - w[1] * T[0], A = E);
|
|
288
|
-
let j = [
|
|
289
|
-
A,
|
|
290
|
-
D,
|
|
291
|
-
O,
|
|
292
|
-
k
|
|
293
|
-
];
|
|
294
|
-
return e.normalize(j);
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
__publicField(_Quaternion, "ROTX_PI2", _Quaternion.rotX(Math.PI / 2)), __publicField(_Quaternion, "ROTX_PI", _Quaternion.rotX(Math.PI)), __publicField(_Quaternion, "ROTX_MPI2", _Quaternion.rotX(-Math.PI / 2)), __publicField(_Quaternion, "ROTY_PI2", _Quaternion.rotY(Math.PI / 2)), __publicField(_Quaternion, "ROTY_PI", _Quaternion.rotY(Math.PI)), __publicField(_Quaternion, "ROTY_MPI2", _Quaternion.rotY(-Math.PI / 2)), __publicField(_Quaternion, "ROTZ_PI2", _Quaternion.rotZ(Math.PI / 2)), __publicField(_Quaternion, "ROTZ_PI", _Quaternion.rotZ(Math.PI)), __publicField(_Quaternion, "ROTZ_MPI2", _Quaternion.rotZ(-Math.PI / 2));
|
|
298
|
-
var Quaternion = _Quaternion;
|
|
299
|
-
function deg2rad(e) {
|
|
300
|
-
return e * (Math.PI / 180);
|
|
301
|
-
}
|
|
302
|
-
function rad2deg(e) {
|
|
303
|
-
return e * 180 / Math.PI;
|
|
304
|
-
}
|
|
305
|
-
function positiveMod(e, w) {
|
|
306
|
-
return (e % w + w) % w;
|
|
307
|
-
}
|
|
308
|
-
function wrap(e, w, T) {
|
|
309
|
-
let E = T - w, D = ((e - w) % E + E) % E + w;
|
|
310
|
-
return D === w ? T : D;
|
|
311
|
-
}
|
|
312
|
-
var Rotations = class e {
|
|
313
|
-
static eulerToQuaternionZXYDegrees(w) {
|
|
314
|
-
let T = w.map((e) => deg2rad(e));
|
|
315
|
-
return e.eulerToQuaternionZXY(T);
|
|
316
|
-
}
|
|
317
|
-
static eulerToQuaternionZXY(e) {
|
|
318
|
-
let w = e[0], T = e[1], E = e[2], D = Math.cos(w / 2), O = Math.cos(T / 2), k = Math.cos(E / 2), A = Math.sin(w / 2), j = Math.sin(T / 2), M = Math.sin(E / 2), N = D * O * k - A * j * M, P = D * j * k - A * O * M, F = A * j * k + D * O * M, I = A * O * k + D * j * M;
|
|
319
|
-
return N < 0 && (N = -N, P = -P, F = -F, I = -I), [
|
|
320
|
-
N,
|
|
321
|
-
P,
|
|
322
|
-
F,
|
|
323
|
-
I
|
|
324
|
-
];
|
|
325
|
-
}
|
|
326
|
-
static quaternionToEulerZXYDegrees(w) {
|
|
327
|
-
return e.quaternionToEulerZXY(w).map((e) => rad2deg(e));
|
|
328
|
-
}
|
|
329
|
-
static quaternionToEulerZXY(e) {
|
|
330
|
-
let w = e[0], T = e[1], E = e[2], D = e[3], O, k, A, j = E * D + T * w;
|
|
331
|
-
return j > .499 ? (O = 2 * Math.atan2(E, w), k = Math.PI / 2, A = 0) : j < -.499 ? (O = -2 * Math.atan2(E, w), k = -Math.PI / 2, A = 0) : (O = Math.atan2(2 * D * w - 2 * E * T, 1 - 2 * D ** 2 - 2 * T ** 2), k = Math.asin(2 * j), A = Math.atan2(2 * E * w - 2 * D * T, 1 - 2 * E ** 2 - 2 * T ** 2)), O %= 2 * Math.PI, k %= Math.PI, A %= 2 * Math.PI, [
|
|
332
|
-
O,
|
|
333
|
-
k,
|
|
334
|
-
A
|
|
335
|
-
];
|
|
336
|
-
}
|
|
337
|
-
static quaternionToEulerDegrees(w, T) {
|
|
338
|
-
return e.quaternionToEuler(w, T).map((e) => rad2deg(e));
|
|
339
|
-
}
|
|
340
|
-
static quaternionToEuler(w, T) {
|
|
341
|
-
let E = w[0], D = w[1], O = w[2], k = w[3];
|
|
342
|
-
switch (T.toLowerCase()) {
|
|
343
|
-
case "zyx": return e._threeaxisrot(2 * (D * O + E * k), E ** 2 + D ** 2 - O ** 2 - k ** 2, -2 * (D * k - E * O), 2 * (O * k + E * D), E ** 2 - D ** 2 - O ** 2 + k ** 2);
|
|
344
|
-
case "zyz": return e._twoaxisrot(2 * (O * k - E * D), 2 * (D * k + E * O), E ** 2 - D ** 2 - O ** 2 + k ** 2, 2 * (O * k + E * D), -2 * (D * k - E * O));
|
|
345
|
-
case "zxy": return e._threeaxisrot(-2 * (D * O - E * k), E ** 2 - D ** 2 + O ** 2 - k ** 2, 2 * (O * k + E * D), -2 * (D * k - E * O), E ** 2 - D ** 2 - O ** 2 + k ** 2);
|
|
346
|
-
case "zxz": return e._twoaxisrot(2 * (D * k + E * O), -2 * (O * k - E * D), E ** 2 - D ** 2 - O ** 2 + k ** 2, 2 * (D * k - E * O), 2 * (O * k + E * D));
|
|
347
|
-
case "yxz": return e._threeaxisrot(2 * (D * k + E * O), E ** 2 - D ** 2 - O ** 2 + k ** 2, -2 * (O * k - E * D), 2 * (D * O + E * k), E ** 2 - D ** 2 + O ** 2 - k ** 2);
|
|
348
|
-
case "yxy": return e._twoaxisrot(2 * (D * O - E * k), 2 * (O * k + E * D), E ** 2 - D ** 2 + O ** 2 - k ** 2, 2 * (D * O + E * k), -2 * (O * k - E * D));
|
|
349
|
-
case "yzx": return e._threeaxisrot(-2 * (D * k - E * O), E ** 2 + D ** 2 - O ** 2 - k ** 2, 2 * (D * O + E * k), -2 * (O * k - E * D), E ** 2 - D ** 2 + O ** 2 - k ** 2);
|
|
350
|
-
case "yzy": return e._twoaxisrot(2 * (O * k + E * D), -2 * (D * O - E * k), E ** 2 - D ** 2 + O ** 2 - k ** 2, 2 * (O * k - E * D), 2 * (D * O + E * k));
|
|
351
|
-
case "xyz": return e._threeaxisrot(-2 * (O * k - E * D), E ** 2 - D ** 2 - O ** 2 + k ** 2, 2 * (D * k + E * O), -2 * (D * O - E * k), E ** 2 + D ** 2 - O ** 2 - k ** 2);
|
|
352
|
-
case "xyx": return e._twoaxisrot(2 * (D * O + E * k), -2 * (D * k - E * O), E ** 2 + D ** 2 - O ** 2 - k ** 2, 2 * (D * O - E * k), 2 * (D * k + E * O));
|
|
353
|
-
case "xzy": return e._threeaxisrot(2 * (O * k + E * D), E ** 2 - D ** 2 + O ** 2 - k ** 2, -2 * (D * O - E * k), 2 * (D * k + E * O), E ** 2 + D ** 2 - O ** 2 - k ** 2);
|
|
354
|
-
case "xzx": return e._twoaxisrot(2 * (D * k - E * O), 2 * (D * O + E * k), E ** 2 + D ** 2 - O ** 2 - k ** 2, 2 * (D * k + E * O), -2 * (D * O - E * k));
|
|
355
|
-
}
|
|
356
|
-
throw Error("unknown order");
|
|
357
|
-
}
|
|
358
|
-
static _threeaxisrot(e, w, T, E, D) {
|
|
359
|
-
return [
|
|
360
|
-
Math.atan2(e, w),
|
|
361
|
-
Math.asin(T),
|
|
362
|
-
Math.atan2(E, D)
|
|
363
|
-
];
|
|
364
|
-
}
|
|
365
|
-
static _twoaxisrot(e, w, T, E, D) {
|
|
366
|
-
return [
|
|
367
|
-
Math.atan2(e, w),
|
|
368
|
-
Math.acos(T),
|
|
369
|
-
Math.atan2(E, D)
|
|
370
|
-
];
|
|
371
|
-
}
|
|
372
|
-
static getHeadingFromQuaternion(e) {
|
|
373
|
-
let [w, T, E, D] = e, O = w * T, k = E * D, A = T ** 2;
|
|
374
|
-
return Math.asin(2 * (O + k)) < Math.PI / 4 && A + E ** 2 < .5 ? -Math.atan2(w * D - T * E, .5 - A - D ** 2) : -Math.atan2(T * D + w * E, O - k);
|
|
375
|
-
}
|
|
376
|
-
}, Level_default = class e {
|
|
26
|
+
var Level_default = class e {
|
|
377
27
|
static VERIFY_TYPING = !1;
|
|
378
28
|
static checkType(e) {
|
|
379
29
|
if (e !== null && !(typeof e == "number" && !isNaN(e))) {
|
|
380
30
|
if (Array.isArray(e) && e.length === 2) {
|
|
381
|
-
let [
|
|
382
|
-
if (typeof
|
|
383
|
-
if (
|
|
31
|
+
let [y, b] = e;
|
|
32
|
+
if (typeof y == "number" && !isNaN(y) && typeof b == "number" && !isNaN(b)) {
|
|
33
|
+
if (y > b || y === b) throw Error(`Invalid level range: [${y}, ${b}]`);
|
|
384
34
|
return;
|
|
385
35
|
}
|
|
386
36
|
}
|
|
387
37
|
throw Error(`Unknown level format: ${e}`);
|
|
388
38
|
}
|
|
389
39
|
}
|
|
390
|
-
static isRange(
|
|
391
|
-
return e.VERIFY_TYPING && e.checkType(
|
|
392
|
-
}
|
|
393
|
-
static clone(
|
|
394
|
-
return e.VERIFY_TYPING && e.checkType(
|
|
395
|
-
}
|
|
396
|
-
static fromString(
|
|
397
|
-
if (
|
|
398
|
-
if (typeof
|
|
399
|
-
if (!isNaN(Number(
|
|
400
|
-
let
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
return
|
|
40
|
+
static isRange(y) {
|
|
41
|
+
return e.VERIFY_TYPING && e.checkType(y), Array.isArray(y);
|
|
42
|
+
}
|
|
43
|
+
static clone(y) {
|
|
44
|
+
return e.VERIFY_TYPING && e.checkType(y), y === null ? null : typeof y == "number" ? y : [y[0], y[1]];
|
|
45
|
+
}
|
|
46
|
+
static fromString(y) {
|
|
47
|
+
if (y === null) return null;
|
|
48
|
+
if (typeof y != "string" || !y.length) throw Error(`argument must be a non empty string, got ${typeof y}`);
|
|
49
|
+
if (!isNaN(Number(y))) return parseFloat(y);
|
|
50
|
+
let b = (e) => {
|
|
51
|
+
let b = e.map((e) => Number(e));
|
|
52
|
+
if (b.some((e) => Number.isNaN(e)) || e.some((e) => !e.length)) throw Error(`Cannot parse following level: ${y}`);
|
|
53
|
+
return b;
|
|
54
|
+
}, x = y.split(";");
|
|
55
|
+
if (x.length > 1) {
|
|
56
|
+
let y = b(x), S = Math.min(...y), C = Math.max(...y);
|
|
57
|
+
return e.checkType([S, C]), [S, C];
|
|
404
58
|
} else {
|
|
405
|
-
let
|
|
406
|
-
if (
|
|
407
|
-
let
|
|
408
|
-
return e.checkType([
|
|
59
|
+
let x = y.substring(1).indexOf("-") + 1;
|
|
60
|
+
if (x > 0) {
|
|
61
|
+
let [S, C] = b([y.substring(0, x), y.substring(x + 1)]);
|
|
62
|
+
return e.checkType([S, C]), [S, C];
|
|
409
63
|
}
|
|
410
64
|
}
|
|
411
|
-
throw Error(`Cannot parse following level: ${
|
|
65
|
+
throw Error(`Cannot parse following level: ${y}`);
|
|
412
66
|
}
|
|
413
|
-
static
|
|
414
|
-
|
|
67
|
+
static parse(y) {
|
|
68
|
+
if (y == null) return null;
|
|
69
|
+
if (typeof y == "number") {
|
|
70
|
+
if (Number.isNaN(y)) throw Error("level number must not be NaN");
|
|
71
|
+
return y;
|
|
72
|
+
}
|
|
73
|
+
if (Array.isArray(y)) {
|
|
74
|
+
if (y.length !== 2) throw Error(`level range must have exactly 2 elements, got ${y.length}`);
|
|
75
|
+
let b = [y[0], y[1]];
|
|
76
|
+
return e.checkType(b), e.clone(b);
|
|
77
|
+
}
|
|
78
|
+
if (typeof y == "string") return e.fromString(y);
|
|
79
|
+
throw Error(`Cannot parse level from ${typeof y}`);
|
|
80
|
+
}
|
|
81
|
+
static contains(y, b) {
|
|
82
|
+
return e.VERIFY_TYPING && (e.checkType(y), e.checkType(b)), y === b ? !0 : Array.isArray(y) ? Array.isArray(b) ? y[0] <= b[0] && y[1] >= b[1] : b === null ? !1 : y[0] <= b && y[1] >= b : y === null || b === null ? !1 : y <= b[0] && y >= b[1];
|
|
415
83
|
}
|
|
416
|
-
static intersection(
|
|
417
|
-
if (e.VERIFY_TYPING && (e.checkType(
|
|
418
|
-
if (e.equals(
|
|
419
|
-
if (typeof
|
|
420
|
-
if (Array.isArray(
|
|
421
|
-
if (!Array.isArray(
|
|
422
|
-
let
|
|
423
|
-
return
|
|
84
|
+
static intersection(y, b) {
|
|
85
|
+
if (e.VERIFY_TYPING && (e.checkType(y), e.checkType(b)), y === null || b === null) return null;
|
|
86
|
+
if (e.equals(y, b)) return e.clone(y);
|
|
87
|
+
if (typeof y == "number" && typeof b == "number") return y === b ? y : null;
|
|
88
|
+
if (Array.isArray(y) && !Array.isArray(b)) return e.contains(y, b) ? b : null;
|
|
89
|
+
if (!Array.isArray(y) && Array.isArray(b)) return e.contains(b, y) ? y : null;
|
|
90
|
+
let x = Math.max(y[0], b[0]), S = Math.min(y[1], b[1]);
|
|
91
|
+
return S === x ? S : S < x ? null : [x, S];
|
|
424
92
|
}
|
|
425
|
-
static intersect(
|
|
426
|
-
return e.VERIFY_TYPING && (e.checkType(
|
|
93
|
+
static intersect(y, b) {
|
|
94
|
+
return e.VERIFY_TYPING && (e.checkType(y), e.checkType(b)), y === null && b === null ? !0 : e.intersection(y, b) !== null;
|
|
427
95
|
}
|
|
428
|
-
static union(
|
|
429
|
-
if (e.VERIFY_TYPING && (e.checkType(
|
|
430
|
-
if (
|
|
431
|
-
let
|
|
432
|
-
return !Array.isArray(
|
|
96
|
+
static union(y, b) {
|
|
97
|
+
if (e.VERIFY_TYPING && (e.checkType(y), e.checkType(b)), y === b) return e.clone(y);
|
|
98
|
+
if (b === null || y === null) return null;
|
|
99
|
+
let x, S;
|
|
100
|
+
return !Array.isArray(y) && !Array.isArray(b) ? (x = Math.min(y, b), S = Math.max(y, b)) : Array.isArray(y) && !Array.isArray(b) ? (x = Math.min(y[0], b), S = Math.max(y[1], b)) : !Array.isArray(y) && Array.isArray(b) ? (x = Math.min(b[0], y), S = Math.max(b[1], y)) : (x = Math.min(y[0], b[0]), S = Math.max(y[1], b[1])), x === S ? x : [x, S];
|
|
433
101
|
}
|
|
434
|
-
static multiplyBy(
|
|
435
|
-
return e.VERIFY_TYPING && e.checkType(
|
|
102
|
+
static multiplyBy(y, b) {
|
|
103
|
+
return e.VERIFY_TYPING && e.checkType(y), y === null ? null : Array.isArray(y) ? [y[0] * b, y[1] * b] : y * b;
|
|
436
104
|
}
|
|
437
|
-
static toString(
|
|
438
|
-
return e.VERIFY_TYPING && e.checkType(
|
|
105
|
+
static toString(y) {
|
|
106
|
+
return e.VERIFY_TYPING && e.checkType(y), y === null ? null : Array.isArray(y) ? y[0] + ";" + y[1] : String(y);
|
|
439
107
|
}
|
|
440
|
-
static equals(
|
|
441
|
-
return e.VERIFY_TYPING && (e.checkType(
|
|
108
|
+
static equals(y, b) {
|
|
109
|
+
return e.VERIFY_TYPING && (e.checkType(y), e.checkType(b)), y === b ? !0 : Array.isArray(y) && Array.isArray(b) ? y[0] === b[0] && y[1] === b[1] : !1;
|
|
442
110
|
}
|
|
443
|
-
static diff(
|
|
444
|
-
return e.VERIFY_TYPING && (e.checkType(
|
|
111
|
+
static diff(y, b) {
|
|
112
|
+
return e.VERIFY_TYPING && (e.checkType(y), e.checkType(b)), y === null || b === null ? null : !Array.isArray(y) && !Array.isArray(b) ? b - y : Array.isArray(y) && !Array.isArray(b) ? y[0] === b ? b - y[1] : y[1] === b ? b - y[0] : null : Array.isArray(b) && !Array.isArray(y) ? y === b[0] ? b[1] - y : y === b[1] ? b[0] - y : null : e.equals(y, b) ? 0 : null;
|
|
445
113
|
}
|
|
446
|
-
}, Coordinates_default = class
|
|
114
|
+
}, Coordinates_default = class y {
|
|
447
115
|
_lat;
|
|
448
116
|
_lng;
|
|
449
117
|
_alt = null;
|
|
@@ -452,8 +120,8 @@ var Rotations = class e {
|
|
|
452
120
|
_heightFromGround = null;
|
|
453
121
|
_ecef;
|
|
454
122
|
autoWrap = !0;
|
|
455
|
-
constructor(e,
|
|
456
|
-
this.lat = e, this.lng =
|
|
123
|
+
constructor(e, y, b = null, x = null) {
|
|
124
|
+
this.lat = e, this.lng = y, this.alt = b, this.level = x, this._ecef = null;
|
|
457
125
|
}
|
|
458
126
|
get lat() {
|
|
459
127
|
return this._lat;
|
|
@@ -506,98 +174,98 @@ var Rotations = class e {
|
|
|
506
174
|
this._heightFromGround = e;
|
|
507
175
|
}
|
|
508
176
|
clone() {
|
|
509
|
-
let
|
|
510
|
-
return this.level !== null && (
|
|
177
|
+
let e = new y(this.lat, this.lng, this.alt);
|
|
178
|
+
return this.level !== null && (e.level = Level_default.clone(this.level)), e;
|
|
511
179
|
}
|
|
512
180
|
wrap() {
|
|
513
181
|
(this._lng <= -180 || this._lng > 180) && (this._lng = wrap(this._lng, -180, 180));
|
|
514
182
|
}
|
|
515
|
-
static equals(e,
|
|
516
|
-
return this.equalsWithoutLevel(e,
|
|
183
|
+
static equals(e, y, b = EPS_DEG_MM, x = EPS_MM) {
|
|
184
|
+
return this.equalsWithoutLevel(e, y, b, x) ? e === null || y === null ? !0 : Level_default.equals(e.level, y.level) : !1;
|
|
517
185
|
}
|
|
518
|
-
equals(
|
|
519
|
-
return
|
|
186
|
+
equals(e) {
|
|
187
|
+
return y.equals(this, e);
|
|
520
188
|
}
|
|
521
|
-
static equalsWithoutLevel(
|
|
522
|
-
return
|
|
189
|
+
static equalsWithoutLevel(e, b, x = EPS_DEG_MM, S = EPS_MM) {
|
|
190
|
+
return e === null && e === b ? !0 : !(e instanceof y) || !(b instanceof y) ? !1 : Math.abs(b.lat - e.lat) < x && Math.abs(b.lng - e.lng) < x && (e.alt === b.alt || e.alt !== null && b.alt !== null && Math.abs(b.alt - e.alt) < S);
|
|
523
191
|
}
|
|
524
|
-
equalsWithoutLevel(
|
|
525
|
-
return
|
|
192
|
+
equalsWithoutLevel(e, b = EPS_DEG_MM, x = EPS_MM) {
|
|
193
|
+
return y.equalsWithoutLevel(this, e, b, x);
|
|
526
194
|
}
|
|
527
|
-
destinationPoint(e,
|
|
528
|
-
let
|
|
529
|
-
return
|
|
195
|
+
destinationPoint(e, y, b = null) {
|
|
196
|
+
let x = this.clone();
|
|
197
|
+
return x.move(e, y, b), x;
|
|
530
198
|
}
|
|
531
|
-
move(e,
|
|
532
|
-
let
|
|
533
|
-
if (this.lat = rad2deg(
|
|
199
|
+
move(e, y, b = null) {
|
|
200
|
+
let S = e / R_MAJOR, w = Math.cos(S), T = Math.sin(S), E = deg2rad(this.lat), D = deg2rad(this.lng), O = Math.asin(Math.sin(E) * w + Math.cos(E) * T * Math.cos(y)), A = D + Math.atan2(Math.sin(y) * T * Math.cos(E), w - Math.sin(E) * Math.sin(O));
|
|
201
|
+
if (this.lat = rad2deg(O), this.lng = rad2deg(A), b !== null) {
|
|
534
202
|
if (this.alt === null) throw Error("Point altitude is not defined");
|
|
535
|
-
this.alt +=
|
|
203
|
+
this.alt += b;
|
|
536
204
|
}
|
|
537
205
|
return this;
|
|
538
206
|
}
|
|
539
207
|
distanceTo(e) {
|
|
540
|
-
let
|
|
541
|
-
return R_MAJOR * (2 * Math.atan2(
|
|
208
|
+
let y = this.lat, b = this.lng, S = e.lat, C = e.lng, w = deg2rad(S - y), T = deg2rad(C - b), E = Math.sin(T / 2), D = Math.sin(w / 2), O = deg2rad(y), A = Math.cos(O), j = deg2rad(S), M = Math.cos(j), N = D * D + A * M * E * E, P = Math.sqrt(N), F = Math.sqrt(1 - N);
|
|
209
|
+
return R_MAJOR * (2 * Math.atan2(P, F));
|
|
542
210
|
}
|
|
543
|
-
static distanceBetween(e,
|
|
544
|
-
return e.distanceTo(
|
|
211
|
+
static distanceBetween(e, y) {
|
|
212
|
+
return e.distanceTo(y);
|
|
545
213
|
}
|
|
546
214
|
bearingTo(e) {
|
|
547
|
-
let
|
|
548
|
-
return Math.atan2(Math.sin(
|
|
215
|
+
let y = deg2rad(this.lat), b = deg2rad(e.lat), S = deg2rad(e.lng - this.lng);
|
|
216
|
+
return Math.atan2(Math.sin(S) * Math.cos(b), Math.cos(y) * Math.sin(b) - Math.sin(y) * Math.cos(b) * Math.cos(S));
|
|
549
217
|
}
|
|
550
|
-
static bearingTo(e,
|
|
551
|
-
return e.bearingTo(
|
|
218
|
+
static bearingTo(e, y) {
|
|
219
|
+
return e.bearingTo(y);
|
|
552
220
|
}
|
|
553
221
|
get enuToEcefRotation() {
|
|
554
|
-
let
|
|
222
|
+
let y = Quaternion.fromAxisAngle([
|
|
555
223
|
0,
|
|
556
224
|
0,
|
|
557
225
|
1
|
|
558
|
-
], Math.PI / 2 + deg2rad(this.lng)),
|
|
226
|
+
], Math.PI / 2 + deg2rad(this.lng)), b = Quaternion.fromAxisAngle([
|
|
559
227
|
1,
|
|
560
228
|
0,
|
|
561
229
|
0
|
|
562
230
|
], Math.PI / 2 - deg2rad(this.lat));
|
|
563
|
-
return Quaternion.multiply(
|
|
231
|
+
return Quaternion.multiply(y, b);
|
|
564
232
|
}
|
|
565
233
|
get ecefToEnuRotation() {
|
|
566
|
-
let
|
|
234
|
+
let y = Quaternion.fromAxisAngle([
|
|
567
235
|
1,
|
|
568
236
|
0,
|
|
569
237
|
0
|
|
570
|
-
], deg2rad(this.lat) - Math.PI / 2),
|
|
238
|
+
], deg2rad(this.lat) - Math.PI / 2), b = Quaternion.fromAxisAngle([
|
|
571
239
|
0,
|
|
572
240
|
0,
|
|
573
241
|
1
|
|
574
242
|
], -deg2rad(this.lng) - Math.PI / 2);
|
|
575
|
-
return Quaternion.multiply(
|
|
243
|
+
return Quaternion.multiply(y, b);
|
|
576
244
|
}
|
|
577
245
|
get ecef() {
|
|
578
246
|
if (!this._ecef) {
|
|
579
|
-
let e = deg2rad(this.lat),
|
|
247
|
+
let e = deg2rad(this.lat), y = deg2rad(this.lng), b = this.alt || 0;
|
|
580
248
|
this._ecef = [
|
|
581
|
-
(R_MAJOR +
|
|
582
|
-
(R_MAJOR +
|
|
583
|
-
(R_MAJOR +
|
|
249
|
+
(R_MAJOR + b) * Math.cos(e) * Math.cos(y),
|
|
250
|
+
(R_MAJOR + b) * Math.cos(e) * Math.sin(y),
|
|
251
|
+
(R_MAJOR + b) * Math.sin(e)
|
|
584
252
|
];
|
|
585
253
|
}
|
|
586
254
|
return this._ecef;
|
|
587
255
|
}
|
|
588
|
-
static fromECEF(
|
|
589
|
-
let
|
|
590
|
-
|
|
591
|
-
let
|
|
592
|
-
return
|
|
256
|
+
static fromECEF(e) {
|
|
257
|
+
let b = e[0], x = e[1], S = e[2], w = Math.sqrt(b ** 2 + x ** 2), T = Math.atan2(x, b), E = Math.atan2(S, w), D = w / Math.cos(E) - R_MAJOR;
|
|
258
|
+
T %= 2 * Math.PI;
|
|
259
|
+
let O = new y(rad2deg(E), rad2deg(T), D);
|
|
260
|
+
return O._ecef = e, O;
|
|
593
261
|
}
|
|
594
|
-
getSegmentProjection(
|
|
595
|
-
let
|
|
596
|
-
if (Vector3.norm(
|
|
597
|
-
let
|
|
598
|
-
|
|
599
|
-
let
|
|
600
|
-
return Math.abs(
|
|
262
|
+
getSegmentProjection(e, x) {
|
|
263
|
+
let S = Vector3.normalize(e.ecef), C = Vector3.normalize(x.ecef), w = Vector3.normalize(this.ecef), T = Vector3.cross(S, C);
|
|
264
|
+
if (Vector3.norm(T) === 0) return null;
|
|
265
|
+
let E = Vector3.cross(w, T), D = Vector3.normalize(Vector3.cross(T, E)), O = Vector3.multiplyScalar(D, R_MAJOR), A = y.fromECEF(O), j;
|
|
266
|
+
e.alt !== null && x.alt !== null && (j = (e.alt + x.alt) / 2);
|
|
267
|
+
let M = new y(A.lat, A.lng, j, Level_default.union(e.level, x.level));
|
|
268
|
+
return Math.abs(e.distanceTo(x) - e.distanceTo(M) - x.distanceTo(M)) > .001 ? null : M;
|
|
601
269
|
}
|
|
602
270
|
toString() {
|
|
603
271
|
let e = "[" + this._lat.toFixed(7) + ", " + this._lng.toFixed(7);
|
|
@@ -611,8 +279,8 @@ var Rotations = class e {
|
|
|
611
279
|
...this.level !== null && { level: this.level }
|
|
612
280
|
};
|
|
613
281
|
}
|
|
614
|
-
static fromJson(
|
|
615
|
-
return new e
|
|
282
|
+
static fromJson(e) {
|
|
283
|
+
return new y(e.lat, e.lng, e.alt, e.level);
|
|
616
284
|
}
|
|
617
285
|
toCompressedJson() {
|
|
618
286
|
return this.level === null ? [Number(this.lat.toFixed(8)), Number(this.lng.toFixed(8))] : [
|
|
@@ -621,16 +289,16 @@ var Rotations = class e {
|
|
|
621
289
|
this.level
|
|
622
290
|
];
|
|
623
291
|
}
|
|
624
|
-
static fromCompressedJson(
|
|
625
|
-
let
|
|
626
|
-
return
|
|
292
|
+
static fromCompressedJson(e) {
|
|
293
|
+
let b = new y(e[0], e[1]);
|
|
294
|
+
return e.length > 2 && (b.level = e[2]), b;
|
|
627
295
|
}
|
|
628
296
|
}, UserPosition_default = class e extends Coordinates_default {
|
|
629
297
|
_time = null;
|
|
630
298
|
_accuracy = null;
|
|
631
299
|
_bearing = null;
|
|
632
|
-
constructor(e,
|
|
633
|
-
super(e,
|
|
300
|
+
constructor(e, y, b = null, x = null, S = null, C = null, w = null) {
|
|
301
|
+
super(e, y, b, x), this.time = S, this.accuracy = C, this.bearing = w;
|
|
634
302
|
}
|
|
635
303
|
get time() {
|
|
636
304
|
return this._time;
|
|
@@ -651,25 +319,25 @@ var Rotations = class e {
|
|
|
651
319
|
set bearing(e) {
|
|
652
320
|
this._bearing = e === null ? null : e % (2 * Math.PI);
|
|
653
321
|
}
|
|
654
|
-
move(e,
|
|
655
|
-
return super.move(e,
|
|
322
|
+
move(e, y, b = null) {
|
|
323
|
+
return super.move(e, y, b), this;
|
|
656
324
|
}
|
|
657
|
-
destinationPoint(e,
|
|
658
|
-
let
|
|
659
|
-
return
|
|
325
|
+
destinationPoint(e, y, b = null) {
|
|
326
|
+
let x = this.clone();
|
|
327
|
+
return x.move(e, y, b), x;
|
|
660
328
|
}
|
|
661
|
-
static fromCoordinates(
|
|
662
|
-
return new e(
|
|
329
|
+
static fromCoordinates(y) {
|
|
330
|
+
return new e(y.lat, y.lng, y.alt, y.level);
|
|
663
331
|
}
|
|
664
332
|
clone() {
|
|
665
|
-
let
|
|
666
|
-
return
|
|
333
|
+
let y = e.fromCoordinates(super.clone());
|
|
334
|
+
return y.time = this.time, y.accuracy = this.accuracy, y.bearing = this.bearing, y;
|
|
667
335
|
}
|
|
668
|
-
static equals(
|
|
669
|
-
return
|
|
336
|
+
static equals(y, b, x = EPS_DEG_MM, S = EPS_MM) {
|
|
337
|
+
return y === null && y === b ? !0 : !(y instanceof e) || !(b instanceof e) || !super.equals(y, b, x, S) ? !1 : y.time === b.time && y.accuracy === b.accuracy && y.bearing === b.bearing;
|
|
670
338
|
}
|
|
671
|
-
equals(
|
|
672
|
-
return e.equals(this,
|
|
339
|
+
equals(y, b = EPS_DEG_MM, x = EPS_MM) {
|
|
340
|
+
return e.equals(this, y, b, x);
|
|
673
341
|
}
|
|
674
342
|
toJson() {
|
|
675
343
|
return {
|
|
@@ -679,9 +347,9 @@ var Rotations = class e {
|
|
|
679
347
|
...this.bearing !== null && { bearing: this.bearing }
|
|
680
348
|
};
|
|
681
349
|
}
|
|
682
|
-
static fromJson(
|
|
683
|
-
let
|
|
684
|
-
return
|
|
350
|
+
static fromJson(y) {
|
|
351
|
+
let b = e.fromCoordinates(Coordinates_default.fromJson(y));
|
|
352
|
+
return y.time !== void 0 && (b.time = y.time), y.accuracy !== void 0 && (b.accuracy = y.accuracy), y.bearing !== void 0 && (b.bearing = y.bearing), b;
|
|
685
353
|
}
|
|
686
354
|
}, Utils_exports = /* @__PURE__ */ __export({
|
|
687
355
|
calcDistance: () => calcDistance,
|
|
@@ -692,90 +360,90 @@ var Rotations = class e {
|
|
|
692
360
|
simplifyRoute: () => simplifyRoute,
|
|
693
361
|
trimRoute: () => trimRoute
|
|
694
362
|
});
|
|
695
|
-
function sampleRoute(e,
|
|
696
|
-
let
|
|
697
|
-
for (let
|
|
698
|
-
let
|
|
699
|
-
if (!
|
|
363
|
+
function sampleRoute(e, y = .7, b = 0, x = Number.MAX_VALUE) {
|
|
364
|
+
let S = b + x, C = [], w, T = 0, E = 0, D = !1;
|
|
365
|
+
for (let x = 0; x < e.length - 1; x++) {
|
|
366
|
+
let O = e[x], k = e[x + 1], A = O.distanceTo(k), j = O.bearingTo(k), M = 0;
|
|
367
|
+
if (!D) if (b < T + A) D = !0, E = b - T;
|
|
700
368
|
else {
|
|
701
|
-
|
|
369
|
+
T += A;
|
|
702
370
|
continue;
|
|
703
371
|
}
|
|
704
|
-
for (
|
|
705
|
-
let e =
|
|
706
|
-
e.bearing =
|
|
372
|
+
for (w = Object.assign(O.clone(), { bearing: j }); M + E < A && T + E <= S;) {
|
|
373
|
+
let e = w.destinationPoint(E, j);
|
|
374
|
+
e.bearing = j, C.push(e), w = e, M += E, T += E, E = y;
|
|
707
375
|
}
|
|
708
|
-
if (
|
|
709
|
-
let
|
|
710
|
-
|
|
376
|
+
if (T + E > S) break;
|
|
377
|
+
let N = A - M;
|
|
378
|
+
T += N, E -= N;
|
|
711
379
|
}
|
|
712
|
-
return
|
|
380
|
+
return C;
|
|
713
381
|
}
|
|
714
|
-
function trimRoute(e,
|
|
715
|
-
let
|
|
382
|
+
function trimRoute(e, y = e[0], b = Number.MAX_VALUE) {
|
|
383
|
+
let x = [], S = null, C, w = 0;
|
|
716
384
|
if (e.length <= 1) throw Error("Route must have at least 2 points");
|
|
717
|
-
for (
|
|
718
|
-
let
|
|
719
|
-
if (Coordinates_default.equals(
|
|
720
|
-
|
|
385
|
+
for (C = 1; C < e.length; C++) {
|
|
386
|
+
let b = e[C - 1], w = e[C];
|
|
387
|
+
if (Coordinates_default.equals(y, b)) {
|
|
388
|
+
x.push(b), S = b;
|
|
721
389
|
break;
|
|
722
390
|
}
|
|
723
|
-
let
|
|
724
|
-
if (
|
|
725
|
-
|
|
391
|
+
let T = y.getSegmentProjection(b, w);
|
|
392
|
+
if (T && Coordinates_default.equals(y, T) && !T.equals(w)) {
|
|
393
|
+
x.push(T), S = T;
|
|
726
394
|
break;
|
|
727
395
|
}
|
|
728
396
|
}
|
|
729
|
-
if (!
|
|
730
|
-
for (;
|
|
731
|
-
let
|
|
732
|
-
if (
|
|
733
|
-
let e =
|
|
734
|
-
|
|
397
|
+
if (!x.length) throw Error("startPosition is not on the route");
|
|
398
|
+
for (; S && C < e.length;) {
|
|
399
|
+
let y = e[C], T = S.distanceTo(y);
|
|
400
|
+
if (w + T >= b || Math.abs(w + T - b) <= .001) {
|
|
401
|
+
let e = S.bearingTo(y), C = b - w, T = S.destinationPoint(C, e);
|
|
402
|
+
x.push(T);
|
|
735
403
|
break;
|
|
736
404
|
}
|
|
737
|
-
|
|
405
|
+
x.push(y), S = y, w += T, C++;
|
|
738
406
|
}
|
|
739
|
-
return
|
|
407
|
+
return x;
|
|
740
408
|
}
|
|
741
|
-
function simplifyRoute(e,
|
|
742
|
-
let
|
|
743
|
-
for (let
|
|
744
|
-
let
|
|
745
|
-
Math.abs(
|
|
409
|
+
function simplifyRoute(e, y = deg2rad(5)) {
|
|
410
|
+
let b = e[0].equals(e[e.length - 1]), C = e.slice(0, e.length - (b ? 1 : 0)), w = C.length;
|
|
411
|
+
for (let x = b ? 0 : 1; x < w; x++) {
|
|
412
|
+
let b = e[positiveMod(x - 1, w)], T = e[x], E = e[positiveMod(x + 1, w)], D = b.bearingTo(T), O = T.bearingTo(E);
|
|
413
|
+
Math.abs(O - D) < y && (C = C.filter((e) => e !== T));
|
|
746
414
|
}
|
|
747
|
-
return
|
|
415
|
+
return b && C.push(C[0]), C;
|
|
748
416
|
}
|
|
749
417
|
function geolocationPositionToUserPosition(e) {
|
|
750
418
|
if (e === null) return null;
|
|
751
|
-
let { latitude:
|
|
752
|
-
return
|
|
419
|
+
let { latitude: y, longitude: b, accuracy: S, heading: C } = e.coords, w = new UserPosition_default(y, b);
|
|
420
|
+
return w.time = e.timestamp, w.accuracy = S, w.bearing = C ? deg2rad(C) : null, w;
|
|
753
421
|
}
|
|
754
422
|
function calcDistance(e) {
|
|
755
|
-
return e.reduce((e,
|
|
423
|
+
return e.reduce((e, y, b, x) => e + (b ? x[b - 1].distanceTo(y) : 0), 0);
|
|
756
424
|
}
|
|
757
|
-
function createSegmentsAtLevel(e,
|
|
758
|
-
let
|
|
759
|
-
for (let
|
|
760
|
-
let
|
|
761
|
-
|
|
425
|
+
function createSegmentsAtLevel(e, y, b = !0) {
|
|
426
|
+
let x = e.length, S = !1, C = [], w = [];
|
|
427
|
+
for (let T = 0; T < x; T++) {
|
|
428
|
+
let x = e[T], E = Level_default.intersect(y, x.level);
|
|
429
|
+
b && !E && S ? w.push(x) : E && (S || (w = [], C.push(w), b && T !== 0 && w.push(e[T - 1])), w.push(x)), S = E;
|
|
762
430
|
}
|
|
763
|
-
return
|
|
431
|
+
return C;
|
|
764
432
|
}
|
|
765
|
-
function segmentIntersection(e,
|
|
766
|
-
let
|
|
767
|
-
x: e.lng *
|
|
768
|
-
y: e.lat *
|
|
769
|
-
}),
|
|
770
|
-
if (Math.abs(
|
|
771
|
-
let
|
|
772
|
-
return
|
|
433
|
+
function segmentIntersection(e, y, b, x) {
|
|
434
|
+
let S = (e) => e * Math.PI / 180, C = (e.lat + y.lat + b.lat + x.lat) / 4, w = R_MAJOR * 180 / Math.PI, T = R_MAJOR * 180 / Math.PI * Math.cos(S(C)), E = (e) => ({
|
|
435
|
+
x: e.lng * T,
|
|
436
|
+
y: e.lat * w
|
|
437
|
+
}), D = E(e), O = E(y), A = E(b), j = E(x), M = O.x - D.x, N = O.y - D.y, P = j.x - A.x, F = j.y - A.y, I = M * F - N * P;
|
|
438
|
+
if (Math.abs(I) < 1e-10) return null;
|
|
439
|
+
let L = A.x - D.x, R = A.y - D.y, z = (L * F - R * P) / I, B = (L * N - R * M) / I;
|
|
440
|
+
return z < 0 || z > 1 || B < 0 || B > 1 ? null : new Coordinates_default((D.y + z * N) / w, (D.x + z * M) / T);
|
|
773
441
|
}
|
|
774
442
|
var BoundingBox_default = class e {
|
|
775
443
|
northEast;
|
|
776
444
|
southWest;
|
|
777
|
-
constructor(e,
|
|
778
|
-
if (this.northEast = e, this.southWest =
|
|
445
|
+
constructor(e, y) {
|
|
446
|
+
if (this.northEast = e, this.southWest = y, this.northEast && this.southWest && this.getNorth() < this.getSouth()) throw Error("Incorrect bounding box");
|
|
779
447
|
}
|
|
780
448
|
get center() {
|
|
781
449
|
return new Coordinates_default((this.southWest.lat + this.northEast.lat) / 2, (this.northEast.lng + this.southWest.lng) / 2);
|
|
@@ -783,20 +451,20 @@ var BoundingBox_default = class e {
|
|
|
783
451
|
contains(e) {
|
|
784
452
|
return e.lat <= this.northEast.lat && e.lat >= this.southWest.lat && e.lng <= this.northEast.lng && e.lng >= this.southWest.lng;
|
|
785
453
|
}
|
|
786
|
-
extend(
|
|
787
|
-
let
|
|
788
|
-
if (
|
|
789
|
-
else if (
|
|
454
|
+
extend(y) {
|
|
455
|
+
let b = this.southWest, x = this.northEast, S, C;
|
|
456
|
+
if (y instanceof Coordinates_default) S = y, C = y;
|
|
457
|
+
else if (y instanceof e) S = y.southWest, C = y.northEast;
|
|
790
458
|
else throw Error("Unknown parameter");
|
|
791
|
-
return this.southWest = new Coordinates_default(Math.min(
|
|
459
|
+
return this.southWest = new Coordinates_default(Math.min(S.lat, b.lat), Math.min(S.lng, b.lng)), this.northEast = new Coordinates_default(Math.max(C.lat, x.lat), Math.max(C.lng, x.lng)), this;
|
|
792
460
|
}
|
|
793
461
|
extendsWithMeasure(e) {
|
|
794
462
|
if (typeof e != "number") throw Error("measure is not a number");
|
|
795
463
|
return this.northEast = this.northEast.destinationPoint(e, 0).move(e, Math.PI / 2), this.southWest = this.southWest.clone().destinationPoint(e, -Math.PI / 2).destinationPoint(e, Math.PI), this;
|
|
796
464
|
}
|
|
797
465
|
pad(e) {
|
|
798
|
-
let
|
|
799
|
-
return this.southWest = new Coordinates_default(
|
|
466
|
+
let y = this.southWest, b = this.northEast, x = Math.abs(y.lat - b.lat) * e, S = Math.abs(y.lng - b.lng) * e;
|
|
467
|
+
return this.southWest = new Coordinates_default(y.lat - x, y.lng - S), this.northEast = new Coordinates_default(b.lat + x, b.lng + S), this;
|
|
800
468
|
}
|
|
801
469
|
getSouthWest() {
|
|
802
470
|
return this.southWest;
|
|
@@ -822,17 +490,17 @@ var BoundingBox_default = class e {
|
|
|
822
490
|
getNorth() {
|
|
823
491
|
return this.northEast.lat;
|
|
824
492
|
}
|
|
825
|
-
static equals(e,
|
|
826
|
-
return Coordinates_default.equals(e.northEast,
|
|
493
|
+
static equals(e, y) {
|
|
494
|
+
return Coordinates_default.equals(e.northEast, y.northEast) && Coordinates_default.equals(e.southWest, y.southWest);
|
|
827
495
|
}
|
|
828
|
-
equals(
|
|
829
|
-
return e.equals(this,
|
|
496
|
+
equals(y) {
|
|
497
|
+
return e.equals(this, y);
|
|
830
498
|
}
|
|
831
|
-
static fromArray(
|
|
832
|
-
return new e(new Coordinates_default(
|
|
499
|
+
static fromArray(y) {
|
|
500
|
+
return new e(new Coordinates_default(y[3], y[2]), new Coordinates_default(y[1], y[0]));
|
|
833
501
|
}
|
|
834
|
-
static fromCoordinates(
|
|
835
|
-
return
|
|
502
|
+
static fromCoordinates(y) {
|
|
503
|
+
return y.length === 0 ? null : y.reduce((e, y) => e.extend(y), new e(y[0], y[0]));
|
|
836
504
|
}
|
|
837
505
|
toArray() {
|
|
838
506
|
return [
|
|
@@ -849,8 +517,8 @@ var BoundingBox_default = class e {
|
|
|
849
517
|
time = null;
|
|
850
518
|
_accuracy = null;
|
|
851
519
|
_bearing = null;
|
|
852
|
-
constructor(e,
|
|
853
|
-
this.x = e, this.y =
|
|
520
|
+
constructor(e, y, b, x = null, S = null, C = null) {
|
|
521
|
+
this.x = e, this.y = y, this.z = b, this.time = x, this.accuracy = S, this.bearing = C;
|
|
854
522
|
}
|
|
855
523
|
get accuracy() {
|
|
856
524
|
return this._accuracy;
|
|
@@ -868,11 +536,11 @@ var BoundingBox_default = class e {
|
|
|
868
536
|
clone() {
|
|
869
537
|
return new e(this.x, this.y, this.z, this.time, this.accuracy, this.bearing);
|
|
870
538
|
}
|
|
871
|
-
static equals(
|
|
872
|
-
return
|
|
539
|
+
static equals(y, b, x = EPS_MM) {
|
|
540
|
+
return y === null && y === b ? !0 : !(y instanceof e) || !(b instanceof e) ? !1 : Math.abs(b.x - y.x) < x && Math.abs(b.y - y.y) < x && Math.abs(b.z - y.z) < x && y.time === b.time && y.accuracy === b.accuracy && y.bearing === b.bearing;
|
|
873
541
|
}
|
|
874
|
-
equals(
|
|
875
|
-
return e.equals(this,
|
|
542
|
+
equals(y) {
|
|
543
|
+
return e.equals(this, y);
|
|
876
544
|
}
|
|
877
545
|
toJson() {
|
|
878
546
|
return {
|
|
@@ -884,42 +552,42 @@ var BoundingBox_default = class e {
|
|
|
884
552
|
...this.bearing !== null && { bearing: this.bearing }
|
|
885
553
|
};
|
|
886
554
|
}
|
|
887
|
-
static fromJson(
|
|
888
|
-
return new e(
|
|
555
|
+
static fromJson(y) {
|
|
556
|
+
return new e(y.x, y.y, y.z, y.time, y.accuracy, y.bearing);
|
|
889
557
|
}
|
|
890
|
-
}, GeoRelativePosition_default = class extends RelativePosition_default {}, GeoRef_default = class
|
|
558
|
+
}, GeoRelativePosition_default = class extends RelativePosition_default {}, GeoRef_default = class y {
|
|
891
559
|
scale = 1;
|
|
892
560
|
heading = 0;
|
|
893
561
|
origin;
|
|
894
562
|
buildingLevels;
|
|
895
|
-
constructor(e,
|
|
896
|
-
this.origin = e, this.buildingLevels =
|
|
563
|
+
constructor(e, y = []) {
|
|
564
|
+
this.origin = e, this.buildingLevels = y;
|
|
897
565
|
}
|
|
898
|
-
localToWorld(
|
|
899
|
-
let
|
|
566
|
+
localToWorld(y) {
|
|
567
|
+
let x = Vector3.multiplyScalar(y, this.scale), S = Quaternion.fromAxisAngle([
|
|
900
568
|
0,
|
|
901
569
|
0,
|
|
902
570
|
1
|
|
903
|
-
], this.heading),
|
|
904
|
-
|
|
905
|
-
let
|
|
906
|
-
|
|
571
|
+
], this.heading), C = Quaternion.multiply(S, this.origin.enuToEcefRotation), w = Quaternion.rotate(C, x), E = Vector3.sum(this.origin.ecef, w), D = Coordinates_default.fromECEF(E), O = D.alt;
|
|
572
|
+
D.heightFromGround = D.alt - this.origin.alt;
|
|
573
|
+
let k = (e) => {
|
|
574
|
+
D.level = e.id, D.heightFromFloor = O - e.floorAltitude;
|
|
907
575
|
};
|
|
908
|
-
if (!this.buildingLevels.length) return
|
|
909
|
-
let
|
|
910
|
-
if (!
|
|
911
|
-
let
|
|
912
|
-
if (!
|
|
913
|
-
let
|
|
914
|
-
return
|
|
915
|
-
}
|
|
916
|
-
worldToLocal(
|
|
917
|
-
let
|
|
576
|
+
if (!this.buildingLevels.length) return D;
|
|
577
|
+
let A = this.buildingLevels.filter((e) => O >= e.floorAltitude && O <= e.ceilingAltitude);
|
|
578
|
+
if (!A.length) return D;
|
|
579
|
+
let j = A[0], M = [D.lng, D.lat], N = A.filter((e) => e.geometries.length);
|
|
580
|
+
if (!N.length) return k(j), D;
|
|
581
|
+
let P = N.filter((e) => e.geometries.some((e) => booleanPointInPolygon(M, e)))[0];
|
|
582
|
+
return P && k(P), D;
|
|
583
|
+
}
|
|
584
|
+
worldToLocal(y) {
|
|
585
|
+
let x = Quaternion.fromAxisAngle([
|
|
918
586
|
0,
|
|
919
587
|
0,
|
|
920
588
|
1
|
|
921
|
-
], -this.heading),
|
|
922
|
-
return Quaternion.rotate(
|
|
589
|
+
], -this.heading), S = Quaternion.multiply(this.origin.ecefToEnuRotation, x), C = Vector3.subtract(y.ecef, this.origin.ecef), w = Vector3.multiplyScalar(C, 1 / this.scale);
|
|
590
|
+
return Quaternion.rotate(S, w);
|
|
923
591
|
}
|
|
924
592
|
toJson() {
|
|
925
593
|
return {
|
|
@@ -929,10 +597,10 @@ var BoundingBox_default = class e {
|
|
|
929
597
|
};
|
|
930
598
|
}
|
|
931
599
|
static fromJson(e) {
|
|
932
|
-
let
|
|
933
|
-
return
|
|
600
|
+
let b = new y(Coordinates_default.fromJson(e.origin));
|
|
601
|
+
return b.scale = e.scale === void 0 ? 1 : e.scale, b.heading = e.heading === void 0 ? 0 : e.heading, b;
|
|
934
602
|
}
|
|
935
|
-
}, Attitude_default = class
|
|
603
|
+
}, Attitude_default = class b {
|
|
936
604
|
_quaternion = [
|
|
937
605
|
1,
|
|
938
606
|
0,
|
|
@@ -943,11 +611,11 @@ var BoundingBox_default = class e {
|
|
|
943
611
|
_eulerAngles = null;
|
|
944
612
|
_time = null;
|
|
945
613
|
_accuracy = null;
|
|
946
|
-
constructor(e,
|
|
947
|
-
this.quaternion = e, this.time =
|
|
614
|
+
constructor(e, y = null, b = null) {
|
|
615
|
+
this.quaternion = e, this.time = y, this.accuracy = b;
|
|
948
616
|
}
|
|
949
617
|
static unitary() {
|
|
950
|
-
return new
|
|
618
|
+
return new b([
|
|
951
619
|
1,
|
|
952
620
|
0,
|
|
953
621
|
0,
|
|
@@ -957,9 +625,9 @@ var BoundingBox_default = class e {
|
|
|
957
625
|
get quaternion() {
|
|
958
626
|
return this._quaternion;
|
|
959
627
|
}
|
|
960
|
-
set quaternion(
|
|
961
|
-
if (Math.abs(1 - Quaternion.norm(
|
|
962
|
-
this._quaternion =
|
|
628
|
+
set quaternion(y) {
|
|
629
|
+
if (Math.abs(1 - Quaternion.norm(y)) > 1e-4) throw Error("quaternion is not a unit quaternion");
|
|
630
|
+
this._quaternion = y, this._heading = null, this._eulerAngles = null;
|
|
963
631
|
}
|
|
964
632
|
get time() {
|
|
965
633
|
return this._time;
|
|
@@ -990,11 +658,11 @@ var BoundingBox_default = class e {
|
|
|
990
658
|
get headingDegrees() {
|
|
991
659
|
return rad2deg(this.heading);
|
|
992
660
|
}
|
|
993
|
-
static equals(
|
|
994
|
-
return
|
|
661
|
+
static equals(y, x) {
|
|
662
|
+
return y === null && y === x ? !0 : !(y instanceof b) || !(x instanceof b) ? !1 : y === x ? !0 : Quaternion.equals(y.quaternion, x.quaternion);
|
|
995
663
|
}
|
|
996
|
-
equals(
|
|
997
|
-
return
|
|
664
|
+
equals(e) {
|
|
665
|
+
return b.equals(this, e);
|
|
998
666
|
}
|
|
999
667
|
toJson() {
|
|
1000
668
|
return this.time === null && this.accuracy === null ? this.quaternion : {
|
|
@@ -1003,24 +671,24 @@ var BoundingBox_default = class e {
|
|
|
1003
671
|
...this.accuracy !== null && { accuracy: this.accuracy }
|
|
1004
672
|
};
|
|
1005
673
|
}
|
|
1006
|
-
static fromJson(
|
|
1007
|
-
return Array.isArray(
|
|
674
|
+
static fromJson(e) {
|
|
675
|
+
return Array.isArray(e) ? new b(e, null, null) : new b(e.q, e.time, e.accuracy);
|
|
1008
676
|
}
|
|
1009
677
|
clone() {
|
|
1010
|
-
return new
|
|
678
|
+
return new b(this.quaternion.slice(0), this.time, this.accuracy);
|
|
1011
679
|
}
|
|
1012
|
-
static diff(
|
|
1013
|
-
let
|
|
1014
|
-
|
|
1015
|
-
let
|
|
1016
|
-
return
|
|
680
|
+
static diff(y, x) {
|
|
681
|
+
let S = Quaternion.multiply(Quaternion.inverse(y.quaternion), x.quaternion), C = null;
|
|
682
|
+
x.time !== null && y.time !== null && (C = x.time - y.time);
|
|
683
|
+
let w = null;
|
|
684
|
+
return y.accuracy !== null && x.accuracy !== null && (w = Math.max(x.accuracy - y.accuracy)), new b(S, C, w);
|
|
1017
685
|
}
|
|
1018
|
-
}, AbsoluteHeading_default = class
|
|
686
|
+
}, AbsoluteHeading_default = class y {
|
|
1019
687
|
heading;
|
|
1020
688
|
time = null;
|
|
1021
689
|
_accuracy = null;
|
|
1022
|
-
constructor(e,
|
|
1023
|
-
this.heading = e, this.time =
|
|
690
|
+
constructor(e, y = null, b = null) {
|
|
691
|
+
this.heading = e, this.time = y, this.accuracy = b;
|
|
1024
692
|
}
|
|
1025
693
|
get accuracy() {
|
|
1026
694
|
return this._accuracy;
|
|
@@ -1036,11 +704,11 @@ var BoundingBox_default = class e {
|
|
|
1036
704
|
1
|
|
1037
705
|
], -this.heading), this.time, this.accuracy);
|
|
1038
706
|
}
|
|
1039
|
-
static equals(
|
|
1040
|
-
return
|
|
707
|
+
static equals(e, b) {
|
|
708
|
+
return e === null && e === b ? !0 : !(e instanceof y) || !(b instanceof y) ? !1 : Math.abs(e.heading - b.heading) < 1e-8;
|
|
1041
709
|
}
|
|
1042
|
-
equals(
|
|
1043
|
-
return
|
|
710
|
+
equals(e) {
|
|
711
|
+
return y.equals(this, e);
|
|
1044
712
|
}
|
|
1045
713
|
toJson() {
|
|
1046
714
|
return {
|
|
@@ -1049,11 +717,11 @@ var BoundingBox_default = class e {
|
|
|
1049
717
|
...this.accuracy !== null && { accuracy: this.accuracy }
|
|
1050
718
|
};
|
|
1051
719
|
}
|
|
1052
|
-
static fromJson(
|
|
1053
|
-
return new e
|
|
720
|
+
static fromJson(e) {
|
|
721
|
+
return new y(e.heading, e.time, e.accuracy);
|
|
1054
722
|
}
|
|
1055
723
|
clone() {
|
|
1056
|
-
return new
|
|
724
|
+
return new y(this.heading, this.time, this.accuracy);
|
|
1057
725
|
}
|
|
1058
726
|
};
|
|
1059
727
|
export { AbsoluteHeading_default as AbsoluteHeading, Attitude_default as Attitude, BoundingBox_default as BoundingBox, Constants_exports as Constants, Coordinates_default as Coordinates, GeoRef_default as GeoRef, GeoRelativePosition_default as GeoRelativePosition, Level_default as Level, RelativePosition_default as RelativePosition, UserPosition_default as UserPosition, Utils_exports as Utils };
|