@ac-kit/math-geodesy 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/README.md +47 -0
- package/dist/_ecef-height.d.ts +14 -12
- package/dist/_ecef-height.d.ts.map +1 -1
- package/dist/_ecef-height.js +115 -41
- package/dist/_ecef-height.js.map +1 -1
- package/dist/ellipsoid.d.ts +21 -0
- package/dist/ellipsoid.d.ts.map +1 -1
- package/dist/ellipsoid.js +57 -1
- package/dist/ellipsoid.js.map +1 -1
- package/dist/geodesic/_angle.d.ts +10 -15
- package/dist/geodesic/_angle.d.ts.map +1 -1
- package/dist/geodesic/_angle.js +54 -39
- package/dist/geodesic/_angle.js.map +1 -1
- package/dist/geodesic/_constants.d.ts.map +1 -1
- package/dist/geodesic/_constants.js +2 -1
- package/dist/geodesic/_constants.js.map +1 -1
- package/dist/geodesic/_inverse.d.ts.map +1 -1
- package/dist/geodesic/_inverse.js +34 -28
- package/dist/geodesic/_inverse.js.map +1 -1
- package/dist/geodesic/_line.d.ts +7 -8
- package/dist/geodesic/_line.d.ts.map +1 -1
- package/dist/geodesic/_line.js +28 -23
- package/dist/geodesic/_line.js.map +1 -1
- package/dist/geodesic/_series.js.map +1 -1
- package/dist/geodesic.d.ts +37 -9
- package/dist/geodesic.d.ts.map +1 -1
- package/dist/geodesic.js +173 -90
- package/dist/geodesic.js.map +1 -1
- package/dist/geodetic.d.ts +2 -1
- package/dist/geodetic.d.ts.map +1 -1
- package/dist/geodetic.js +42 -16
- package/dist/geodetic.js.map +1 -1
- package/dist/horizon.d.ts +63 -0
- package/dist/horizon.d.ts.map +1 -0
- package/dist/horizon.js +131 -0
- package/dist/horizon.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/local-frame.d.ts.map +1 -1
- package/dist/local-frame.js +40 -9
- package/dist/local-frame.js.map +1 -1
- package/dist/refraction.d.ts +80 -0
- package/dist/refraction.d.ts.map +1 -0
- package/dist/refraction.js +110 -0
- package/dist/refraction.js.map +1 -0
- package/package.json +12 -8
package/dist/geodesic/_line.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// [−180, 180]) of the upstream file. Upstream's symbols are spelled out: see
|
|
5
5
|
// `_inverse.ts`. The state is one `Float64Array` record, so every line has one
|
|
6
6
|
// shape and a position allocates no object.
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { atan2DegInPlace, DEG_TO_RAD, sinCosDegInPlace, } from "@ac-kit/math-scalar";
|
|
8
|
+
import { angleNormalizeInPlace_, angleRoundInPlace_, scratchCreate_, TINY_, TINY_DOUBLE_, } from "./_angle.js";
|
|
9
9
|
import { CONSTANT_FLATTENING_, CONSTANT_POLAR_RADIUS_, CONSTANT_POLAR_RATIO_, CONSTANT_SECOND_ECCENTRICITY_SQUARED_, SERIES_ORDER_, } from "./_constants.js";
|
|
10
10
|
import { a1Minus1_, a3_, c1_, c1Prime_, c3_, SERIES_COS_, SERIES_EPSILON_, SERIES_MEAN_, SERIES_SIN_, SERIES_SLOTS_, SERIES_VALUE_, seriesRegisters_, sinCosSeriesInto_, } from "./_series.js";
|
|
11
11
|
/** Scratch for the sine and cosine of an angle. */
|
|
@@ -29,7 +29,11 @@ const LINE_SIN_TAU1_ = 15;
|
|
|
29
29
|
const LINE_COS_TAU1_ = 16;
|
|
30
30
|
const LINE_A3C_ = 17;
|
|
31
31
|
const LINE_B31_ = 18;
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The index of the line's length in metres in a line record: `NaN` until the
|
|
34
|
+
* caller writes it (a line built from an inverse problem).
|
|
35
|
+
*/
|
|
36
|
+
export const LINE_DISTANCE_ = 19;
|
|
33
37
|
const LINE_C1_ = 20;
|
|
34
38
|
const LINE_C1_PRIME_ = LINE_C1_ + SERIES_SLOTS_;
|
|
35
39
|
const LINE_C3_ = LINE_C1_PRIME_ + SERIES_SLOTS_;
|
|
@@ -56,8 +60,8 @@ export function lineRecordCreate_() {
|
|
|
56
60
|
* `(start[START_LATITUDE_], start[START_LONGITUDE_])`, leaving at the azimuth
|
|
57
61
|
* `start[START_AZIMUTH_]` degrees when `start[START_SIN_ALPHA_]` is `NaN`,
|
|
58
62
|
* otherwise at the azimuth whose sine and cosine are given (the inverse
|
|
59
|
-
* problem's result). Its length is `NaN
|
|
60
|
-
*
|
|
63
|
+
* problem's result). Its length, `line[LINE_DISTANCE_]`, is `NaN`. Allocates
|
|
64
|
+
* nothing: the doubles travel in buffers, and no callee takes or returns one.
|
|
61
65
|
*/
|
|
62
66
|
export function lineInitialize_(line, constants, start) {
|
|
63
67
|
const latitude1 = start[START_LATITUDE_];
|
|
@@ -69,16 +73,20 @@ export function lineInitialize_(line, constants, start) {
|
|
|
69
73
|
line[LINE_POLAR_RADIUS_] = constants[CONSTANT_POLAR_RADIUS_];
|
|
70
74
|
line[LINE_POLAR_RATIO_] = polarRatio;
|
|
71
75
|
line[LINE_FLATTENING_] = flattening;
|
|
72
|
-
line[LINE_LONGITUDE1_] =
|
|
76
|
+
line[LINE_LONGITUDE1_] = longitude1;
|
|
77
|
+
angleNormalizeInPlace_(line, LINE_LONGITUDE1_);
|
|
73
78
|
if (Number.isNaN(sinAlpha1)) {
|
|
74
|
-
angleScratch_[0] =
|
|
79
|
+
angleScratch_[0] = start[START_AZIMUTH_];
|
|
80
|
+
angleNormalizeInPlace_(angleScratch_, 0);
|
|
81
|
+
angleRoundInPlace_(angleScratch_, 0);
|
|
75
82
|
sinCosDegInPlace(angleScratch_);
|
|
76
83
|
sinAlpha1 = angleScratch_[0];
|
|
77
84
|
cosAlpha1 = angleScratch_[1];
|
|
78
85
|
}
|
|
79
86
|
line[LINE_SIN_ALPHA1_] = sinAlpha1;
|
|
80
87
|
line[LINE_COS_ALPHA1_] = cosAlpha1;
|
|
81
|
-
angleScratch_[0] =
|
|
88
|
+
angleScratch_[0] = Math.abs(latitude1) > 90 ? Number.NaN : latitude1;
|
|
89
|
+
angleRoundInPlace_(angleScratch_, 0);
|
|
82
90
|
sinCosDegInPlace(angleScratch_);
|
|
83
91
|
let sinBeta1 = polarRatio * angleScratch_[0];
|
|
84
92
|
let cosBeta1 = angleScratch_[1];
|
|
@@ -128,18 +136,6 @@ export function lineInitialize_(line, constants, start) {
|
|
|
128
136
|
line[LINE_B31_] = seriesRegisters_[SERIES_VALUE_];
|
|
129
137
|
line[LINE_DISTANCE_] = Number.NaN;
|
|
130
138
|
}
|
|
131
|
-
/** The azimuth of the line at its start, degrees in `(−180, 180]`. */
|
|
132
|
-
export function lineStartAzimuth_(line) {
|
|
133
|
-
return atan2Deg(line[LINE_SIN_ALPHA1_], line[LINE_COS_ALPHA1_]);
|
|
134
|
-
}
|
|
135
|
-
/** Sets the length of the line, metres. */
|
|
136
|
-
export function lineSetDistance_(line, distance) {
|
|
137
|
-
line[LINE_DISTANCE_] = distance;
|
|
138
|
-
}
|
|
139
|
-
/** The length set by {@link lineSetDistance_}, `NaN` before. */
|
|
140
|
-
export function lineDistance_(line) {
|
|
141
|
-
return line[LINE_DISTANCE_];
|
|
142
|
-
}
|
|
143
139
|
/**
|
|
144
140
|
* The longitude, latitude and azimuth (degrees) at the distance `io[3]` metres
|
|
145
141
|
* along the line (negative goes backwards), into `io[0 … 2]`.
|
|
@@ -207,8 +203,17 @@ export function linePosition_(line, io) {
|
|
|
207
203
|
line[LINE_A3C_] *
|
|
208
204
|
(sigma12 + (seriesRegisters_[SERIES_VALUE_] - line[LINE_B31_]));
|
|
209
205
|
const longitude12 = lambda12 / DEG_TO_RAD;
|
|
210
|
-
io[POSITION_LONGITUDE_] =
|
|
211
|
-
io
|
|
212
|
-
io[
|
|
206
|
+
io[POSITION_LONGITUDE_] = longitude12;
|
|
207
|
+
angleNormalizeInPlace_(io, POSITION_LONGITUDE_);
|
|
208
|
+
io[POSITION_LONGITUDE_] = line[LINE_LONGITUDE1_] + io[POSITION_LONGITUDE_];
|
|
209
|
+
angleNormalizeInPlace_(io, POSITION_LONGITUDE_);
|
|
210
|
+
angleScratch_[0] = sinBeta2;
|
|
211
|
+
angleScratch_[1] = line[LINE_POLAR_RATIO_] * cosBeta2;
|
|
212
|
+
atan2DegInPlace(angleScratch_, 0);
|
|
213
|
+
io[POSITION_LATITUDE_] = angleScratch_[0];
|
|
214
|
+
angleScratch_[0] = sinAlpha2;
|
|
215
|
+
angleScratch_[1] = cosAlpha2;
|
|
216
|
+
atan2DegInPlace(angleScratch_, 0);
|
|
217
|
+
io[POSITION_AZIMUTH_] = angleScratch_[0] + 0;
|
|
213
218
|
}
|
|
214
219
|
//# sourceMappingURL=_line.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_line.js","sourceRoot":"","sources":["../../src/geodesic/_line.ts"],"names":[],"mappings":"AAAA,qJAAqJ;AAErJ,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,+EAA+E;AAC/E,4CAA4C;AAE5C,OAAO,
|
|
1
|
+
{"version":3,"file":"_line.js","sourceRoot":"","sources":["../../src/geodesic/_line.ts"],"names":[],"mappings":"AAAA,qJAAqJ;AAErJ,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,+EAA+E;AAC/E,4CAA4C;AAE5C,OAAO,EACN,eAAe,EACf,UAAU,EACV,gBAAgB,GAChB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACN,sBAAsB,EACtB,kBAAkB,EAElB,cAAc,EACd,KAAK,EACL,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,qCAAqC,EACrC,aAAa,GACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,SAAS,EACT,GAAG,EACH,GAAG,EACH,QAAQ,EACR,GAAG,EACH,WAAW,EACX,eAAe,EACf,YAAY,EACZ,WAAW,EACX,aAAa,EACb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AC,CAAC;AAClD,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,GAAG,CAAC,GAAa,EAAE,MAAc;IAChD,WAAW,CAAC,gBAAgB,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,GAAG,CAAC,SAAmB;IACtC,gBAAgB,CAAC,YAAY,CAAC,GAAG,gBAAgB,CAAC,eAAe,CAAE,CAAC;IACpE,yBAAyB,CACxB,SAAS,EACT,YAAY,EACZ,aAAa,GAAG,CAAC,EACjB,gBAAgB,EAChB,YAAY,CACZ,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,GAAG,CAAC,SAAmB,EAAE,GAAa,EAAE,MAAc;IACrE,MAAM,GAAG,GAAG,gBAAgB,CAAC,eAAe,CAAE,CAAC;IAC/C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,eAAe,GAAG,YAAY,CAAC;IACnC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,aAAa,EAAE,KAAK,EAAE,EAAE,CAAC;QACpD,MAAM,MAAM,GAAG,aAAa,GAAG,KAAK,GAAG,CAAC,CAAC;QACzC,KAAK,IAAI,GAAG,CAAC;QACb,gBAAgB,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC;QACrC,yBAAyB,CACxB,SAAS,EACT,eAAe,EACf,MAAM,EACN,gBAAgB,EAChB,YAAY,CACZ,CAAC;QACF,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAC7D,eAAe,IAAI,MAAM,GAAG,CAAC,CAAC;IAC/B,CAAC;AACF,CAAC"}
|
package/dist/geodesic.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ export type GeodesicLine = {
|
|
|
17
17
|
*
|
|
18
18
|
* Coincident points give a distance of `0` and `NaN` azimuths; a non-finite
|
|
19
19
|
* longitude or latitude, or a latitude beyond ±90°, gives all `NaN`. Accurate
|
|
20
|
-
* to 15 nanometres on WGS 84, nearly antipodal points included. Allocates
|
|
21
|
-
*
|
|
20
|
+
* to 15 nanometres on WGS 84, nearly antipodal points included. Allocates
|
|
21
|
+
* nothing, whether or not the engine inlines the solver's helpers. O(1).
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```ts
|
|
@@ -34,24 +34,44 @@ export declare function geodesicInverse(out: GeodesicInverse, from: ReadonlyGeod
|
|
|
34
34
|
* `0`, of the geodesic leaving `from` at `azimuthDeg` (degrees clockwise from
|
|
35
35
|
* north) and running `distanceM` metres (negative goes backwards). The
|
|
36
36
|
* longitude is in `[−180, 180]`. A non-finite input, or a latitude beyond ±90°,
|
|
37
|
-
* gives `NaN`s. Runs through a line
|
|
37
|
+
* gives `NaN`s. Runs through a line held in a module-level buffer. O(1).
|
|
38
|
+
*
|
|
39
|
+
* The solver allocates nothing, whether or not the engine inlines its helpers.
|
|
40
|
+
* The only allocation a call can cost is the caller's: an engine that does not
|
|
41
|
+
* inline `geodesicDirect` into its caller boxes the two `number` arguments that
|
|
42
|
+
* are not small integers, two heap numbers per call.
|
|
38
43
|
*/
|
|
39
44
|
export declare function geodesicDirect(out: Geodetic, from: ReadonlyGeodetic, azimuthDeg: number, distanceM: number, ellipsoid: Ellipsoid): Geodetic;
|
|
40
45
|
/**
|
|
41
46
|
* Creates the geodesic line leaving `from` at `azimuthDeg`, to query with
|
|
42
47
|
* {@link geodesicLinePosition}, {@link geodesicLineAzimuth} and
|
|
43
48
|
* {@link geodesicLinePositions}. Its length is unknown:
|
|
44
|
-
* {@link geodesicLineDistance} gives `NaN`. Allocates
|
|
45
|
-
* it many times.
|
|
49
|
+
* {@link geodesicLineDistance} gives `NaN`. Allocates the line's record (one
|
|
50
|
+
* `Float64Array`); build it once and query it many times.
|
|
46
51
|
*
|
|
47
52
|
* @throws {RangeError} For a non-finite start or azimuth, or a latitude beyond
|
|
48
53
|
* ±90°.
|
|
49
54
|
*/
|
|
50
55
|
export declare function geodesicLine(from: ReadonlyGeodetic, azimuthDeg: number, ellipsoid: Ellipsoid): GeodesicLine;
|
|
56
|
+
/**
|
|
57
|
+
* Re-aims `out`, a line made by any `geodesicLine…` builder, as the geodesic
|
|
58
|
+
* leaving `from` at `azimuthDeg` on `ellipsoid`: the line {@link geodesicLine}
|
|
59
|
+
* would build, written over `out`'s record. Its length becomes unknown ({@link
|
|
60
|
+
* geodesicLineDistance} gives `NaN`). For a fan of lines from one point (a
|
|
61
|
+
* horizon, a viewshed) with no record per line. O(1).
|
|
62
|
+
*
|
|
63
|
+
* The solver allocates nothing, whether or not the engine inlines its helpers;
|
|
64
|
+
* an engine that does not inline `geodesicLineSet` into its caller boxes
|
|
65
|
+
* `azimuthDeg` unless it is a small integer, one heap number per call.
|
|
66
|
+
*
|
|
67
|
+
* @throws {RangeError} For a non-finite start or azimuth, or a latitude beyond
|
|
68
|
+
* ±90°; `out` is left as it was.
|
|
69
|
+
*/
|
|
70
|
+
export declare function geodesicLineSet(out: GeodesicLine, from: ReadonlyGeodetic, azimuthDeg: number, ellipsoid: Ellipsoid): GeodesicLine;
|
|
51
71
|
/**
|
|
52
72
|
* Creates the geodesic joining `from` to `to` (Karney's `InverseLine`), whose
|
|
53
73
|
* length {@link geodesicLineDistance} gives and whose position at that distance
|
|
54
|
-
* is `to`. Allocates.
|
|
74
|
+
* is `to`. Allocates the line's record (one `Float64Array`).
|
|
55
75
|
*
|
|
56
76
|
* @throws {RangeError} For a non-finite position, or a latitude beyond ±90°.
|
|
57
77
|
*/
|
|
@@ -63,13 +83,18 @@ export declare function geodesicLineBetween(from: ReadonlyGeodetic, to: Readonly
|
|
|
63
83
|
export declare function geodesicLineDistance(line: GeodesicLine): number;
|
|
64
84
|
/**
|
|
65
85
|
* Writes the position, at height `0`, `distanceM` metres along `line` (negative
|
|
66
|
-
* goes backwards) into `out`. A non-finite distance gives `NaN`s.
|
|
67
|
-
*
|
|
86
|
+
* goes backwards) into `out`. A non-finite distance gives `NaN`s. O(1).
|
|
87
|
+
*
|
|
88
|
+
* The solver allocates nothing, whether or not the engine inlines its helpers;
|
|
89
|
+
* an engine that does not inline `geodesicLinePosition` into its caller boxes
|
|
90
|
+
* `distanceM` unless it is a small integer, one heap number per call.
|
|
68
91
|
*/
|
|
69
92
|
export declare function geodesicLinePosition(out: Geodetic, line: GeodesicLine, distanceM: number): Geodetic;
|
|
70
93
|
/**
|
|
71
94
|
* The azimuth in degrees, clockwise from north in `(−180, 180]`, of `line`
|
|
72
|
-
* `distanceM` metres along it. A non-finite distance gives `NaN`. O(1).
|
|
95
|
+
* `distanceM` metres along it. A non-finite distance gives `NaN`. O(1). The
|
|
96
|
+
* solver allocates nothing; a caller that does not inline this function boxes a
|
|
97
|
+
* fractional `distanceM` and the returned azimuth, a heap number each.
|
|
73
98
|
*/
|
|
74
99
|
export declare function geodesicLineAzimuth(line: GeodesicLine, distanceM: number): number;
|
|
75
100
|
/**
|
|
@@ -77,6 +102,9 @@ export declare function geodesicLineAzimuth(line: GeodesicLine, distanceM: numbe
|
|
|
77
102
|
* as geodetic triples `[longitudeDeg, latitudeDeg, 0, …]`: ready for the
|
|
78
103
|
* caller's heights and `ecefArrayFromGeodetic`, with no copy. O(n).
|
|
79
104
|
*
|
|
105
|
+
* `distancesM` may share memory with `out` (a view into it, say), whatever its
|
|
106
|
+
* class. Allocates nothing, whatever the engine inlines.
|
|
107
|
+
*
|
|
80
108
|
* @throws {RangeError} Unless `out` holds three numbers per distance.
|
|
81
109
|
*/
|
|
82
110
|
export declare function geodesicLinePositions<T extends Float64Array>(out: T, line: GeodesicLine, distancesM: Float64Array): T;
|
package/dist/geodesic.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geodesic.d.ts","sourceRoot":"","sources":["../src/geodesic.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file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YAAY,GAAG,MAAM,CAE/D;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,GACf,QAAQ,CAUV;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,MAAM,GACf,MAAM,CAIR;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,YAAY,EAC3D,GAAG,EAAE,CAAC,EACN,IAAI,EAAE,YAAY,EAClB,UAAU,EAAE,YAAY,GACtB,CAAC,CAwBH"}
|
package/dist/geodesic.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { atan2DegInPlace } from "@ac-kit/math-scalar";
|
|
2
2
|
import { scratchCreate_ } from "./geodesic/_angle.js";
|
|
3
3
|
import { constantsOf_ } from "./geodesic/_constants.js";
|
|
4
|
-
import { INVERSE_COS_ALPHA1_,
|
|
5
|
-
import {
|
|
4
|
+
import { INVERSE_COS_ALPHA1_, INVERSE_DISTANCE_, INVERSE_LATITUDE1_, INVERSE_LATITUDE2_, INVERSE_LENGTH_, INVERSE_LONGITUDE1_, INVERSE_LONGITUDE2_, INVERSE_SIN_ALPHA1_, INVERSE_SIN_ALPHA2_, inverse_, } from "./geodesic/_inverse.js";
|
|
5
|
+
import { LINE_DISTANCE_, lineInitialize_, linePosition_, lineRecordCreate_, POSITION_AZIMUTH_, POSITION_DISTANCE_, POSITION_LATITUDE_, POSITION_LENGTH_, POSITION_LONGITUDE_, START_AZIMUTH_, START_COS_ALPHA_, START_LATITUDE_, START_LENGTH_, START_LONGITUDE_, START_SIN_ALPHA_, } from "./geodesic/_line.js";
|
|
6
6
|
const inverseScratch_ = scratchCreate_(INVERSE_LENGTH_);
|
|
7
7
|
const positionScratch_ = scratchCreate_(POSITION_LENGTH_);
|
|
8
8
|
const startScratch_ = scratchCreate_(START_LENGTH_);
|
|
9
9
|
const directLineScratch_ = lineRecordCreate_();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
// The intrinsic `%TypedArray%.prototype` methods, captured once: a subclass can
|
|
11
|
+
// override `length` or `set` on its instances, but not these.
|
|
12
|
+
const TYPED_ARRAY_PROTOTYPE_ = Object.getPrototypeOf(Float64Array.prototype);
|
|
13
|
+
const typedArraySet_ = TYPED_ARRAY_PROTOTYPE_
|
|
14
|
+
.set;
|
|
15
|
+
const typedArrayLength_ = Object.getOwnPropertyDescriptor(TYPED_ARRAY_PROTOTYPE_, "length").get;
|
|
16
|
+
// Re-entrancy: the solvers share the module-level buffers above, and a
|
|
17
|
+
// caller's record may run code on access (a getter on an input, a setter on
|
|
18
|
+
// `out`) that calls a solver again. So every public function reads all its
|
|
19
|
+
// inputs into locals before writing a buffer, and reads all its results out of
|
|
20
|
+
// the buffers into locals before writing `out`. The positions are validated
|
|
21
|
+
// inline: a helper taking the coordinates as doubles would box them whenever
|
|
22
|
+
// it was not inlined.
|
|
13
23
|
/**
|
|
14
24
|
* Solves the inverse geodesic problem on `ellipsoid`: the shortest path from
|
|
15
25
|
* `from` to `to`, writing its length in metres and its azimuths at both ends,
|
|
@@ -18,8 +28,8 @@ function isValidPosition_(longitude, latitude) {
|
|
|
18
28
|
*
|
|
19
29
|
* Coincident points give a distance of `0` and `NaN` azimuths; a non-finite
|
|
20
30
|
* longitude or latitude, or a latitude beyond ±90°, gives all `NaN`. Accurate
|
|
21
|
-
* to 15 nanometres on WGS 84, nearly antipodal points included. Allocates
|
|
22
|
-
*
|
|
31
|
+
* to 15 nanometres on WGS 84, nearly antipodal points included. Allocates
|
|
32
|
+
* nothing, whether or not the engine inlines the solver's helpers. O(1).
|
|
23
33
|
*
|
|
24
34
|
* @example
|
|
25
35
|
* ```ts
|
|
@@ -34,37 +44,33 @@ export function geodesicInverse(out, from, to, ellipsoid) {
|
|
|
34
44
|
const latitude1 = from[1];
|
|
35
45
|
const longitude2 = to[0];
|
|
36
46
|
const latitude2 = to[1];
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
let distance = Number.NaN;
|
|
48
|
+
let azimuth1 = Number.NaN;
|
|
49
|
+
let azimuth2 = Number.NaN;
|
|
50
|
+
if (Number.isFinite(longitude1) &&
|
|
51
|
+
Math.abs(latitude1) <= 90 &&
|
|
52
|
+
Number.isFinite(longitude2) &&
|
|
53
|
+
Math.abs(latitude2) <= 90) {
|
|
54
|
+
const constants = constantsOf_(ellipsoid);
|
|
55
|
+
inverseScratch_[INVERSE_LATITUDE1_] = latitude1;
|
|
56
|
+
inverseScratch_[INVERSE_LONGITUDE1_] = longitude1;
|
|
57
|
+
inverseScratch_[INVERSE_LATITUDE2_] = latitude2;
|
|
58
|
+
inverseScratch_[INVERSE_LONGITUDE2_] = longitude2;
|
|
59
|
+
inverse_(constants, inverseScratch_);
|
|
60
|
+
distance = inverseScratch_[INVERSE_DISTANCE_];
|
|
61
|
+
if (distance !== 0) {
|
|
62
|
+
// Each azimuth's sine is followed by its cosine, the layout
|
|
63
|
+
// atan2DegInPlace reads; `+ 0` turns a −0 azimuth (due north from a
|
|
64
|
+
// west-going frame) into 0.
|
|
65
|
+
atan2DegInPlace(inverseScratch_, INVERSE_SIN_ALPHA1_);
|
|
66
|
+
atan2DegInPlace(inverseScratch_, INVERSE_SIN_ALPHA2_);
|
|
67
|
+
azimuth1 = inverseScratch_[INVERSE_SIN_ALPHA1_] + 0;
|
|
68
|
+
azimuth2 = inverseScratch_[INVERSE_SIN_ALPHA2_] + 0;
|
|
69
|
+
}
|
|
43
70
|
}
|
|
44
|
-
inverseScratch_[INVERSE_LATITUDE1_] = latitude1;
|
|
45
|
-
inverseScratch_[INVERSE_LONGITUDE1_] = longitude1;
|
|
46
|
-
inverseScratch_[INVERSE_LATITUDE2_] = latitude2;
|
|
47
|
-
inverseScratch_[INVERSE_LONGITUDE2_] = longitude2;
|
|
48
|
-
inverse_(constantsOf_(ellipsoid), inverseScratch_);
|
|
49
|
-
const distance = inverseScratch_[INVERSE_DISTANCE_];
|
|
50
71
|
out[0] = distance;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
out[2] = Number.NaN;
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
// `+ 0` turns a −0 azimuth (due north from a west-going frame) into 0.
|
|
57
|
-
out[1] =
|
|
58
|
-
atan2Deg(inverseScratch_[INVERSE_SIN_ALPHA1_], inverseScratch_[INVERSE_COS_ALPHA1_]) + 0;
|
|
59
|
-
out[2] =
|
|
60
|
-
atan2Deg(inverseScratch_[INVERSE_SIN_ALPHA2_], inverseScratch_[INVERSE_COS_ALPHA2_]) + 0;
|
|
61
|
-
}
|
|
62
|
-
return out;
|
|
63
|
-
}
|
|
64
|
-
function writeNaN_(out) {
|
|
65
|
-
out[0] = Number.NaN;
|
|
66
|
-
out[1] = Number.NaN;
|
|
67
|
-
out[2] = Number.NaN;
|
|
72
|
+
out[1] = azimuth1;
|
|
73
|
+
out[2] = azimuth2;
|
|
68
74
|
return out;
|
|
69
75
|
}
|
|
70
76
|
/**
|
|
@@ -72,102 +78,170 @@ function writeNaN_(out) {
|
|
|
72
78
|
* `0`, of the geodesic leaving `from` at `azimuthDeg` (degrees clockwise from
|
|
73
79
|
* north) and running `distanceM` metres (negative goes backwards). The
|
|
74
80
|
* longitude is in `[−180, 180]`. A non-finite input, or a latitude beyond ±90°,
|
|
75
|
-
* gives `NaN`s. Runs through a line
|
|
81
|
+
* gives `NaN`s. Runs through a line held in a module-level buffer. O(1).
|
|
82
|
+
*
|
|
83
|
+
* The solver allocates nothing, whether or not the engine inlines its helpers.
|
|
84
|
+
* The only allocation a call can cost is the caller's: an engine that does not
|
|
85
|
+
* inline `geodesicDirect` into its caller boxes the two `number` arguments that
|
|
86
|
+
* are not small integers, two heap numbers per call.
|
|
76
87
|
*/
|
|
77
88
|
export function geodesicDirect(out, from, azimuthDeg, distanceM, ellipsoid) {
|
|
78
|
-
|
|
89
|
+
const longitude1 = from[0];
|
|
90
|
+
const latitude1 = from[1];
|
|
91
|
+
let longitude = Number.NaN;
|
|
92
|
+
let latitude = Number.NaN;
|
|
93
|
+
let height = Number.NaN;
|
|
94
|
+
if (Number.isFinite(longitude1) &&
|
|
95
|
+
Math.abs(latitude1) <= 90 &&
|
|
79
96
|
Number.isFinite(azimuthDeg) &&
|
|
80
|
-
Number.isFinite(distanceM))
|
|
81
|
-
|
|
97
|
+
Number.isFinite(distanceM)) {
|
|
98
|
+
const constants = constantsOf_(ellipsoid);
|
|
99
|
+
startScratch_[START_LATITUDE_] = latitude1;
|
|
100
|
+
startScratch_[START_LONGITUDE_] = longitude1;
|
|
101
|
+
startScratch_[START_AZIMUTH_] = azimuthDeg;
|
|
102
|
+
startScratch_[START_SIN_ALPHA_] = Number.NaN;
|
|
103
|
+
lineInitialize_(directLineScratch_, constants, startScratch_);
|
|
104
|
+
positionScratch_[POSITION_DISTANCE_] = distanceM;
|
|
105
|
+
linePosition_(directLineScratch_, positionScratch_);
|
|
106
|
+
longitude = positionScratch_[POSITION_LONGITUDE_];
|
|
107
|
+
latitude = positionScratch_[POSITION_LATITUDE_];
|
|
108
|
+
height = 0;
|
|
82
109
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
startScratch_[START_SIN_ALPHA_] = Number.NaN;
|
|
87
|
-
lineInitialize_(directLineScratch_, constantsOf_(ellipsoid), startScratch_);
|
|
88
|
-
positionScratch_[POSITION_DISTANCE_] = distanceM;
|
|
89
|
-
linePosition_(directLineScratch_, positionScratch_);
|
|
90
|
-
out[0] = positionScratch_[POSITION_LONGITUDE_];
|
|
91
|
-
out[1] = positionScratch_[POSITION_LATITUDE_];
|
|
92
|
-
out[2] = 0;
|
|
110
|
+
out[0] = longitude;
|
|
111
|
+
out[1] = latitude;
|
|
112
|
+
out[2] = height;
|
|
93
113
|
return out;
|
|
94
114
|
}
|
|
95
115
|
/**
|
|
96
116
|
* Creates the geodesic line leaving `from` at `azimuthDeg`, to query with
|
|
97
117
|
* {@link geodesicLinePosition}, {@link geodesicLineAzimuth} and
|
|
98
118
|
* {@link geodesicLinePositions}. Its length is unknown:
|
|
99
|
-
* {@link geodesicLineDistance} gives `NaN`. Allocates
|
|
100
|
-
* it many times.
|
|
119
|
+
* {@link geodesicLineDistance} gives `NaN`. Allocates the line's record (one
|
|
120
|
+
* `Float64Array`); build it once and query it many times.
|
|
101
121
|
*
|
|
102
122
|
* @throws {RangeError} For a non-finite start or azimuth, or a latitude beyond
|
|
103
123
|
* ±90°.
|
|
104
124
|
*/
|
|
105
125
|
export function geodesicLine(from, azimuthDeg, ellipsoid) {
|
|
106
|
-
|
|
107
|
-
|
|
126
|
+
const longitude1 = from[0];
|
|
127
|
+
const latitude1 = from[1];
|
|
128
|
+
if (!(Number.isFinite(longitude1) &&
|
|
129
|
+
Math.abs(latitude1) <= 90 &&
|
|
130
|
+
Number.isFinite(azimuthDeg))) {
|
|
131
|
+
throw new RangeError(`geodesicLine: the start (${longitude1}, ${latitude1}) and the azimuth ${azimuthDeg} must be finite, with a latitude within ±90°.`);
|
|
108
132
|
}
|
|
133
|
+
const constants = constantsOf_(ellipsoid);
|
|
109
134
|
const line = lineRecordCreate_();
|
|
110
|
-
startScratch_[START_LATITUDE_] =
|
|
111
|
-
startScratch_[START_LONGITUDE_] =
|
|
135
|
+
startScratch_[START_LATITUDE_] = latitude1;
|
|
136
|
+
startScratch_[START_LONGITUDE_] = longitude1;
|
|
112
137
|
startScratch_[START_AZIMUTH_] = azimuthDeg;
|
|
113
138
|
startScratch_[START_SIN_ALPHA_] = Number.NaN;
|
|
114
|
-
lineInitialize_(line,
|
|
115
|
-
return line;
|
|
139
|
+
lineInitialize_(line, constants, startScratch_);
|
|
140
|
+
return line; // a GeodesicLine is the scratch record itself, branded for the public type
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Re-aims `out`, a line made by any `geodesicLine…` builder, as the geodesic
|
|
144
|
+
* leaving `from` at `azimuthDeg` on `ellipsoid`: the line {@link geodesicLine}
|
|
145
|
+
* would build, written over `out`'s record. Its length becomes unknown ({@link
|
|
146
|
+
* geodesicLineDistance} gives `NaN`). For a fan of lines from one point (a
|
|
147
|
+
* horizon, a viewshed) with no record per line. O(1).
|
|
148
|
+
*
|
|
149
|
+
* The solver allocates nothing, whether or not the engine inlines its helpers;
|
|
150
|
+
* an engine that does not inline `geodesicLineSet` into its caller boxes
|
|
151
|
+
* `azimuthDeg` unless it is a small integer, one heap number per call.
|
|
152
|
+
*
|
|
153
|
+
* @throws {RangeError} For a non-finite start or azimuth, or a latitude beyond
|
|
154
|
+
* ±90°; `out` is left as it was.
|
|
155
|
+
*/
|
|
156
|
+
export function geodesicLineSet(out, from, azimuthDeg, ellipsoid) {
|
|
157
|
+
const longitude1 = from[0];
|
|
158
|
+
const latitude1 = from[1];
|
|
159
|
+
if (!(Number.isFinite(longitude1) &&
|
|
160
|
+
Math.abs(latitude1) <= 90 &&
|
|
161
|
+
Number.isFinite(azimuthDeg))) {
|
|
162
|
+
throwLineSetRange_(longitude1, latitude1, azimuthDeg);
|
|
163
|
+
}
|
|
164
|
+
const constants = constantsOf_(ellipsoid);
|
|
165
|
+
startScratch_[START_LATITUDE_] = latitude1;
|
|
166
|
+
startScratch_[START_LONGITUDE_] = longitude1;
|
|
167
|
+
startScratch_[START_AZIMUTH_] = azimuthDeg;
|
|
168
|
+
startScratch_[START_SIN_ALPHA_] = Number.NaN;
|
|
169
|
+
lineInitialize_(out, constants, startScratch_); // a GeodesicLine is the scratch record itself, branded for the public type
|
|
170
|
+
return out;
|
|
171
|
+
}
|
|
172
|
+
// Out of line, so that `geodesicLineSet` stays small enough for an engine to
|
|
173
|
+
// inline into a caller's loop, where its azimuth is not boxed.
|
|
174
|
+
function throwLineSetRange_(longitude, latitude, azimuth) {
|
|
175
|
+
throw new RangeError(`geodesicLineSet: the start (${longitude}, ${latitude}) and the azimuth ${azimuth} must be finite, with a latitude within ±90°.`);
|
|
116
176
|
}
|
|
117
177
|
/**
|
|
118
178
|
* Creates the geodesic joining `from` to `to` (Karney's `InverseLine`), whose
|
|
119
179
|
* length {@link geodesicLineDistance} gives and whose position at that distance
|
|
120
|
-
* is `to`. Allocates.
|
|
180
|
+
* is `to`. Allocates the line's record (one `Float64Array`).
|
|
121
181
|
*
|
|
122
182
|
* @throws {RangeError} For a non-finite position, or a latitude beyond ±90°.
|
|
123
183
|
*/
|
|
124
184
|
export function geodesicLineBetween(from, to, ellipsoid) {
|
|
125
|
-
|
|
126
|
-
|
|
185
|
+
const longitude1 = from[0];
|
|
186
|
+
const latitude1 = from[1];
|
|
187
|
+
const longitude2 = to[0];
|
|
188
|
+
const latitude2 = to[1];
|
|
189
|
+
if (!(Number.isFinite(longitude1) &&
|
|
190
|
+
Math.abs(latitude1) <= 90 &&
|
|
191
|
+
Number.isFinite(longitude2) &&
|
|
192
|
+
Math.abs(latitude2) <= 90)) {
|
|
193
|
+
throw new RangeError(`geodesicLineBetween: both positions must be finite, with a latitude within ±90° (got (${longitude1}, ${latitude1}) and (${longitude2}, ${latitude2})).`);
|
|
127
194
|
}
|
|
128
195
|
const constants = constantsOf_(ellipsoid);
|
|
129
|
-
inverseScratch_[INVERSE_LATITUDE1_] = from[1];
|
|
130
|
-
inverseScratch_[INVERSE_LONGITUDE1_] = from[0];
|
|
131
|
-
inverseScratch_[INVERSE_LATITUDE2_] = to[1];
|
|
132
|
-
inverseScratch_[INVERSE_LONGITUDE2_] = to[0];
|
|
133
|
-
inverse_(constants, inverseScratch_);
|
|
134
196
|
const line = lineRecordCreate_();
|
|
135
|
-
|
|
136
|
-
|
|
197
|
+
inverseScratch_[INVERSE_LATITUDE1_] = latitude1;
|
|
198
|
+
inverseScratch_[INVERSE_LONGITUDE1_] = longitude1;
|
|
199
|
+
inverseScratch_[INVERSE_LATITUDE2_] = latitude2;
|
|
200
|
+
inverseScratch_[INVERSE_LONGITUDE2_] = longitude2;
|
|
201
|
+
inverse_(constants, inverseScratch_);
|
|
202
|
+
startScratch_[START_LATITUDE_] = latitude1;
|
|
203
|
+
startScratch_[START_LONGITUDE_] = longitude1;
|
|
137
204
|
startScratch_[START_SIN_ALPHA_] = inverseScratch_[INVERSE_SIN_ALPHA1_];
|
|
138
205
|
startScratch_[START_COS_ALPHA_] = inverseScratch_[INVERSE_COS_ALPHA1_];
|
|
139
206
|
lineInitialize_(line, constants, startScratch_);
|
|
140
|
-
|
|
141
|
-
return line;
|
|
207
|
+
line[LINE_DISTANCE_] = inverseScratch_[INVERSE_DISTANCE_];
|
|
208
|
+
return line; // a GeodesicLine is the scratch record itself, branded for the public type
|
|
142
209
|
}
|
|
143
210
|
/**
|
|
144
211
|
* The length in metres of a line made by {@link geodesicLineBetween}; `NaN` for
|
|
145
212
|
* one made by {@link geodesicLine}.
|
|
146
213
|
*/
|
|
147
214
|
export function geodesicLineDistance(line) {
|
|
148
|
-
return
|
|
215
|
+
return line[LINE_DISTANCE_]; // a GeodesicLine is the scratch record itself, branded for the public type
|
|
149
216
|
}
|
|
150
217
|
/**
|
|
151
218
|
* Writes the position, at height `0`, `distanceM` metres along `line` (negative
|
|
152
|
-
* goes backwards) into `out`. A non-finite distance gives `NaN`s.
|
|
153
|
-
*
|
|
219
|
+
* goes backwards) into `out`. A non-finite distance gives `NaN`s. O(1).
|
|
220
|
+
*
|
|
221
|
+
* The solver allocates nothing, whether or not the engine inlines its helpers;
|
|
222
|
+
* an engine that does not inline `geodesicLinePosition` into its caller boxes
|
|
223
|
+
* `distanceM` unless it is a small integer, one heap number per call.
|
|
154
224
|
*/
|
|
155
225
|
export function geodesicLinePosition(out, line, distanceM) {
|
|
156
226
|
positionScratch_[POSITION_DISTANCE_] = distanceM;
|
|
157
|
-
linePosition_(line, positionScratch_);
|
|
158
|
-
|
|
159
|
-
|
|
227
|
+
linePosition_(line, positionScratch_); // a GeodesicLine is the scratch record itself, branded for the public type
|
|
228
|
+
const longitude = positionScratch_[POSITION_LONGITUDE_];
|
|
229
|
+
const latitude = positionScratch_[POSITION_LATITUDE_];
|
|
230
|
+
out[0] = longitude;
|
|
231
|
+
out[1] = latitude;
|
|
160
232
|
// Height 0, or NaN with the rest when the distance was not finite.
|
|
161
|
-
out[2] = Number.isFinite(
|
|
233
|
+
out[2] = Number.isFinite(longitude + latitude) ? 0 : Number.NaN;
|
|
162
234
|
return out;
|
|
163
235
|
}
|
|
164
236
|
/**
|
|
165
237
|
* The azimuth in degrees, clockwise from north in `(−180, 180]`, of `line`
|
|
166
|
-
* `distanceM` metres along it. A non-finite distance gives `NaN`. O(1).
|
|
238
|
+
* `distanceM` metres along it. A non-finite distance gives `NaN`. O(1). The
|
|
239
|
+
* solver allocates nothing; a caller that does not inline this function boxes a
|
|
240
|
+
* fractional `distanceM` and the returned azimuth, a heap number each.
|
|
167
241
|
*/
|
|
168
242
|
export function geodesicLineAzimuth(line, distanceM) {
|
|
169
243
|
positionScratch_[POSITION_DISTANCE_] = distanceM;
|
|
170
|
-
linePosition_(line, positionScratch_);
|
|
244
|
+
linePosition_(line, positionScratch_); // a GeodesicLine is the scratch record itself, branded for the public type
|
|
171
245
|
return positionScratch_[POSITION_AZIMUTH_];
|
|
172
246
|
}
|
|
173
247
|
/**
|
|
@@ -175,22 +249,31 @@ export function geodesicLineAzimuth(line, distanceM) {
|
|
|
175
249
|
* as geodetic triples `[longitudeDeg, latitudeDeg, 0, …]`: ready for the
|
|
176
250
|
* caller's heights and `ecefArrayFromGeodetic`, with no copy. O(n).
|
|
177
251
|
*
|
|
252
|
+
* `distancesM` may share memory with `out` (a view into it, say), whatever its
|
|
253
|
+
* class. Allocates nothing, whatever the engine inlines.
|
|
254
|
+
*
|
|
178
255
|
* @throws {RangeError} Unless `out` holds three numbers per distance.
|
|
179
256
|
*/
|
|
180
257
|
export function geodesicLinePositions(out, line, distancesM) {
|
|
181
|
-
|
|
182
|
-
|
|
258
|
+
const count = typedArrayLength_.call(distancesM);
|
|
259
|
+
if (typedArrayLength_.call(out) !== count * 3) {
|
|
260
|
+
throw new RangeError(`geodesicLinePositions: out must hold 3 numbers per distance (expected ${count * 3}, got ${typedArrayLength_.call(out)}).`);
|
|
183
261
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
262
|
+
// The distances are staged at the start of `out` by the intrinsic `set`,
|
|
263
|
+
// which copies correctly whatever the two views share and which no
|
|
264
|
+
// subclass or species can redirect; the positions are then written from the
|
|
265
|
+
// last, each over its own distance and later ones already read.
|
|
266
|
+
typedArraySet_.call(out, distancesM, 0);
|
|
267
|
+
const record = line; // a GeodesicLine is the scratch record itself, branded for the public type
|
|
268
|
+
for (let index = count - 1; index >= 0; index--) {
|
|
269
|
+
positionScratch_[POSITION_DISTANCE_] = out[index];
|
|
187
270
|
linePosition_(record, positionScratch_);
|
|
271
|
+
const longitude = positionScratch_[POSITION_LONGITUDE_];
|
|
272
|
+
const latitude = positionScratch_[POSITION_LATITUDE_];
|
|
188
273
|
const base = index * 3;
|
|
189
|
-
out[base] =
|
|
190
|
-
out[base + 1] =
|
|
191
|
-
out[base + 2] = Number.isFinite(
|
|
192
|
-
? 0
|
|
193
|
-
: Number.NaN;
|
|
274
|
+
out[base] = longitude;
|
|
275
|
+
out[base + 1] = latitude;
|
|
276
|
+
out[base + 2] = Number.isFinite(longitude + latitude) ? 0 : Number.NaN;
|
|
194
277
|
}
|
|
195
278
|
return out;
|
|
196
279
|
}
|