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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/LICENSE +57 -0
  3. package/README.md +89 -2
  4. package/dist/_brand.d.ts +14 -0
  5. package/dist/_brand.d.ts.map +1 -0
  6. package/dist/_brand.js +2 -0
  7. package/dist/_brand.js.map +1 -0
  8. package/dist/_ecef-forward-bound.d.ts +7 -0
  9. package/dist/_ecef-forward-bound.d.ts.map +1 -0
  10. package/dist/_ecef-forward-bound.js +7 -0
  11. package/dist/_ecef-forward-bound.js.map +1 -0
  12. package/dist/_ecef-height.d.ts +33 -0
  13. package/dist/_ecef-height.d.ts.map +1 -0
  14. package/dist/_ecef-height.js +173 -0
  15. package/dist/_ecef-height.js.map +1 -0
  16. package/dist/ellipsoid.d.ts +52 -0
  17. package/dist/ellipsoid.d.ts.map +1 -0
  18. package/dist/ellipsoid.js +75 -0
  19. package/dist/ellipsoid.js.map +1 -0
  20. package/dist/geodesic/_angle.d.ts +46 -0
  21. package/dist/geodesic/_angle.d.ts.map +1 -0
  22. package/dist/geodesic/_angle.js +144 -0
  23. package/dist/geodesic/_angle.js.map +1 -0
  24. package/dist/geodesic/_constants.d.ts +38 -0
  25. package/dist/geodesic/_constants.d.ts.map +1 -0
  26. package/dist/geodesic/_constants.js +142 -0
  27. package/dist/geodesic/_constants.js.map +1 -0
  28. package/dist/geodesic/_inverse.d.ts +22 -0
  29. package/dist/geodesic/_inverse.d.ts.map +1 -0
  30. package/dist/geodesic/_inverse.js +720 -0
  31. package/dist/geodesic/_inverse.js.map +1 -0
  32. package/dist/geodesic/_line.d.ts +37 -0
  33. package/dist/geodesic/_line.d.ts.map +1 -0
  34. package/dist/geodesic/_line.js +219 -0
  35. package/dist/geodesic/_line.js.map +1 -0
  36. package/dist/geodesic/_series.d.ts +69 -0
  37. package/dist/geodesic/_series.d.ts.map +1 -0
  38. package/dist/geodesic/_series.js +203 -0
  39. package/dist/geodesic/_series.js.map +1 -0
  40. package/dist/geodesic.d.ts +97 -0
  41. package/dist/geodesic.d.ts.map +1 -0
  42. package/dist/geodesic.js +245 -0
  43. package/dist/geodesic.js.map +1 -0
  44. package/dist/geodetic.d.ts +195 -0
  45. package/dist/geodetic.d.ts.map +1 -0
  46. package/dist/geodetic.js +456 -0
  47. package/dist/geodetic.js.map +1 -0
  48. package/dist/index.d.ts +5 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +5 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/local-frame.d.ts +19 -0
  53. package/dist/local-frame.d.ts.map +1 -0
  54. package/dist/local-frame.js +66 -0
  55. package/dist/local-frame.js.map +1 -0
  56. package/package.json +73 -3
