@ac-kit/math-geodesy 0.1.1 → 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 +49 -0
- package/README.md +47 -0
- 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.d.ts +15 -0
- package/dist/geodesic.d.ts.map +1 -1
- package/dist/geodesic.js +35 -0
- package/dist/geodesic.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/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 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @ac-kit/math-geodesy
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5c203e7: `geodesicLineSet(out, from, azimuthDeg, ellipsoid)` re-aims an existing
|
|
8
|
+
geodesic line in place, as `geodesicLine` would build it: a fan of lines from
|
|
9
|
+
one point (a horizon profile, a viewshed) needs no record per line. It throws
|
|
10
|
+
`RangeError` for the inputs `geodesicLine` rejects, leaving the line as it was,
|
|
11
|
+
and allocates nothing.
|
|
12
|
+
- 5c203e7: Earth curvature, the horizon and terrestrial refraction, for horizon profiles
|
|
13
|
+
and sightlines. `curvatureDrop(distance, radius, k?)` is how far the
|
|
14
|
+
horizontal plane passes above the surface at a distance;
|
|
15
|
+
`horizonDistance(height, radius, k?)` and `horizonDip` give the surface
|
|
16
|
+
distance to the horizon and its dip in degrees; `hiddenHeight(distance,
|
|
17
|
+
eyeHeight, radius, k?)` the height of a far object the horizon hides. Each
|
|
18
|
+
takes a refraction coefficient `k` (default `0`) on the effective Earth of
|
|
19
|
+
curvature `(1 − k)/R`, finite at `k = 1` and beyond (ducting).
|
|
20
|
+
`refractionCurvature(conditions?)` and `refractionCoefficient(conditions?,
|
|
21
|
+
radius?)` derive the ray curvature and `k` from the temperature, station
|
|
22
|
+
pressure, temperature gradient and wavelength (ISA defaults: `k ≈ 0.170`);
|
|
23
|
+
`refractionAngle(distance, radius, k)` is how far refraction raises a point,
|
|
24
|
+
in degrees; `REFRACTION_COEFFICIENT_GAUSS` is `0.13`.
|
|
25
|
+
`ellipsoidNormalSectionRadius(ellipsoid, latitude, azimuth)`,
|
|
26
|
+
`ellipsoidGaussianRadius` and `ellipsoidMeanRadius` give the radius to apply
|
|
27
|
+
them on. Out-of-domain arguments give `NaN`; the per-sample functions allocate
|
|
28
|
+
nothing once inlined.
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [5c203e7]
|
|
33
|
+
- Updated dependencies [5c203e7]
|
|
34
|
+
- Updated dependencies [5c203e7]
|
|
35
|
+
- Updated dependencies [5c203e7]
|
|
36
|
+
- Updated dependencies [5c203e7]
|
|
37
|
+
- Updated dependencies [5c203e7]
|
|
38
|
+
- Updated dependencies [5c203e7]
|
|
39
|
+
- Updated dependencies [5c203e7]
|
|
40
|
+
- Updated dependencies [5c203e7]
|
|
41
|
+
- Updated dependencies [5c203e7]
|
|
42
|
+
- Updated dependencies [5c203e7]
|
|
43
|
+
- Updated dependencies [5c203e7]
|
|
44
|
+
- Updated dependencies [5c203e7]
|
|
45
|
+
- Updated dependencies [5c203e7]
|
|
46
|
+
- Updated dependencies [5c203e7]
|
|
47
|
+
- @ac-kit/core@0.14.0
|
|
48
|
+
- @ac-kit/math-geometry@0.5.0
|
|
49
|
+
- @ac-kit/math-linear@0.5.0
|
|
50
|
+
- @ac-kit/math-scalar@0.5.0
|
|
51
|
+
|
|
3
52
|
## 0.1.1
|
|
4
53
|
|
|
5
54
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -29,6 +29,12 @@ geodesicInverse(
|
|
|
29
29
|
| `Ellipsoid`, `ellipsoidCreate(a, f)`, `ellipsoidSphere(radius)` | A frozen parameter record, made once; `0 ≤ f < 1`, throws `RangeError` |
|
|
30
30
|
| `ELLIPSOID_WGS84`, `ELLIPSOID_GRS80` | The two usual ones |
|
|
31
31
|
| `ellipsoidMeridionalRadius`, `ellipsoidPrimeVerticalRadius` | Radii of curvature `M` and `N` at a latitude |
|
|
32
|
+
| `ellipsoidNormalSectionRadius(e, latitude, azimuth)`, `ellipsoidGaussianRadius`, `ellipsoidMeanRadius` | The radius a sightline sees in one direction (Euler), `√(MN)`, IUGG `R₁` |
|
|
33
|
+
| `curvatureDrop(distance, radius, k?)` | How far the horizontal plane passes above the surface at a distance |
|
|
34
|
+
| `horizonDistance(height, radius, k?)`, `horizonDip(height, radius, k?)` | Surface distance to the horizon and its dip below the horizontal, degrees |
|
|
35
|
+
| `hiddenHeight(distance, eyeHeight, radius, k?)` | The height of a far object the horizon hides |
|
|
36
|
+
| `refractionCurvature(conditions?)`, `refractionCoefficient(conditions?, radius?)` | Ray curvature and terrestrial refraction coefficient `k` from temperature, pressure, lapse rate and wavelength |
|
|
37
|
+
| `refractionAngle(distance, radius, k)`, `REFRACTION_COEFFICIENT_GAUSS` | How far refraction raises a point, degrees; Gauss's `k = 0.13` |
|
|
32
38
|
| `Geodetic`, `geodeticOf`, `geodeticCreate`, … | `[longitudeDeg, latitudeDeg, heightM]`, a branded value with the usual family |
|
|
33
39
|
| `ecefFromGeodetic`, `geodeticFromEcef` | Geodetic ↔ Earth-centred metres, closed forms |
|
|
34
40
|
| `ecefArrayFromGeodetic`, `geodeticArrayFromEcef` | The same over a `Float64Array` of triples, in place allowed |
|
|
@@ -36,14 +42,55 @@ geodesicInverse(
|
|
|
36
42
|
| `geodesicInverse(out, from, to, ellipsoid)` | Distance and both azimuths between two positions |
|
|
37
43
|
| `geodesicDirect(out, from, azimuthDeg, distanceM, ellipsoid)` | The end point of a geodesic |
|
|
38
44
|
| `geodesicLine`, `geodesicLineBetween`, `geodesicLinePosition`, `…Azimuth`, `…Distance`, `…Positions` | A line built once, queried many times (a horizon of 600 samples is one call) |
|
|
45
|
+
| `geodesicLineSet(out, from, azimuthDeg, ellipsoid)` | Re-aims an existing line in place: a fan of lines from one point, no record per line |
|
|
39
46
|
|
|
40
47
|
Heights are ignored by the geodesic functions (geodesics lie on the
|
|
41
48
|
ellipsoid). Azimuths are degrees clockwise from north in `(−180, 180]`;
|
|
42
49
|
coincident points give a distance of `0` and `NaN` azimuths; a non-finite
|
|
43
50
|
argument, or a latitude beyond ±90°, gives `NaN`.
|
|
44
51
|
|
|
52
|
+
## Curvature, horizon and refraction
|
|
53
|
+
|
|
54
|
+
A sightline over the Earth is drawn on a sphere of a radius the caller picks:
|
|
55
|
+
`ellipsoidNormalSectionRadius` in the sightline's direction for a horizon
|
|
56
|
+
profile, `ellipsoidGaussianRadius` around one point, `ellipsoidMeanRadius` for
|
|
57
|
+
the Earth as a whole. Refraction bends a near-horizontal ray by `κ`, the
|
|
58
|
+
coefficient `k = κR` of that radius, and the functions take `k` (default `0`,
|
|
59
|
+
the bare geometry) on the effective Earth of curvature `(1 − k)/R`: at `k = 1`
|
|
60
|
+
the sea looks flat, beyond it ducting makes the surface loom.
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
import {
|
|
64
|
+
curvatureDrop,
|
|
65
|
+
ELLIPSOID_WGS84,
|
|
66
|
+
ellipsoidNormalSectionRadius,
|
|
67
|
+
hiddenHeight,
|
|
68
|
+
refractionAngle,
|
|
69
|
+
refractionCoefficient,
|
|
70
|
+
} from "@ac-kit/math-geodesy";
|
|
71
|
+
|
|
72
|
+
const radius = ellipsoidNormalSectionRadius(ELLIPSOID_WGS84, 45.8, 120);
|
|
73
|
+
const k = refractionCoefficient(
|
|
74
|
+
{ temperatureC: 4, pressureHpa: 940, temperatureGradientKPerM: -0.004 },
|
|
75
|
+
radius,
|
|
76
|
+
); // ≈ 0.186
|
|
77
|
+
curvatureDrop(20000, radius, k); // ≈ 25.5 m below the horizontal plane
|
|
78
|
+
hiddenHeight(20000, 2, radius, k); // ≈ 13.2 m hidden for an eye at 2 m
|
|
79
|
+
refractionAngle(20000, radius, k); // ≈ 0.0167°, to add to a geometric elevation
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`refractionCurvature` takes dry air as an ideal gas in hydrostatic balance:
|
|
83
|
+
`κ = K(λ)·P/T²·(g/R_d + dT/dh)/n`, with Birch and Downs' Edlén dispersion for
|
|
84
|
+
`K(λ)`. The lapse rate `dT/dh` dominates; the ISA defaults give `k ≈ 0.170`
|
|
85
|
+
(Hirt et al.'s `503·P/T²·(0.0343 + dT/dh)` agrees within its own rounding).
|
|
86
|
+
|
|
45
87
|
## Accuracy
|
|
46
88
|
|
|
89
|
+
- Curvature and horizon: exact on the effective sphere, and stable for short
|
|
90
|
+
distances and low eyes (a drop of `s²/2R` keeps full precision at 1 µm). The
|
|
91
|
+
effective Earth itself is exact to first order: against a ray traced through
|
|
92
|
+
a constant index gradient, its drop errs by about `k/(1 − k)·h/R` relative
|
|
93
|
+
(6e−6 at 900 m for `k = 0.17`) and the refraction angle by `0.2 h/R`.
|
|
47
94
|
- Geodesics: within 15 nanometres on WGS 84 (GeographicLib's published bound),
|
|
48
95
|
checked on the whole of Karney's GeodTest set (`yarn test:geodtest`: 500 000
|
|
49
96
|
lines, worst 11 nm, never worse than `geographiclib-geodesic`), including
|
package/dist/ellipsoid.d.ts
CHANGED
|
@@ -49,4 +49,25 @@ export declare function ellipsoidMeridionalRadius(ellipsoid: Ellipsoid, latitude
|
|
|
49
49
|
* finite gives `NaN`.
|
|
50
50
|
*/
|
|
51
51
|
export declare function ellipsoidPrimeVerticalRadius(ellipsoid: Ellipsoid, latitudeDeg: number): number;
|
|
52
|
+
/**
|
|
53
|
+
* The radius of curvature of the normal section at the geodetic latitude in the
|
|
54
|
+
* direction `azimuthDeg` (degrees clockwise from north), metres: Euler's `1/R_α
|
|
55
|
+
* = cos²α / M + sin²α / N`, so `M` along the meridian and `N` east–west. It is
|
|
56
|
+
* the radius a sightline leaving the point in that direction sees the ellipsoid
|
|
57
|
+
* curve with. A latitude beyond ±90°, or an argument that is not finite, gives
|
|
58
|
+
* `NaN`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function ellipsoidNormalSectionRadius(ellipsoid: Ellipsoid, latitudeDeg: number, azimuthDeg: number): number;
|
|
61
|
+
/**
|
|
62
|
+
* The Gaussian mean radius of curvature `√(MN)` at the geodetic latitude,
|
|
63
|
+
* metres, evaluated as `a(1 − f) / w²` (see {@link ellipsoidMeridionalRadius}):
|
|
64
|
+
* the radius of the sphere that best fits the ellipsoid around the point, in no
|
|
65
|
+
* particular direction. A latitude beyond ±90° or not finite gives `NaN`.
|
|
66
|
+
*/
|
|
67
|
+
export declare function ellipsoidGaussianRadius(ellipsoid: Ellipsoid, latitudeDeg: number): number;
|
|
68
|
+
/**
|
|
69
|
+
* The IUGG mean radius `R₁ = (2a + b) / 3`, metres: 6 371 008.771 m for WGS 84,
|
|
70
|
+
* the radius of a global spherical Earth.
|
|
71
|
+
*/
|
|
72
|
+
export declare function ellipsoidMeanRadius(ellipsoid: Ellipsoid): number;
|
|
52
73
|
//# sourceMappingURL=ellipsoid.d.ts.map
|
package/dist/ellipsoid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ellipsoid.d.ts","sourceRoot":"","sources":["../src/ellipsoid.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ellipsoid.d.ts","sourceRoot":"","sources":["../src/ellipsoid.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,E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;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAEhE"}
|
package/dist/ellipsoid.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { describeValue, isFinitePositive } from "@ac-kit/core";
|
|
2
|
-
import { cosDeg } from "@ac-kit/math-scalar";
|
|
2
|
+
import { cosDeg, sinCosDegInPlace } from "@ac-kit/math-scalar";
|
|
3
3
|
import { CONSTANTS_KEY_, constantsCreate_ } from "./geodesic/_constants.js";
|
|
4
|
+
/**
|
|
5
|
+
* `[latitude → sin, cos, azimuth → sin, cos]` for
|
|
6
|
+
* {@link ellipsoidNormalSectionRadius}.
|
|
7
|
+
*/
|
|
8
|
+
const angleRegisters_ = new Float64Array(4);
|
|
4
9
|
/**
|
|
5
10
|
* Creates the ellipsoid of equatorial radius `semiMajorAxisM` metres and
|
|
6
11
|
* flattening `flattening` (`1 / 298.257223563` for WGS 84), computing the
|
|
@@ -64,6 +69,57 @@ export function ellipsoidPrimeVerticalRadius(ellipsoid, latitudeDeg) {
|
|
|
64
69
|
const w = curvatureDenominator_(ellipsoid, polarRatio * polarRatio, latitudeDeg);
|
|
65
70
|
return ellipsoid.semiMajorAxisM / w;
|
|
66
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* The radius of curvature of the normal section at the geodetic latitude in the
|
|
74
|
+
* direction `azimuthDeg` (degrees clockwise from north), metres: Euler's `1/R_α
|
|
75
|
+
* = cos²α / M + sin²α / N`, so `M` along the meridian and `N` east–west. It is
|
|
76
|
+
* the radius a sightline leaving the point in that direction sees the ellipsoid
|
|
77
|
+
* curve with. A latitude beyond ±90°, or an argument that is not finite, gives
|
|
78
|
+
* `NaN`.
|
|
79
|
+
*/
|
|
80
|
+
export function ellipsoidNormalSectionRadius(ellipsoid, latitudeDeg, azimuthDeg) {
|
|
81
|
+
// Every field is read before the registers are used, so a getter that
|
|
82
|
+
// re-enters this function cannot clobber them.
|
|
83
|
+
const semiMajorAxis = ellipsoid.semiMajorAxisM;
|
|
84
|
+
const eccentricitySquared = ellipsoid.eccentricitySquared;
|
|
85
|
+
const polarRatio = 1 - ellipsoid.flattening;
|
|
86
|
+
const polarRatioSquared = polarRatio * polarRatio;
|
|
87
|
+
if (!(Math.abs(latitudeDeg) <= 90)) {
|
|
88
|
+
return Number.NaN;
|
|
89
|
+
}
|
|
90
|
+
// The angles go through a buffer: sinDeg and cosDeg take and return
|
|
91
|
+
// doubles, which V8 boxes whenever it does not inline them.
|
|
92
|
+
angleRegisters_[0] = latitudeDeg;
|
|
93
|
+
angleRegisters_[2] = azimuthDeg;
|
|
94
|
+
sinCosDegInPlace(angleRegisters_, 0);
|
|
95
|
+
sinCosDegInPlace(angleRegisters_, 2);
|
|
96
|
+
const latitudeCosine = angleRegisters_[1];
|
|
97
|
+
const sine = angleRegisters_[2];
|
|
98
|
+
const cosine = angleRegisters_[3];
|
|
99
|
+
const wSquared = polarRatioSquared + eccentricitySquared * (latitudeCosine * latitudeCosine);
|
|
100
|
+
// a / R_α = w (w² cos²α / (1 − f)² + sin²α), from M = a(1 − f)²/w³, N = a/w.
|
|
101
|
+
const scale = Math.sqrt(wSquared) *
|
|
102
|
+
((wSquared / polarRatioSquared) * (cosine * cosine) + sine * sine);
|
|
103
|
+
return semiMajorAxis / scale;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The Gaussian mean radius of curvature `√(MN)` at the geodetic latitude,
|
|
107
|
+
* metres, evaluated as `a(1 − f) / w²` (see {@link ellipsoidMeridionalRadius}):
|
|
108
|
+
* the radius of the sphere that best fits the ellipsoid around the point, in no
|
|
109
|
+
* particular direction. A latitude beyond ±90° or not finite gives `NaN`.
|
|
110
|
+
*/
|
|
111
|
+
export function ellipsoidGaussianRadius(ellipsoid, latitudeDeg) {
|
|
112
|
+
const polarRatio = 1 - ellipsoid.flattening;
|
|
113
|
+
const w = curvatureDenominator_(ellipsoid, polarRatio * polarRatio, latitudeDeg);
|
|
114
|
+
return (ellipsoid.semiMajorAxisM * polarRatio) / (w * w);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The IUGG mean radius `R₁ = (2a + b) / 3`, metres: 6 371 008.771 m for WGS 84,
|
|
118
|
+
* the radius of a global spherical Earth.
|
|
119
|
+
*/
|
|
120
|
+
export function ellipsoidMeanRadius(ellipsoid) {
|
|
121
|
+
return (2 * ellipsoid.semiMajorAxisM + ellipsoid.semiMinorAxisM) / 3;
|
|
122
|
+
}
|
|
67
123
|
/** `w = √((1 − f)² + e² cos²φ)`, `NaN` beyond ±90°. */
|
|
68
124
|
function curvatureDenominator_(ellipsoid, polarRatioSquared, latitudeDeg) {
|
|
69
125
|
if (!(Math.abs(latitudeDeg) <= 90)) {
|
package/dist/ellipsoid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ellipsoid.js","sourceRoot":"","sources":["../src/ellipsoid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ellipsoid.js","sourceRoot":"","sources":["../src/ellipsoid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5E;;;GAGG;AACH,MAAM,eAAe,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAuB5C;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC9B,cAAsB,EACtB,UAAkB;IAElB,IAAI,CAAC,gBAAgB,CAAC,cAAc,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,UAAU,CACnB,oEAAoE,aAAa,CAAC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,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC,IAAI,CACf,iBAAiB,GAAG,SAAS,CAAC,mBAAmB,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,CACrE,CAAC;AACH,CAAC"}
|
package/dist/geodesic.d.ts
CHANGED
|
@@ -53,6 +53,21 @@ export declare function geodesicDirect(out: Geodetic, from: ReadonlyGeodetic, az
|
|
|
53
53
|
* ±90°.
|
|
54
54
|
*/
|
|
55
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;
|
|
56
71
|
/**
|
|
57
72
|
* Creates the geodesic joining `from` to `to` (Karney's `InverseLine`), whose
|
|
58
73
|
* length {@link geodesicLineDistance} gives and whose position at that distance
|
package/dist/geodesic.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geodesic.d.ts","sourceRoot":"","sources":["../src/geodesic.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AClB,SAAS,EAAE,SAAS,GAClB,YAAY,CAmBd;AAcD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,gBAAgB,EACtB,EAAE,EAAE,gBAAgB,EACpB,SAAS,EAAE,SAAS,GAClB,YAAY,CA+Bd;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,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
|
@@ -139,6 +139,41 @@ export function geodesicLine(from, azimuthDeg, ellipsoid) {
|
|
|
139
139
|
lineInitialize_(line, constants, startScratch_);
|
|
140
140
|
return line; // a GeodesicLine is the scratch record itself, branded for the public type
|
|
141
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°.`);
|
|
176
|
+
}
|
|
142
177
|
/**
|
|
143
178
|
* Creates the geodesic joining `from` to `to` (Karney's `InverseLine`), whose
|
|
144
179
|
* length {@link geodesicLineDistance} gives and whose position at that distance
|
package/dist/geodesic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geodesic.js","sourceRoot":"","sources":["../src/geodesic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAiB,c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G,CAAC,KAAK,KAAK,GAAG,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,UAAU,CACnB,yEAAyE,KAAK,GAAG,CAAC,SAAS,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAC1H,CAAC;IACH,CAAC;IACD,yEAAyE;IACzE,mEAAmE;IACnE,4EAA4E;IAC5E,gEAAgE;IAChE,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAA2B,CAAC,CAAC,2EAA2E;IACvH,KAAK,IAAI,KAAK,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QACjD,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC,KAAK,CAAE,CAAC;QACnD,aAAa,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;QACxC,MAAM,SAAS,GAAG,gBAAgB,CAAC,mBAAmB,CAAE,CAAC;QACzD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,kBAAkB,CAAE,CAAC;QACvD,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC,CAAC;QACvB,GAAG,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;QACtB,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;QACzB,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IACxE,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The curvature drop at the surface distance `distanceM`, metres: how far the
|
|
3
|
+
* horizontal plane of an observer standing on a sphere of radius `radiusM`
|
|
4
|
+
* passes above the surface there, measured along the vertical of the far point.
|
|
5
|
+
* It is `R(sec(s/R) − 1)`, about `s²/2R` (7.85 m at 10 km on the mean Earth
|
|
6
|
+
* radius); a refraction coefficient `k` replaces `R` with the effective radius
|
|
7
|
+
* `R/(1 − k)`, so the default `0` is the bare geometry and `0.13` takes 13 %
|
|
8
|
+
* off. At `k = 1` the drop is `0`; above, the surface looms and the drop is
|
|
9
|
+
* negative.
|
|
10
|
+
*
|
|
11
|
+
* For an eye at height `h` the horizontal plane passes `h·sec(s/R)` higher, and
|
|
12
|
+
* the height hidden behind the horizon is {@link hiddenHeight}.
|
|
13
|
+
*
|
|
14
|
+
* Evaluated as `2 sin²(θ/2) / (c·cos θ)` with `θ = c·s`, so short distances
|
|
15
|
+
* keep full precision. A central angle of 90° or more gives `Infinity` (or
|
|
16
|
+
* `−Infinity` when `k > 1`): the plane no longer meets the far vertical. A
|
|
17
|
+
* negative or non-finite distance, a radius that is not finite and positive or
|
|
18
|
+
* a coefficient that is not finite gives `NaN`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function curvatureDrop(distanceM: number, radiusM: number, refractionCoefficient?: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* The surface distance, metres, from the foot of an eye `heightM` above a
|
|
23
|
+
* sphere of radius `radiusM` to its horizon, the point where its sightline
|
|
24
|
+
* grazes the surface: `R·acos(R/(R + h))`, about `√(2Rh)` (3.57 km for an eye
|
|
25
|
+
* at 1 m on the mean Earth radius). A refraction coefficient `k` replaces `R`
|
|
26
|
+
* with `R/(1 − k)` and pushes the horizon out; from `k = 1` on, nothing bounds
|
|
27
|
+
* the view and the distance is `Infinity`.
|
|
28
|
+
*
|
|
29
|
+
* Evaluated as `atan(√(x(2 + x))) / c` with `x = h·c`, accurate from a
|
|
30
|
+
* millimetre to orbital heights. A height of `0` gives `0` (when `k < 1`); a
|
|
31
|
+
* negative or non-finite height, a radius that is not finite and positive or a
|
|
32
|
+
* coefficient that is not finite gives `NaN`.
|
|
33
|
+
*
|
|
34
|
+
* @see {@link horizonDip}
|
|
35
|
+
*/
|
|
36
|
+
export declare function horizonDistance(heightM: number, radiusM: number, refractionCoefficient?: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* The dip of the horizon, degrees: how far below the horizontal an eye
|
|
39
|
+
* `heightM` above a sphere of radius `radiusM` sees its horizon, `acos(R/(R +
|
|
40
|
+
* h))`, about `√(2h/R)` (1.93′ for an eye at 1 m on the mean Earth radius,
|
|
41
|
+
* 1.76′ with `k = 0.17`). A refraction coefficient `k` replaces `R` with `R/(1
|
|
42
|
+
* − k)` and raises the horizon; at `k = 1` the dip is `0`. Above, the effective
|
|
43
|
+
* Earth is concave, no sightline grazes it and the dip is `NaN`.
|
|
44
|
+
*
|
|
45
|
+
* A height of `0` gives `0`; a negative or non-finite height, a radius that is
|
|
46
|
+
* not finite and positive or a coefficient that is not finite gives `NaN`. The
|
|
47
|
+
* dip in radians times the effective radius is {@link horizonDistance}.
|
|
48
|
+
*/
|
|
49
|
+
export declare function horizonDip(heightM: number, radiusM: number, refractionCoefficient?: number): number;
|
|
50
|
+
/**
|
|
51
|
+
* The height, metres, of the bottom of an object at the surface distance
|
|
52
|
+
* `distanceM` that the horizon hides from an eye `observerHeightM` above a
|
|
53
|
+
* sphere of radius `radiusM`: `0` up to the {@link horizonDistance}, then the
|
|
54
|
+
* {@link curvatureDrop} of the distance beyond it (the eye's grazing sightline
|
|
55
|
+
* is the horizontal plane of the horizon point). A target is in view above that
|
|
56
|
+
* height. A refraction coefficient `k` uses the effective radius `R/(1 − k)`;
|
|
57
|
+
* from `k = 1` on nothing is hidden.
|
|
58
|
+
*
|
|
59
|
+
* A negative or non-finite distance or height, a radius that is not finite and
|
|
60
|
+
* positive or a coefficient that is not finite gives `NaN`.
|
|
61
|
+
*/
|
|
62
|
+
export declare function hiddenHeight(distanceM: number, observerHeightM: number, radiusM: number, refractionCoefficient?: number): number;
|
|
63
|
+
//# sourceMappingURL=horizon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"horizon.d.ts","sourceRoot":"","sources":["../src/horizon.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAC5B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,qBAAqB,SAAI,GACvB,MAAM,CAkBR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,qBAAqB,SAAI,GACvB,MAAM,CAaR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,qBAAqB,SAAI,GACvB,MAAM,CAaR;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAC3B,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,qBAAqB,SAAI,GACvB,MAAM,CAiBR"}
|
package/dist/horizon.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { HALF_PI, RAD_TO_DEG } from "@ac-kit/math-scalar";
|
|
2
|
+
// Every function works on the effective Earth: a sightline bent by a
|
|
3
|
+
// refraction coefficient k over a sphere of radius R is a straight line over a
|
|
4
|
+
// sphere of curvature c = (1 − k) / R. Working in c rather than in the
|
|
5
|
+
// effective radius R / (1 − k) keeps k = 1 (a flat effective Earth) and k > 1
|
|
6
|
+
// (ducting, a concave one) finite.
|
|
7
|
+
/** `(1 − k) / R`, or `NaN` for a radius or coefficient out of domain. */
|
|
8
|
+
function effectiveCurvature_(radiusM, refractionCoefficient) {
|
|
9
|
+
if (!(radiusM > 0) ||
|
|
10
|
+
radiusM === Number.POSITIVE_INFINITY ||
|
|
11
|
+
!Number.isFinite(refractionCoefficient)) {
|
|
12
|
+
return Number.NaN;
|
|
13
|
+
}
|
|
14
|
+
return (1 - refractionCoefficient) / radiusM;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The curvature drop at the surface distance `distanceM`, metres: how far the
|
|
18
|
+
* horizontal plane of an observer standing on a sphere of radius `radiusM`
|
|
19
|
+
* passes above the surface there, measured along the vertical of the far point.
|
|
20
|
+
* It is `R(sec(s/R) − 1)`, about `s²/2R` (7.85 m at 10 km on the mean Earth
|
|
21
|
+
* radius); a refraction coefficient `k` replaces `R` with the effective radius
|
|
22
|
+
* `R/(1 − k)`, so the default `0` is the bare geometry and `0.13` takes 13 %
|
|
23
|
+
* off. At `k = 1` the drop is `0`; above, the surface looms and the drop is
|
|
24
|
+
* negative.
|
|
25
|
+
*
|
|
26
|
+
* For an eye at height `h` the horizontal plane passes `h·sec(s/R)` higher, and
|
|
27
|
+
* the height hidden behind the horizon is {@link hiddenHeight}.
|
|
28
|
+
*
|
|
29
|
+
* Evaluated as `2 sin²(θ/2) / (c·cos θ)` with `θ = c·s`, so short distances
|
|
30
|
+
* keep full precision. A central angle of 90° or more gives `Infinity` (or
|
|
31
|
+
* `−Infinity` when `k > 1`): the plane no longer meets the far vertical. A
|
|
32
|
+
* negative or non-finite distance, a radius that is not finite and positive or
|
|
33
|
+
* a coefficient that is not finite gives `NaN`.
|
|
34
|
+
*/
|
|
35
|
+
export function curvatureDrop(distanceM, radiusM, refractionCoefficient = 0) {
|
|
36
|
+
const curvature = effectiveCurvature_(radiusM, refractionCoefficient);
|
|
37
|
+
if (!(distanceM >= 0) ||
|
|
38
|
+
distanceM === Number.POSITIVE_INFINITY ||
|
|
39
|
+
curvature !== curvature) {
|
|
40
|
+
return Number.NaN;
|
|
41
|
+
}
|
|
42
|
+
if (curvature === 0) {
|
|
43
|
+
return 0;
|
|
44
|
+
}
|
|
45
|
+
const angle = curvature * distanceM;
|
|
46
|
+
if (Math.abs(angle) >= HALF_PI) {
|
|
47
|
+
return curvature > 0 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
|
|
48
|
+
}
|
|
49
|
+
const halfSine = Math.sin(angle / 2);
|
|
50
|
+
return (2 * halfSine * halfSine) / (curvature * Math.cos(angle));
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The surface distance, metres, from the foot of an eye `heightM` above a
|
|
54
|
+
* sphere of radius `radiusM` to its horizon, the point where its sightline
|
|
55
|
+
* grazes the surface: `R·acos(R/(R + h))`, about `√(2Rh)` (3.57 km for an eye
|
|
56
|
+
* at 1 m on the mean Earth radius). A refraction coefficient `k` replaces `R`
|
|
57
|
+
* with `R/(1 − k)` and pushes the horizon out; from `k = 1` on, nothing bounds
|
|
58
|
+
* the view and the distance is `Infinity`.
|
|
59
|
+
*
|
|
60
|
+
* Evaluated as `atan(√(x(2 + x))) / c` with `x = h·c`, accurate from a
|
|
61
|
+
* millimetre to orbital heights. A height of `0` gives `0` (when `k < 1`); a
|
|
62
|
+
* negative or non-finite height, a radius that is not finite and positive or a
|
|
63
|
+
* coefficient that is not finite gives `NaN`.
|
|
64
|
+
*
|
|
65
|
+
* @see {@link horizonDip}
|
|
66
|
+
*/
|
|
67
|
+
export function horizonDistance(heightM, radiusM, refractionCoefficient = 0) {
|
|
68
|
+
const curvature = effectiveCurvature_(radiusM, refractionCoefficient);
|
|
69
|
+
if (!(heightM >= 0) ||
|
|
70
|
+
heightM === Number.POSITIVE_INFINITY ||
|
|
71
|
+
curvature !== curvature) {
|
|
72
|
+
return Number.NaN;
|
|
73
|
+
}
|
|
74
|
+
if (curvature <= 0) {
|
|
75
|
+
return Number.POSITIVE_INFINITY;
|
|
76
|
+
}
|
|
77
|
+
return horizonAngle_(heightM * curvature) / curvature;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The dip of the horizon, degrees: how far below the horizontal an eye
|
|
81
|
+
* `heightM` above a sphere of radius `radiusM` sees its horizon, `acos(R/(R +
|
|
82
|
+
* h))`, about `√(2h/R)` (1.93′ for an eye at 1 m on the mean Earth radius,
|
|
83
|
+
* 1.76′ with `k = 0.17`). A refraction coefficient `k` replaces `R` with `R/(1
|
|
84
|
+
* − k)` and raises the horizon; at `k = 1` the dip is `0`. Above, the effective
|
|
85
|
+
* Earth is concave, no sightline grazes it and the dip is `NaN`.
|
|
86
|
+
*
|
|
87
|
+
* A height of `0` gives `0`; a negative or non-finite height, a radius that is
|
|
88
|
+
* not finite and positive or a coefficient that is not finite gives `NaN`. The
|
|
89
|
+
* dip in radians times the effective radius is {@link horizonDistance}.
|
|
90
|
+
*/
|
|
91
|
+
export function horizonDip(heightM, radiusM, refractionCoefficient = 0) {
|
|
92
|
+
const curvature = effectiveCurvature_(radiusM, refractionCoefficient);
|
|
93
|
+
if (!(heightM >= 0) ||
|
|
94
|
+
heightM === Number.POSITIVE_INFINITY ||
|
|
95
|
+
curvature !== curvature) {
|
|
96
|
+
return Number.NaN;
|
|
97
|
+
}
|
|
98
|
+
if (curvature < 0) {
|
|
99
|
+
return heightM === 0 ? 0 : Number.NaN;
|
|
100
|
+
}
|
|
101
|
+
return horizonAngle_(heightM * curvature) * RAD_TO_DEG;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* The height, metres, of the bottom of an object at the surface distance
|
|
105
|
+
* `distanceM` that the horizon hides from an eye `observerHeightM` above a
|
|
106
|
+
* sphere of radius `radiusM`: `0` up to the {@link horizonDistance}, then the
|
|
107
|
+
* {@link curvatureDrop} of the distance beyond it (the eye's grazing sightline
|
|
108
|
+
* is the horizontal plane of the horizon point). A target is in view above that
|
|
109
|
+
* height. A refraction coefficient `k` uses the effective radius `R/(1 − k)`;
|
|
110
|
+
* from `k = 1` on nothing is hidden.
|
|
111
|
+
*
|
|
112
|
+
* A negative or non-finite distance or height, a radius that is not finite and
|
|
113
|
+
* positive or a coefficient that is not finite gives `NaN`.
|
|
114
|
+
*/
|
|
115
|
+
export function hiddenHeight(distanceM, observerHeightM, radiusM, refractionCoefficient = 0) {
|
|
116
|
+
const horizon = horizonDistance(observerHeightM, radiusM, refractionCoefficient);
|
|
117
|
+
if (!(distanceM >= 0) ||
|
|
118
|
+
distanceM === Number.POSITIVE_INFINITY ||
|
|
119
|
+
horizon !== horizon) {
|
|
120
|
+
return Number.NaN;
|
|
121
|
+
}
|
|
122
|
+
if (distanceM <= horizon) {
|
|
123
|
+
return 0;
|
|
124
|
+
}
|
|
125
|
+
return curvatureDrop(distanceM - horizon, radiusM, refractionCoefficient);
|
|
126
|
+
}
|
|
127
|
+
/** The central angle `acos(1/(1 + x))` from the eye to its horizon, radians. */
|
|
128
|
+
function horizonAngle_(heightCurvature) {
|
|
129
|
+
return Math.atan(Math.sqrt(heightCurvature * (2 + heightCurvature)));
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=horizon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"horizon.js","sourceRoot":"","sources":["../src/horizon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE1D,qEAAqE;AACrE,+EAA+E;AAC/E,uEAAuE;AACvE,8EAA8E;AAC9E,mCAAmC;AAEnC,yEAAyE;AACzE,SAAS,mBAAmB,CAC3B,OAAe,EACf,qBAA6B;IAE7B,IACC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC;QACd,OAAO,KAAK,MAAM,CAAC,iBAAiB;QACpC,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EACtC,CAAC;QACF,OAAO,MAAM,CAAC,GAAG,CAAC;IACnB,CAAC;IACD,OAAO,CAAC,CAAC,GAAG,qBAAqB,CAAC,GAAG,OAAO,CAAC;AAC9C,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,aAAa,CAC5B,SAAiB,EACjB,OAAe,EACf,qBAAqB,GAAG,CAAC;IAEzB,MAAM,SAAS,GAAG,mBAAmB,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC;IACtE,IACC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC;QACjB,SAAS,KAAK,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ED
|
@@ -1 +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"}
|
|
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,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +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"}
|
|
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,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The air along a near-horizontal sightline, for {@link refractionCurvature} and
|
|
3
|
+
* {@link refractionCoefficient}. Every field is optional; the defaults are the
|
|
4
|
+
* ISA atmosphere at sea level, seen in visible light.
|
|
5
|
+
*/
|
|
6
|
+
export type RefractionConditions = {
|
|
7
|
+
/** The air temperature, °C; default `15`. */
|
|
8
|
+
readonly temperatureC?: number;
|
|
9
|
+
/** The station pressure (not reduced to sea level), hPa; default `1013.25`. */
|
|
10
|
+
readonly pressureHpa?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The vertical temperature gradient `dT/dh`, kelvins per metre, positive when
|
|
13
|
+
* the air warms upwards (an inversion); default `−0.0065`, the ISA lapse
|
|
14
|
+
* rate. Refraction depends on it far more than on the temperature or the
|
|
15
|
+
* pressure: near the ground it ranges from about `−0.1` over sunlit land to
|
|
16
|
+
* `+0.1` over cold water.
|
|
17
|
+
*/
|
|
18
|
+
readonly temperatureGradientKPerM?: number;
|
|
19
|
+
/** The vacuum wavelength, micrometres, in `[0.2, 2]`; default `0.55`. */
|
|
20
|
+
readonly wavelengthUm?: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Gauss's terrestrial refraction coefficient, `0.13`: the conventional value of
|
|
24
|
+
* geodetic levelling, for daytime sightlines well above the ground.
|
|
25
|
+
*/
|
|
26
|
+
export declare const REFRACTION_COEFFICIENT_GAUSS = 0.13;
|
|
27
|
+
/**
|
|
28
|
+
* The curvature of a near-horizontal light ray, in 1/m, positive when the ray
|
|
29
|
+
* bends down towards the Earth: `κ = −(dn/dh) / n`.
|
|
30
|
+
*
|
|
31
|
+
* Dry air is taken as an ideal gas in hydrostatic balance, so the refractive
|
|
32
|
+
* index is `n − 1 = K(λ)·P/T` and its gradient `dn/dh = −K(λ)·P/T²·(g/R_d +
|
|
33
|
+
* dT/dh)`: the pressure falls by `g/R_d ≈ 0.0342 K/m` worth of density per
|
|
34
|
+
* metre and the temperature gradient adds its own. `K(λ)` comes from Birch and
|
|
35
|
+
* Downs' revision of Edlén's dispersion formula for standard air (Metrologia
|
|
36
|
+
* 31, 1994, 315–316). The ray is assumed near horizontal (its curvature scales
|
|
37
|
+
* with the cosine of its elevation). Water vapour is neglected: it changes
|
|
38
|
+
* visible refraction by well under 1 %.
|
|
39
|
+
*
|
|
40
|
+
* With the defaults the curvature is about `2.67e−8 /m`, a coefficient of
|
|
41
|
+
* `0.170` on the mean Earth radius. A temperature at or below absolute zero, a
|
|
42
|
+
* negative pressure, a wavelength outside `[0.2, 2]` µm or a value that is not
|
|
43
|
+
* finite gives `NaN`.
|
|
44
|
+
*
|
|
45
|
+
* @see {@link refractionCoefficient}
|
|
46
|
+
*/
|
|
47
|
+
export declare function refractionCurvature(conditions?: RefractionConditions): number;
|
|
48
|
+
/**
|
|
49
|
+
* The terrestrial refraction coefficient `k = κR`: the ratio of the Earth's
|
|
50
|
+
* radius `radiusM` (default WGS 84's mean radius, 6 371 008.771 m) to the
|
|
51
|
+
* radius of a near-horizontal light ray in the given air (see
|
|
52
|
+
* {@link refractionCurvature}). `0` is no refraction, `0.13` to `0.17` a usual
|
|
53
|
+
* daytime value, `1` a ray as curved as the Earth (a flat-looking sea) and
|
|
54
|
+
* above `1` ducting; a strong lapse over hot ground makes it negative.
|
|
55
|
+
*
|
|
56
|
+
* Use the radius the coefficient will be applied with, such as
|
|
57
|
+
* `ellipsoidNormalSectionRadius` in the direction of the sightline: the
|
|
58
|
+
* coefficient is then that section's own. Hirt et al. (J. Geophys. Res. 115,
|
|
59
|
+
* 2010, D21102) give the usual approximation `503·P/T²·(0.0343 + dT/dh)`.
|
|
60
|
+
*
|
|
61
|
+
* A radius that is not finite and positive, or conditions
|
|
62
|
+
* {@link refractionCurvature} rejects, give `NaN`.
|
|
63
|
+
*/
|
|
64
|
+
export declare function refractionCoefficient(conditions?: RefractionConditions, radiusM?: number): number;
|
|
65
|
+
/**
|
|
66
|
+
* The angle, degrees, by which refraction raises the apparent direction of a
|
|
67
|
+
* point at the straight-line distance `distanceM`, for a coefficient
|
|
68
|
+
* `refractionCoefficient` on a radius `radiusM`. The ray is the circular arc of
|
|
69
|
+
* curvature `k/R` through both points, and the angle is the one between its
|
|
70
|
+
* tangent at the observer and the chord: `asin(d·k / (2R))`, about `k` times
|
|
71
|
+
* half the central angle. Add it to the geometric elevation of the point (as an
|
|
72
|
+
* `affine3FromLocalFrame` east-north-up frame gives it) to get the apparent
|
|
73
|
+
* one; a negative coefficient lowers the point.
|
|
74
|
+
*
|
|
75
|
+
* No arc of that curvature spans the distance when `|d·k| > 2R`, which gives
|
|
76
|
+
* `NaN`, as does a negative or non-finite distance, a radius that is not finite
|
|
77
|
+
* and positive or a coefficient that is not finite.
|
|
78
|
+
*/
|
|
79
|
+
export declare function refractionAngle(distanceM: number, radiusM: number, refractionCoefficient: number): number;
|
|
80
|
+
//# sourceMappingURL=refraction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refraction.d.ts","sourceRoot":"","sources":["../src/refraction.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,6CAA6C;IAC7C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAC3C,yEAAyE;IACzE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAYjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAiC7E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACpC,UAAU,CAAC,EAAE,oBAAoB,EACjC,OAAO,GAAE,MAA6B,GACpC,MAAM,CAKR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC9B,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,qBAAqB,EAAE,MAAM,GAC3B,MAAM,CAaR"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { RAD_TO_DEG } from "@ac-kit/math-scalar";
|
|
2
|
+
import { ELLIPSOID_WGS84, ellipsoidMeanRadius } from "./ellipsoid.js";
|
|
3
|
+
/**
|
|
4
|
+
* Gauss's terrestrial refraction coefficient, `0.13`: the conventional value of
|
|
5
|
+
* geodetic levelling, for daytime sightlines well above the ground.
|
|
6
|
+
*/
|
|
7
|
+
export const REFRACTION_COEFFICIENT_GAUSS = 0.13;
|
|
8
|
+
const ZERO_CELSIUS_K_ = 273.15;
|
|
9
|
+
const STANDARD_GRAVITY_ = 9.80665;
|
|
10
|
+
/** The specific gas constant of dry air, J/(kg·K) (ISA, ICAO Doc 7488). */
|
|
11
|
+
const DRY_AIR_GAS_CONSTANT_ = 287.05287;
|
|
12
|
+
const STANDARD_AIR_TEMPERATURE_K_ = 288.15;
|
|
13
|
+
const STANDARD_AIR_PRESSURE_HPA_ = 1013.25;
|
|
14
|
+
const MINIMUM_WAVELENGTH_UM_ = 0.2;
|
|
15
|
+
const MAXIMUM_WAVELENGTH_UM_ = 2;
|
|
16
|
+
const WGS84_MEAN_RADIUS_M_ = ellipsoidMeanRadius(ELLIPSOID_WGS84);
|
|
17
|
+
/**
|
|
18
|
+
* The curvature of a near-horizontal light ray, in 1/m, positive when the ray
|
|
19
|
+
* bends down towards the Earth: `κ = −(dn/dh) / n`.
|
|
20
|
+
*
|
|
21
|
+
* Dry air is taken as an ideal gas in hydrostatic balance, so the refractive
|
|
22
|
+
* index is `n − 1 = K(λ)·P/T` and its gradient `dn/dh = −K(λ)·P/T²·(g/R_d +
|
|
23
|
+
* dT/dh)`: the pressure falls by `g/R_d ≈ 0.0342 K/m` worth of density per
|
|
24
|
+
* metre and the temperature gradient adds its own. `K(λ)` comes from Birch and
|
|
25
|
+
* Downs' revision of Edlén's dispersion formula for standard air (Metrologia
|
|
26
|
+
* 31, 1994, 315–316). The ray is assumed near horizontal (its curvature scales
|
|
27
|
+
* with the cosine of its elevation). Water vapour is neglected: it changes
|
|
28
|
+
* visible refraction by well under 1 %.
|
|
29
|
+
*
|
|
30
|
+
* With the defaults the curvature is about `2.67e−8 /m`, a coefficient of
|
|
31
|
+
* `0.170` on the mean Earth radius. A temperature at or below absolute zero, a
|
|
32
|
+
* negative pressure, a wavelength outside `[0.2, 2]` µm or a value that is not
|
|
33
|
+
* finite gives `NaN`.
|
|
34
|
+
*
|
|
35
|
+
* @see {@link refractionCoefficient}
|
|
36
|
+
*/
|
|
37
|
+
export function refractionCurvature(conditions) {
|
|
38
|
+
const temperatureC = conditions?.temperatureC ?? 15;
|
|
39
|
+
const pressureHpa = conditions?.pressureHpa ?? STANDARD_AIR_PRESSURE_HPA_;
|
|
40
|
+
const gradient = conditions?.temperatureGradientKPerM ?? -0.0065;
|
|
41
|
+
const wavelengthUm = conditions?.wavelengthUm ?? 0.55;
|
|
42
|
+
const temperatureK = temperatureC + ZERO_CELSIUS_K_;
|
|
43
|
+
if (!(temperatureK > 0) ||
|
|
44
|
+
temperatureK === Number.POSITIVE_INFINITY ||
|
|
45
|
+
!(pressureHpa >= 0) ||
|
|
46
|
+
pressureHpa === Number.POSITIVE_INFINITY ||
|
|
47
|
+
!Number.isFinite(gradient) ||
|
|
48
|
+
!(wavelengthUm >= MINIMUM_WAVELENGTH_UM_ &&
|
|
49
|
+
wavelengthUm <= MAXIMUM_WAVELENGTH_UM_)) {
|
|
50
|
+
return Number.NaN;
|
|
51
|
+
}
|
|
52
|
+
const waveNumberSquared = 1 / (wavelengthUm * wavelengthUm);
|
|
53
|
+
const standardRefractivity = (8342.54 +
|
|
54
|
+
2406147 / (130 - waveNumberSquared) +
|
|
55
|
+
15998 / (38.9 - waveNumberSquared)) *
|
|
56
|
+
1e-8;
|
|
57
|
+
const refractivityPerDensity = (standardRefractivity * STANDARD_AIR_TEMPERATURE_K_) /
|
|
58
|
+
STANDARD_AIR_PRESSURE_HPA_;
|
|
59
|
+
const refractivity = (refractivityPerDensity * pressureHpa) / temperatureK;
|
|
60
|
+
const indexGradient = (-refractivity / temperatureK) *
|
|
61
|
+
(STANDARD_GRAVITY_ / DRY_AIR_GAS_CONSTANT_ + gradient);
|
|
62
|
+
return -indexGradient / (1 + refractivity);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The terrestrial refraction coefficient `k = κR`: the ratio of the Earth's
|
|
66
|
+
* radius `radiusM` (default WGS 84's mean radius, 6 371 008.771 m) to the
|
|
67
|
+
* radius of a near-horizontal light ray in the given air (see
|
|
68
|
+
* {@link refractionCurvature}). `0` is no refraction, `0.13` to `0.17` a usual
|
|
69
|
+
* daytime value, `1` a ray as curved as the Earth (a flat-looking sea) and
|
|
70
|
+
* above `1` ducting; a strong lapse over hot ground makes it negative.
|
|
71
|
+
*
|
|
72
|
+
* Use the radius the coefficient will be applied with, such as
|
|
73
|
+
* `ellipsoidNormalSectionRadius` in the direction of the sightline: the
|
|
74
|
+
* coefficient is then that section's own. Hirt et al. (J. Geophys. Res. 115,
|
|
75
|
+
* 2010, D21102) give the usual approximation `503·P/T²·(0.0343 + dT/dh)`.
|
|
76
|
+
*
|
|
77
|
+
* A radius that is not finite and positive, or conditions
|
|
78
|
+
* {@link refractionCurvature} rejects, give `NaN`.
|
|
79
|
+
*/
|
|
80
|
+
export function refractionCoefficient(conditions, radiusM = WGS84_MEAN_RADIUS_M_) {
|
|
81
|
+
if (!(radiusM > 0) || radiusM === Number.POSITIVE_INFINITY) {
|
|
82
|
+
return Number.NaN;
|
|
83
|
+
}
|
|
84
|
+
return refractionCurvature(conditions) * radiusM;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The angle, degrees, by which refraction raises the apparent direction of a
|
|
88
|
+
* point at the straight-line distance `distanceM`, for a coefficient
|
|
89
|
+
* `refractionCoefficient` on a radius `radiusM`. The ray is the circular arc of
|
|
90
|
+
* curvature `k/R` through both points, and the angle is the one between its
|
|
91
|
+
* tangent at the observer and the chord: `asin(d·k / (2R))`, about `k` times
|
|
92
|
+
* half the central angle. Add it to the geometric elevation of the point (as an
|
|
93
|
+
* `affine3FromLocalFrame` east-north-up frame gives it) to get the apparent
|
|
94
|
+
* one; a negative coefficient lowers the point.
|
|
95
|
+
*
|
|
96
|
+
* No arc of that curvature spans the distance when `|d·k| > 2R`, which gives
|
|
97
|
+
* `NaN`, as does a negative or non-finite distance, a radius that is not finite
|
|
98
|
+
* and positive or a coefficient that is not finite.
|
|
99
|
+
*/
|
|
100
|
+
export function refractionAngle(distanceM, radiusM, refractionCoefficient) {
|
|
101
|
+
if (!(distanceM >= 0) ||
|
|
102
|
+
distanceM === Number.POSITIVE_INFINITY ||
|
|
103
|
+
!(radiusM > 0) ||
|
|
104
|
+
radiusM === Number.POSITIVE_INFINITY ||
|
|
105
|
+
!Number.isFinite(refractionCoefficient)) {
|
|
106
|
+
return Number.NaN;
|
|
107
|
+
}
|
|
108
|
+
return (Math.asin((distanceM * refractionCoefficient) / (2 * radiusM)) * RAD_TO_DEG);
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=refraction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refraction.js","sourceRoot":"","sources":["../src/refraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAwBtE;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAClC,2EAA2E;AAC3E,MAAM,qBAAqB,GAAG,SAAS,CAAC;AACxC,MAAM,2BAA2B,GAAG,MAAM,CAAC;AAC3C,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAC3C,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;AAElE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAiC;IAC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5C,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB,CACpC,UAAiC,EACjC,OAAO,GAAW,oBAAoB;IAEtC,IAAI,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,OAAO,KAAK,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC5D,OAAO,MAAM,CAAC,GAAG,CAAC;IACnB,CAAC;IACD,OAAO,mBAAmB,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC;AAClD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,eAAe,CAC9B,SAAiB,EACjB,OAAe,EACf,qBAA6B;IAE7B,IACC,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC;QACjB,SAAS,KAAK,MAAM,CAAC,iBAAiB;QACtC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC;QACd,OAAO,KAAK,MAAM,CAAC,iBAAiB;QACpC,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EACtC,CAAC;QACF,OAAO,MAAM,CAAC,GAAG,CAAC;IACnB,CAAC;IACD,OAAO,CACN,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,UAAU,CAC3E,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-kit/math-geodesy",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "The Earth's reference ellipsoid: geodetic and ECEF coordinates, local frames
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "The Earth's reference ellipsoid: geodetic and ECEF coordinates, local frames, geodesics (direct, inverse and lines), curvature, horizon and terrestrial refraction.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"curvature",
|
|
6
7
|
"ecef",
|
|
7
8
|
"ellipsoid",
|
|
8
9
|
"geodesic",
|
|
9
10
|
"geodesy",
|
|
11
|
+
"horizon",
|
|
12
|
+
"refraction",
|
|
10
13
|
"wgs84"
|
|
11
14
|
],
|
|
12
15
|
"homepage": "https://anthochamp.pages.grenadine.io/node-essentials/api/math-geodesy/",
|
|
@@ -47,18 +50,18 @@
|
|
|
47
50
|
"prepack": "yarn build"
|
|
48
51
|
},
|
|
49
52
|
"dependencies": {
|
|
50
|
-
"@ac-kit/core": "^0.
|
|
51
|
-
"@ac-kit/math-geometry": "^0.
|
|
52
|
-
"@ac-kit/math-linear": "^0.
|
|
53
|
-
"@ac-kit/math-scalar": "^0.
|
|
53
|
+
"@ac-kit/core": "^0.14.0",
|
|
54
|
+
"@ac-kit/math-geometry": "^0.5.0",
|
|
55
|
+
"@ac-kit/math-linear": "^0.5.0",
|
|
56
|
+
"@ac-kit/math-scalar": "^0.5.0",
|
|
54
57
|
"@types/web": "^0.0.367"
|
|
55
58
|
},
|
|
56
59
|
"devDependencies": {
|
|
57
|
-
"@ac-kit/math-random": "0.4.
|
|
58
|
-
"@ac-kit/test-util": "0.5.
|
|
60
|
+
"@ac-kit/math-random": "0.4.2",
|
|
61
|
+
"@ac-kit/test-util": "0.5.1",
|
|
59
62
|
"@ac-kit/tsconfig": "0.1.0",
|
|
60
63
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
61
|
-
"@ac-kit/vitest-config": "0.
|
|
64
|
+
"@ac-kit/vitest-config": "0.3.0",
|
|
62
65
|
"@types/node": "26.6.11",
|
|
63
66
|
"@typescript/native": "typescript@7.0.2",
|
|
64
67
|
"geographiclib-geodesic": "2.2.0",
|