@@ -0,0 +1,75 @@
1
+ import { describeValue, isFinitePositive } from "@ac-kit/core";
2
+ import { cosDeg } from "@ac-kit/math-scalar";
3
+ import { CONSTANTS_KEY_, constantsCreate_ } from "./geodesic/_constants.js";
4
+ /**
5
+ * Creates the ellipsoid of equatorial radius `semiMajorAxisM` metres and
6
+ * flattening `flattening` (`1 / 298.257223563` for WGS 84), computing the
7
+ * constants of the geodesic solvers once. Allocates; keep it out of hot loops.
8
+ *
9
+ * @throws {RangeError} Unless `semiMajorAxisM` is finite and positive and `0 ≤
10
+ * flattening < 1`.
11
+ */
12
+ export function ellipsoidCreate(semiMajorAxisM, flattening) {
13
+ if (!isFinitePositive(semiMajorAxisM)) {
14
+ throw new RangeError(`ellipsoidCreate: semiMajorAxisM must be finite and positive, got ${describeValue(semiMajorAxisM)}.`);
15
+ }
16
+ if (!(flattening >= 0 && flattening < 1)) {
17
+ throw new RangeError(`ellipsoidCreate: flattening must be in [0, 1), got ${describeValue(flattening)}.`);
18
+ }
19
+ const eccentricitySquared = flattening * (2 - flattening);
20
+ const polarRatio = 1 - flattening;
21
+ const ellipsoid = {
22
+ semiMajorAxisM,
23
+ flattening,
24
+ semiMinorAxisM: semiMajorAxisM * polarRatio,
25
+ eccentricitySquared,
26
+ secondEccentricitySquared: eccentricitySquared / (polarRatio * polarRatio),
27
+ thirdFlattening: flattening / (2 - flattening),
28
+ };
29
+ Object.defineProperty(ellipsoid, CONSTANTS_KEY_, {
30
+ value: constantsCreate_(semiMajorAxisM, flattening),
31
+ enumerable: false,
32
+ });
33
+ return Object.freeze(ellipsoid);
34
+ }
35
+ /** The sphere of radius `radiusM` metres: flattening `0`. */
36
+ export function ellipsoidSphere(radiusM) {
37
+ return ellipsoidCreate(radiusM, 0);
38
+ }
39
+ /** WGS 84: `a = 6 378 137 m`, `1/f = 298.257223563`. */
40
+ export const ELLIPSOID_WGS84 = ellipsoidCreate(6378137, 1 / 298.257223563);
41
+ /** GRS 80: `a = 6 378 137 m`, `1/f = 298.257222101`. */
42
+ export const ELLIPSOID_GRS80 = ellipsoidCreate(6378137, 1 / 298.257222101);
43
+ /**
44
+ * The radius of curvature of the meridian `M = a(1 − e²) / (1 − e²
45
+ * sin²φ)^(3/2)` at the geodetic latitude, metres, evaluated as `a(1 − f)² / w³`
46
+ * with `w² = 1 − e² sin²φ = (1 − f)² + e² cos²φ`, so an extreme flattening
47
+ * (whose `e²` rounds to 1) stays finite at the poles. A latitude beyond ±90° or
48
+ * not finite gives `NaN`.
49
+ */
50
+ export function ellipsoidMeridionalRadius(ellipsoid, latitudeDeg) {
51
+ const polarRatio = 1 - ellipsoid.flattening;
52
+ const polarRatioSquared = polarRatio * polarRatio;
53
+ const w = curvatureDenominator_(ellipsoid, polarRatioSquared, latitudeDeg);
54
+ return (ellipsoid.semiMajorAxisM * polarRatioSquared) / (w * w * w);
55
+ }
56
+ /**
57
+ * The radius of curvature of the prime vertical `N = a / √(1 − e² sin²φ)` at
58
+ * the geodetic latitude, metres, evaluated as `a / w` with `w² = (1 − f)² + e²
59
+ * cos²φ` (see {@link ellipsoidMeridionalRadius}). A latitude beyond ±90° or not
60
+ * finite gives `NaN`.
61
+ */
62
+ export function ellipsoidPrimeVerticalRadius(ellipsoid, latitudeDeg) {
63
+ const polarRatio = 1 - ellipsoid.flattening;
64
+ const w = curvatureDenominator_(ellipsoid, polarRatio * polarRatio, latitudeDeg);
65
+ return ellipsoid.semiMajorAxisM / w;
66
+ }
67
+ /** `w = √((1 − f)² + e² cos²φ)`, `NaN` beyond ±90°. */
68
+ function curvatureDenominator_(ellipsoid, polarRatioSquared, latitudeDeg) {
69
+ if (!(Math.abs(latitudeDeg) <= 90)) {
70
+ return Number.NaN;
71
+ }
72
+ const cosine = cosDeg(latitudeDeg);
73
+ return Math.sqrt(polarRatioSquared + ellipsoid.eccentricitySquared * (cosine * cosine));
74
+ }
75
+ //# sourceMappingURL=ellipsoid.js.map
@@ -0,0 +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;AAG7C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAuB5E;;;;;;;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,cAAc,CAAC,GAAG,CACpG,CAAC;IACH,CAAC;IACD,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,IAAI,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC;QAC1C,MAAM,IAAI,UAAU,CACnB,sDAAsD,aAAa,CAAC,UAAU,CAAC,GAAG,CAClF,CAAC;IACH,CAAC;IACD,MAAM,mBAAmB,GAAG,UAAU,GAAG,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC;IAC1D,MAAM,UAAU,GAAG,CAAC,GAAG,UA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,EACpB,WAAmB;IAEnB,MAAM,UAAU,GAAG,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC;IAC5C,MAAM,CAAC,GAAG,qBAAqB,CAC9B,SAAS,EACT,UAAU,GAAG,UAAU,EACvB,WAAW,CACX,CAAC;IACF,OAAO,SAAS,CAAC,cAAc,GAAG,CAAC,CAAC;AACrC,CAAC;AAED,uDAAuD;AACvD,SAAS,qBAAqB,CAC7B,SAAoB,EACpB,iBAAyB,EACzB,WAAmB;IAEnB,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;QACpC,OAAO,MAAM,CAAC,GAAG,CAAC;IACnB,CAAC;IACD,MAAM,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"}
@@ -0,0 +1,46 @@
1
+ /*! Derived from GeographicLib Math.js (geographiclib-geodesic 2.2.0), Copyright (c) 2011-2022, Charles Karney, MIT License — see LICENSE. */
2
+ /**
3
+ * A `Float64Array` the port uses as a record or a scratch buffer, indexed by
4
+ * named constants.
5
+ */
6
+ export type Scratch_ = Float64Array;
7
+ export declare function scratchCreate_(length: number): Scratch_;
8
+ /**
9
+ * The smallest sine or cosine the port keeps away from zero, `sqrt(min normal
10
+ * double)`, so a pole never gives a division by exactly zero.
11
+ */
12
+ export declare const TINY_: number;
13
+ /**
14
+ * {@link TINY_} in a buffer, read as `TINY_DOUBLE_[0]` where it is assigned to
15
+ * a variable that otherwise holds computed doubles: the module binding is a
16
+ * tagged value, and V8 then boxes that variable on every path.
17
+ */
18
+ export declare const TINY_DOUBLE_: Float64Array<ArrayBuffer>;
19
+ /**
20
+ * Snaps the angle `buffer[index]` within 1/16° of zero onto a grid of 2⁻⁵⁷°, so
21
+ * a latitude that is zero up to rounding is treated as the equator. Tiny
22
+ * negatives become `−0`, and `−0` stays `−0`.
23
+ */
24
+ export declare function angleRoundInPlace_(buffer: Scratch_, index: number): void;
25
+ /**
26
+ * The angle `buffer[index]` reduced to `[−180, 180]`; a result of ±180 or ±0
27
+ * takes the sign of the angle.
28
+ */
29
+ export declare function angleNormalizeInPlace_(buffer: Scratch_, index: number): void;
30
+ /**
31
+ * `io[1] − io[0]` reduced to `[−180, 180]`, written back as `io[0] + io[1]`:
32
+ * `io[0]` is the nearest double and `io[1]` the rounding error, below 2⁻²⁶. A
33
+ * result of ±0 or ±180 takes the sign of the difference (of `−error` when the
34
+ * error is not zero).
35
+ */
36
+ export declare function angleDifference_(io: Scratch_): void;
37
+ /**
38
+ * Sine and cosine, written to `io[0]` and `io[1]`, of `io[0] + io[1]` degrees,
39
+ * where `io[1]` is the small error term of {@link angleDifference_}. The
40
+ * argument is reduced to `[−45, 45]` before the conversion to radians and the
41
+ * reduced sum snapped by {@link angleRoundInPlace_} (upstream's `sincosde`,
42
+ * whose contract no `math-scalar` function has); 30° and 45° give their exact
43
+ * algebraic values.
44
+ */
45
+ export declare function sineCosineCorrected_(io: Scratch_): void;
46
+ //# sourceMappingURL=_angle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_angle.d.ts","sourceRoot":"","sources":["../../src/geodesic/_angle.ts"],"names":[],"mappings":"AAAA,6IAA6I;AAI7I;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;AAEpC,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,CAEvD;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,QAA+C,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,YAAY,2BAAyB,CAAC;AAqBnD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAOxE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAM5E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CAqBnD;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,QAAQ,GAAG,IAAI,CA+CvD"}
@@ -0,0 +1,144 @@
1
+ /*! Derived from GeographicLib Math.js (geographiclib-geodesic 2.2.0), Copyright (c) 2011-2022, Charles Karney, MIT License — see LICENSE. */
2
+ import { DEG_TO_RAD, twoSumInPlace } from "@ac-kit/math-scalar";
3
+ export function scratchCreate_(length) {
4
+ return new Float64Array(length);
5
+ }
6
+ /**
7
+ * The smallest sine or cosine the port keeps away from zero, `sqrt(min normal
8
+ * double)`, so a pole never gives a division by exactly zero.
9
+ */
10
+ export const TINY_ = Math.sqrt(Number.MIN_VALUE / Number.EPSILON);
11
+ /**
12
+ * {@link TINY_} in a buffer, read as `TINY_DOUBLE_[0]` where it is assigned to
13
+ * a variable that otherwise holds computed doubles: the module binding is a
14
+ * tagged value, and V8 then boxes that variable on every path.
15
+ */
16
+ export const TINY_DOUBLE_ = Float64Array.of(TINY_);
17
+ // Every helper below reads its doubles from a buffer and writes its results
18
+ // back to it: none has a double parameter or result, so none allocates whether
19
+ // or not the engine inlines it (V8 boxes a double crossing a call it does not
20
+ // inline). The sign tests are C's `signbit`, spelled `v < 0 || 1 / v < 0` (a
21
+ // negative zero counts as negative, NaN as positive) rather than a call.
22
+ /**
23
+ * `buffer[index]` modulo 360, in `[−180, 180]`, exactly (upstream's
24
+ * `remainder(x, 360)`).
25
+ */
26
+ function remainder360InPlace_(buffer, index) {
27
+ const reduced = buffer[index] % 360;
28
+ if (reduced < -180) {
29
+ buffer[index] = reduced + 360;
30
+ }
31
+ else {
32
+ buffer[index] = reduced < 180 ? reduced : reduced - 360;
33
+ }
34
+ }
35
+ /**
36
+ * Snaps the angle `buffer[index]` within 1/16° of zero onto a grid of 2⁻⁵⁷°, so
37
+ * a latitude that is zero up to rounding is treated as the equator. Tiny
38
+ * negatives become `−0`, and `−0` stays `−0`.
39
+ */
40
+ export function angleRoundInPlace_(buffer, index) {
41
+ const grid = 1 / 16;
42
+ const x = buffer[index];
43
+ const magnitude = Math.abs(x);
44
+ // `grid - (grid - magnitude)` is not `magnitude`: the rounding is the point.
45
+ const rounded = magnitude < grid ? grid - (grid - magnitude) : magnitude;
46
+ buffer[index] = x < 0 || 1 / x < 0 ? -rounded : rounded;
47
+ }
48
+ /**
49
+ * The angle `buffer[index]` reduced to `[−180, 180]`; a result of ±180 or ±0
50
+ * takes the sign of the angle.
51
+ */
52
+ export function angleNormalizeInPlace_(buffer, index) {
53
+ const x = buffer[index];
54
+ remainder360InPlace_(buffer, index);
55
+ if (Math.abs(buffer[index]) === 180) {
56
+ buffer[index] = x < 0 || 1 / x < 0 ? -180 : 180;
57
+ }
58
+ }
59
+ /**
60
+ * `io[1] − io[0]` reduced to `[−180, 180]`, written back as `io[0] + io[1]`:
61
+ * `io[0]` is the nearest double and `io[1]` the rounding error, below 2⁻²⁶. A
62
+ * result of ±0 or ±180 takes the sign of the difference (of `−error` when the
63
+ * error is not zero).
64
+ */
65
+ export function angleDifference_(io) {
66
+ const x = io[0];
67
+ const y = io[1];
68
+ io[0] = -x;
69
+ remainder360InPlace_(io, 0);
70
+ io[1] = y;
71
+ remainder360InPlace_(io, 1);
72
+ twoSumInPlace(io, 0);
73
+ if (io[0] === 0) {
74
+ io[1] = io[0];
75
+ }
76
+ remainder360InPlace_(io, 0);
77
+ twoSumInPlace(io, 0);
78
+ let sum = io[0];
79
+ const error = sum === 0 ? sum : io[1];
80
+ if (sum === 0 || Math.abs(sum) === 180) {
81
+ const sign = error === 0 ? y - x : -error;
82
+ sum = sign < 0 || 1 / sign < 0 ? -Math.abs(sum) : Math.abs(sum);
83
+ }
84
+ io[0] = sum;
85
+ io[1] = error;
86
+ }
87
+ /**
88
+ * Sine and cosine, written to `io[0]` and `io[1]`, of `io[0] + io[1]` degrees,
89
+ * where `io[1]` is the small error term of {@link angleDifference_}. The
90
+ * argument is reduced to `[−45, 45]` before the conversion to radians and the
91
+ * reduced sum snapped by {@link angleRoundInPlace_} (upstream's `sincosde`,
92
+ * whose contract no `math-scalar` function has); 30° and 45° give their exact
93
+ * algebraic values.
94
+ */
95
+ export function sineCosineCorrected_(io) {
96
+ const x = io[0];
97
+ const correction = io[1];
98
+ const reduced = x % 360;
99
+ const quadrant = Math.round(reduced / 90);
100
+ io[0] = reduced - 90 * quadrant + correction;
101
+ angleRoundInPlace_(io, 0);
102
+ const angle = io[0];
103
+ const radians = angle * DEG_TO_RAD;
104
+ let sine = Math.sin(radians);
105
+ let cosine = Math.cos(radians);
106
+ const magnitude = Math.abs(angle);
107
+ const sign = radians < 0 || 1 / radians < 0 ? -1 : 1;
108
+ if (magnitude === 45) {
109
+ cosine = Math.SQRT1_2;
110
+ sine = sign * cosine;
111
+ }
112
+ else if (magnitude === 30) {
113
+ cosine = Math.sqrt(0.75);
114
+ sine = sign * 0.5;
115
+ }
116
+ let resultSine;
117
+ let resultCosine;
118
+ switch (quadrant & 3) {
119
+ case 0:
120
+ resultSine = sine;
121
+ resultCosine = cosine;
122
+ break;
123
+ case 1:
124
+ resultSine = cosine;
125
+ resultCosine = -sine;
126
+ break;
127
+ case 2:
128
+ resultSine = -sine;
129
+ resultCosine = -cosine;
130
+ break;
131
+ default:
132
+ resultSine = -cosine;
133
+ resultCosine = sine;
134
+ break;
135
+ }
136
+ resultCosine += 0;
137
+ if (resultSine === 0) {
138
+ const total = x + correction;
139
+ resultSine = total < 0 || 1 / total < 0 ? -0 : 0;
140
+ }
141
+ io[0] = resultSine;
142
+ io[1] = resultCosine;
143
+ }
144
+ //# sourceMappingURL=_angle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_angle.js","sourceRoot":"","sources":["../../src/geodesic/_angle.ts"],"names":[],"mappings":"AAAA,6IAA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G,UAAU,CAAC;QAC7B,UAAU,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC;IACnB,EAAE,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC;AACtB,CAAC"}
@@ -0,0 +1,38 @@
1
+ /*! Derived from GeographicLib Geodesic.js (geographiclib-geodesic 2.2.0), Copyright (c) 2011-2022, Charles Karney, MIT License — see LICENSE. */
2
+ import type { Ellipsoid } from "../ellipsoid.js";
3
+ import { type Scratch_ } from "./_angle.js";
4
+ /**
5
+ * The order of the series in the third flattening `n` (GeographicLib's default
6
+ * for doubles).
7
+ */
8
+ export declare const SERIES_ORDER_ = 6;
9
+ /** Indices into an ellipsoid's constants. */
10
+ export declare const CONSTANT_EQUATORIAL_RADIUS_ = 0;
11
+ export declare const CONSTANT_FLATTENING_ = 1;
12
+ /** `1 − f`. */
13
+ export declare const CONSTANT_POLAR_RATIO_ = 2;
14
+ /** The second eccentricity squared, `e² / (1 − e²)`. */
15
+ export declare const CONSTANT_SECOND_ECCENTRICITY_SQUARED_ = 3;
16
+ /** The third flattening `n = f / (2 − f)`. */
17
+ export declare const CONSTANT_THIRD_FLATTENING_ = 4;
18
+ export declare const CONSTANT_POLAR_RADIUS_ = 5;
19
+ /** The arc length under which a line counts as really short. */
20
+ export declare const CONSTANT_SHORT_ARC_ = 6;
21
+ /** The `A3` series: `SERIES_ORDER_` coefficients in `eps`. */
22
+ export declare const CONSTANT_A3_ = 7;
23
+ /** The `C3` series: `C3_COUNT_` coefficients. */
24
+ export declare const CONSTANT_C3_: number;
25
+ /**
26
+ * Where an ellipsoid record keeps its geodesic constants: a non-enumerable
27
+ * property under this symbol, so a lookup is one property read.
28
+ */
29
+ export declare const CONSTANTS_KEY_: unique symbol;
30
+ /**
31
+ * The constants of an ellipsoid of revolution the solvers read, in one
32
+ * `Float64Array`: the radii and ratios of the record plus the series in the
33
+ * third flattening, all computed once.
34
+ */
35
+ export declare function constantsCreate_(equatorialRadius: number, flattening: number): Scratch_;
36
+ /** The constants an ellipsoid record carries, derived again for a copy of one. */
37
+ export declare function constantsOf_(ellipsoid: Ellipsoid): Scratch_;
38
+ //# sourceMappingURL=_constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_constants.d.ts","sourceRoot":"","sources":["../../src/geodesic/_constants.ts"],"names":[],"mappings":"AAAA,iJAAiJ;AAIjJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAK/B,6CAA6C;AAC7C,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAe;AACf,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,wDAAwD;AACxD,eAAO,MAAM,qCAAqC,IAAI,CAAC;AACvD,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,IAAI,CAAC;AAC5C,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,gEAAgE;AAChE,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,8DAA8D;AAC9D,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,iDAAiD;AACjD,eAAO,MAAM,YAAY,QAA+B,CAAC;AAGzD;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,OAAO,MAAyC,CAAC;AAkD9E;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC/B,gBAAgB,EAAE,MAAM,EACxB,UAAU,EAAE,MAAM,GAChB,QAAQ,CA2CV;AAKD,kFAAkF;AAClF,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,QAAQ,CAe3D"}
@@ -0,0 +1,142 @@
1
+ /*! Derived from GeographicLib Geodesic.js (geographiclib-geodesic 2.2.0), Copyright (c) 2011-2022, Charles Karney, MIT License — see LICENSE. */
2
+ import { polynomialEvaluate } from "@ac-kit/math-scalar";
3
+ import { scratchCreate_ } from "./_angle.js";
4
+ /**
5
+ * The order of the series in the third flattening `n` (GeographicLib's default
6
+ * for doubles).
7
+ */
8
+ export const SERIES_ORDER_ = 6;
9
+ /** The number of coefficients of the `C3` series, `order × (order − 1) / 2`. */
10
+ const C3_COUNT_ = 15;
11
+ /** Indices into an ellipsoid's constants. */
12
+ export const CONSTANT_EQUATORIAL_RADIUS_ = 0;
13
+ export const CONSTANT_FLATTENING_ = 1;
14
+ /** `1 − f`. */
15
+ export const CONSTANT_POLAR_RATIO_ = 2;
16
+ /** The second eccentricity squared, `e² / (1 − e²)`. */
17
+ export const CONSTANT_SECOND_ECCENTRICITY_SQUARED_ = 3;
18
+ /** The third flattening `n = f / (2 − f)`. */
19
+ export const CONSTANT_THIRD_FLATTENING_ = 4;
20
+ export const CONSTANT_POLAR_RADIUS_ = 5;
21
+ /** The arc length under which a line counts as really short. */
22
+ export const CONSTANT_SHORT_ARC_ = 6;
23
+ /** The `A3` series: `SERIES_ORDER_` coefficients in `eps`. */
24
+ export const CONSTANT_A3_ = 7;
25
+ /** The `C3` series: `C3_COUNT_` coefficients. */
26
+ export const CONSTANT_C3_ = CONSTANT_A3_ + SERIES_ORDER_;
27
+ const CONSTANT_COUNT_ = CONSTANT_C3_ + C3_COUNT_;
28
+ /**
29
+ * Where an ellipsoid record keeps its geodesic constants: a non-enumerable
30
+ * property under this symbol, so a lookup is one property read.
31
+ */
32
+ export const CONSTANTS_KEY_ = Symbol("math-geodesy.constants");
33
+ const A3_COEFFICIENTS_ = new Float64Array([
34
+ // A3, coeff of eps^5, polynomial in n of order 0
35
+ -3, 128,
36
+ // A3, coeff of eps^4, polynomial in n of order 1
37
+ -2, -3, 64,
38
+ // A3, coeff of eps^3, polynomial in n of order 2
39
+ -1, -3, -1, 16,
40
+ // A3, coeff of eps^2, polynomial in n of order 2
41
+ +3, -1, -2, 8,
42
+ // A3, coeff of eps^1, polynomial in n of order 1
43
+ +1, -1, 2,
44
+ // A3, coeff of eps^0, polynomial in n of order 0
45
+ +1, 1,
46
+ ]);
47
+ const C3_COEFFICIENTS_ = new Float64Array([
48
+ // C3[1], coeff of eps^5, polynomial in n of order 0
49
+ +3, 128,
50
+ // C3[1], coeff of eps^4, polynomial in n of order 1
51
+ +2, 5, 128,
52
+ // C3[1], coeff of eps^3, polynomial in n of order 2
53
+ -1, 3, 3, 64,
54
+ // C3[1], coeff of eps^2, polynomial in n of order 2
55
+ -1, 0, 1, 8,
56
+ // C3[1], coeff of eps^1, polynomial in n of order 1
57
+ -1, 1, 4,
58
+ // C3[2], coeff of eps^5, polynomial in n of order 0
59
+ +5, 256,
60
+ // C3[2], coeff of eps^4, polynomial in n of order 1
61
+ +1, 3, 128,
62
+ // C3[2], coeff of eps^3, polynomial in n of order 2
63
+ -3, -2, 3, 64,
64
+ // C3[2], coeff of eps^2, polynomial in n of order 2
65
+ +1, -3, 2, 32,
66
+ // C3[3], coeff of eps^5, polynomial in n of order 0
67
+ +7, 512,
68
+ // C3[3], coeff of eps^4, polynomial in n of order 1
69
+ -10, 9, 384,
70
+ // C3[3], coeff of eps^3, polynomial in n of order 2
71
+ +5, -9, 5, 192,
72
+ // C3[4], coeff of eps^5, polynomial in n of order 0
73
+ +7, 512,
74
+ // C3[4], coeff of eps^4, polynomial in n of order 1
75
+ -14, 7, 512,
76
+ // C3[5], coeff of eps^5, polynomial in n of order 0
77
+ +21, 2560,
78
+ ]);
79
+ /**
80
+ * The constants of an ellipsoid of revolution the solvers read, in one
81
+ * `Float64Array`: the radii and ratios of the record plus the series in the
82
+ * third flattening, all computed once.
83
+ */
84
+ export function constantsCreate_(equatorialRadius, flattening) {
85
+ const constants = scratchCreate_(CONSTANT_COUNT_);
86
+ const polarRatio = 1 - flattening;
87
+ const eccentricitySquared = flattening * (2 - flattening);
88
+ const thirdFlattening = flattening / (2 - flattening);
89
+ constants[CONSTANT_EQUATORIAL_RADIUS_] = equatorialRadius;
90
+ constants[CONSTANT_FLATTENING_] = flattening;
91
+ constants[CONSTANT_POLAR_RATIO_] = polarRatio;
92
+ constants[CONSTANT_SECOND_ECCENTRICITY_SQUARED_] =
93
+ eccentricitySquared / (polarRatio * polarRatio);
94
+ constants[CONSTANT_THIRD_FLATTENING_] = thirdFlattening;
95
+ constants[CONSTANT_POLAR_RADIUS_] = equatorialRadius * polarRatio;
96
+ // The threshold below which the auxiliary-sphere solution of a short line
97
+ // is exact to round-off; 0.1 is a safety factor and max(0.001, |f|) keeps
98
+ // it bounded for a nearly spherical ellipsoid.
99
+ constants[CONSTANT_SHORT_ARC_] =
100
+ (0.1 * Math.sqrt(Number.EPSILON)) /
101
+ Math.sqrt((Math.max(0.001, Math.abs(flattening)) *
102
+ Math.min(1, 1 - flattening / 2)) /
103
+ 2);
104
+ let offset = 0;
105
+ let index = 0;
106
+ for (let power = SERIES_ORDER_ - 1; power >= 0; power--) {
107
+ const degree = Math.min(SERIES_ORDER_ - power - 1, power);
108
+ constants[CONSTANT_A3_ + index++] =
109
+ polynomialEvaluate(A3_COEFFICIENTS_, offset, degree, thirdFlattening) /
110
+ A3_COEFFICIENTS_[offset + degree + 1];
111
+ offset += degree + 2;
112
+ }
113
+ offset = 0;
114
+ index = 0;
115
+ for (let order = 1; order < SERIES_ORDER_; order++) {
116
+ for (let power = SERIES_ORDER_ - 1; power >= order; power--) {
117
+ const degree = Math.min(SERIES_ORDER_ - power - 1, power);
118
+ constants[CONSTANT_C3_ + index++] =
119
+ polynomialEvaluate(C3_COEFFICIENTS_, offset, degree, thirdFlattening) /
120
+ C3_COEFFICIENTS_[offset + degree + 1];
121
+ offset += degree + 2;
122
+ }
123
+ }
124
+ return constants;
125
+ }
126
+ /** Constants derived for ellipsoid records that lost theirs (a copy by spread). */
127
+ const derived_ = new WeakMap();
128
+ /** The constants an ellipsoid record carries, derived again for a copy of one. */
129
+ export function constantsOf_(ellipsoid) {
130
+ const record = ellipsoid; // an ellipsoid record may carry its constants under a private symbol key
131
+ const own = record[CONSTANTS_KEY_];
132
+ if (own !== undefined) {
133
+ return own;
134
+ }
135
+ let constants = derived_.get(ellipsoid);
136
+ if (constants === undefined) {
137
+ constants = constantsCreate_(ellipsoid.semiMajorAxisM, ellipsoid.flattening);
138
+ derived_.set(ellipsoid, constants);
139
+ }
140
+ return constants;
141
+ }
142
+ //# sourceMappingURL=_constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_constants.js","sourceRoot":"","sources":["../../src/geodesic/_constants.ts"],"names":[],"mappings":"AAAA,iJAAiJ;AAEjJ,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,OAAO,EAAE,cAAc,EAAiB,MAAM,aAAa,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC;AAE/B,gFAAgF;AAChF,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,6CAA6C;AAC7C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC,eAAe;AACf,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AACvC,wDAAwD;AACxD,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC;AACvD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAC5C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACxC,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC;AAC9B,iDAAiD;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,GAAG,aAAa,C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AED,mFAAmF;AACnF,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEjD,kFAAkF;AAClF,MAAM,UAAU,YAAY,CAAC,SAAoB;IAChD,MAAM,MAAM,GAAG,SAAuD,CAAC,CAAC,yEAAyE;IACjJ,MAAM,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC;IACZ,CAAC;IACD,IAAI,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACxC,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC7B,SAAS,GAAG,gBAAgB,CAC3B,SAAS,CAAC,cAAc,EACxB,SAAS,CAAC,UAAU,CACpB,CAAC;QACF,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACpC,CAAC;IACD,OAAO,SAAS,CAAC;AAClB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /*! Derived from GeographicLib Geodesic.js (geographiclib-geodesic 2.2.0), Copyright (c) 2011-2022, Charles Karney, MIT License — see LICENSE. */
2
+ import { type Scratch_ } from "./_angle.js";
3
+ /** The indices of the input and the result of {@link inverse_}. */
4
+ export declare const INVERSE_LATITUDE1_ = 0;
5
+ export declare const INVERSE_LONGITUDE1_ = 1;
6
+ export declare const INVERSE_LATITUDE2_ = 2;
7
+ export declare const INVERSE_LONGITUDE2_ = 3;
8
+ export declare const INVERSE_DISTANCE_ = 0;
9
+ export declare const INVERSE_SIN_ALPHA1_ = 1;
10
+ export declare const INVERSE_COS_ALPHA1_ = 2;
11
+ export declare const INVERSE_SIN_ALPHA2_ = 3;
12
+ export declare const INVERSE_COS_ALPHA2_ = 4;
13
+ export declare const INVERSE_LENGTH_ = 5;
14
+ /**
15
+ * Solves the inverse problem between `(latitude1, longitude1)` and `(latitude2,
16
+ * longitude2)`, degrees, read from `io[0 … 3]`; `io` then holds the distance in
17
+ * metres and the sine and cosine of both azimuths. A latitude beyond ±90° and
18
+ * non-finite input give `NaN`s. (One buffer in and out: a call passing doubles
19
+ * as arguments would box them.)
20
+ */
21
+ export declare function inverse_(constants: Scratch_, io: Scratch_): void;
22
+ //# sourceMappingURL=_inverse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_inverse.d.ts","sourceRoot":"","sources":["../../src/geodesic/_inverse.ts"],"names":[],"mappings":"AAAA,iJAAiJ;AAcjJ,OAAO,EAGN,KAAK,QAAQ,EAKb,MAAM,aAAa,CAAC;AAydrB,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,GAAG,IAAI,CA8RhE"}