@ac-kit/math-map-projection 0.0.0-stage → 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.
Files changed (128) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/LICENSE +28 -0
  3. package/README.md +126 -2
  4. package/dist/_array-length.d.ts +7 -0
  5. package/dist/_array-length.d.ts.map +1 -0
  6. package/dist/_array-length.js +13 -0
  7. package/dist/_array-length.js.map +1 -0
  8. package/dist/_isometric.d.ts +8 -0
  9. package/dist/_isometric.d.ts.map +1 -0
  10. package/dist/_isometric.js +19 -0
  11. package/dist/_isometric.js.map +1 -0
  12. package/dist/azimuthal/azimuthal-equal-area.d.ts +55 -0
  13. package/dist/azimuthal/azimuthal-equal-area.d.ts.map +1 -0
  14. package/dist/azimuthal/azimuthal-equal-area.js +155 -0
  15. package/dist/azimuthal/azimuthal-equal-area.js.map +1 -0
  16. package/dist/azimuthal/azimuthal-equidistant.d.ts +55 -0
  17. package/dist/azimuthal/azimuthal-equidistant.d.ts.map +1 -0
  18. package/dist/azimuthal/azimuthal-equidistant.js +164 -0
  19. package/dist/azimuthal/azimuthal-equidistant.js.map +1 -0
  20. package/dist/azimuthal/azimuthal-projection-kind.d.ts +28 -0
  21. package/dist/azimuthal/azimuthal-projection-kind.d.ts.map +1 -0
  22. package/dist/azimuthal/azimuthal-projection-kind.js +70 -0
  23. package/dist/azimuthal/azimuthal-projection-kind.js.map +1 -0
  24. package/dist/azimuthal/gnomonic.d.ts +61 -0
  25. package/dist/azimuthal/gnomonic.d.ts.map +1 -0
  26. package/dist/azimuthal/gnomonic.js +140 -0
  27. package/dist/azimuthal/gnomonic.js.map +1 -0
  28. package/dist/azimuthal/index.d.ts +7 -0
  29. package/dist/azimuthal/index.d.ts.map +1 -0
  30. package/dist/azimuthal/index.js +7 -0
  31. package/dist/azimuthal/index.js.map +1 -0
  32. package/dist/azimuthal/orthographic.d.ts +59 -0
  33. package/dist/azimuthal/orthographic.d.ts.map +1 -0
  34. package/dist/azimuthal/orthographic.js +145 -0
  35. package/dist/azimuthal/orthographic.js.map +1 -0
  36. package/dist/azimuthal/stereographic.d.ts +59 -0
  37. package/dist/azimuthal/stereographic.d.ts.map +1 -0
  38. package/dist/azimuthal/stereographic.js +168 -0
  39. package/dist/azimuthal/stereographic.js.map +1 -0
  40. package/dist/conic/_conic.d.ts +55 -0
  41. package/dist/conic/_conic.d.ts.map +1 -0
  42. package/dist/conic/_conic.js +68 -0
  43. package/dist/conic/_conic.js.map +1 -0
  44. package/dist/conic/conic-conformal.d.ts +52 -0
  45. package/dist/conic/conic-conformal.d.ts.map +1 -0
  46. package/dist/conic/conic-conformal.js +144 -0
  47. package/dist/conic/conic-conformal.js.map +1 -0
  48. package/dist/conic/conic-equal-area.d.ts +55 -0
  49. package/dist/conic/conic-equal-area.d.ts.map +1 -0
  50. package/dist/conic/conic-equal-area.js +122 -0
  51. package/dist/conic/conic-equal-area.js.map +1 -0
  52. package/dist/conic/conic-equidistant.d.ts +50 -0
  53. package/dist/conic/conic-equidistant.d.ts.map +1 -0
  54. package/dist/conic/conic-equidistant.js +113 -0
  55. package/dist/conic/conic-equidistant.js.map +1 -0
  56. package/dist/conic/index.d.ts +5 -0
  57. package/dist/conic/index.d.ts.map +1 -0
  58. package/dist/conic/index.js +4 -0
  59. package/dist/conic/index.js.map +1 -0
  60. package/dist/cylindrical/equirectangular.d.ts +37 -0
  61. package/dist/cylindrical/equirectangular.d.ts.map +1 -0
  62. package/dist/cylindrical/equirectangular.js +67 -0
  63. package/dist/cylindrical/equirectangular.js.map +1 -0
  64. package/dist/cylindrical/index.d.ts +4 -0
  65. package/dist/cylindrical/index.d.ts.map +1 -0
  66. package/dist/cylindrical/index.js +4 -0
  67. package/dist/cylindrical/index.js.map +1 -0
  68. package/dist/cylindrical/mercator.d.ts +38 -0
  69. package/dist/cylindrical/mercator.d.ts.map +1 -0
  70. package/dist/cylindrical/mercator.js +67 -0
  71. package/dist/cylindrical/mercator.js.map +1 -0
  72. package/dist/cylindrical/transverse-mercator.d.ts +32 -0
  73. package/dist/cylindrical/transverse-mercator.d.ts.map +1 -0
  74. package/dist/cylindrical/transverse-mercator.js +103 -0
  75. package/dist/cylindrical/transverse-mercator.js.map +1 -0
  76. package/dist/geometry/_cut-antimeridian.d.ts +24 -0
  77. package/dist/geometry/_cut-antimeridian.d.ts.map +1 -0
  78. package/dist/geometry/_cut-antimeridian.js +204 -0
  79. package/dist/geometry/_cut-antimeridian.js.map +1 -0
  80. package/dist/geometry/_cut-cap.d.ts +29 -0
  81. package/dist/geometry/_cut-cap.d.ts.map +1 -0
  82. package/dist/geometry/_cut-cap.js +258 -0
  83. package/dist/geometry/_cut-cap.js.map +1 -0
  84. package/dist/geometry/_path.d.ts +36 -0
  85. package/dist/geometry/_path.d.ts.map +1 -0
  86. package/dist/geometry/_path.js +57 -0
  87. package/dist/geometry/_path.js.map +1 -0
  88. package/dist/geometry/_resample.d.ts +21 -0
  89. package/dist/geometry/_resample.d.ts.map +1 -0
  90. package/dist/geometry/_resample.js +190 -0
  91. package/dist/geometry/_resample.js.map +1 -0
  92. package/dist/geometry/graticule.d.ts +30 -0
  93. package/dist/geometry/graticule.d.ts.map +1 -0
  94. package/dist/geometry/graticule.js +78 -0
  95. package/dist/geometry/graticule.js.map +1 -0
  96. package/dist/geometry/index.d.ts +4 -0
  97. package/dist/geometry/index.d.ts.map +1 -0
  98. package/dist/geometry/index.js +4 -0
  99. package/dist/geometry/index.js.map +1 -0
  100. package/dist/geometry/project-geometry.d.ts +86 -0
  101. package/dist/geometry/project-geometry.d.ts.map +1 -0
  102. package/dist/geometry/project-geometry.js +269 -0
  103. package/dist/geometry/project-geometry.js.map +1 -0
  104. package/dist/geometry/vertex-runs.d.ts +37 -0
  105. package/dist/geometry/vertex-runs.d.ts.map +1 -0
  106. package/dist/geometry/vertex-runs.js +61 -0
  107. package/dist/geometry/vertex-runs.js.map +1 -0
  108. package/dist/index.d.ts +7 -0
  109. package/dist/index.d.ts.map +1 -0
  110. package/dist/index.js +7 -0
  111. package/dist/index.js.map +1 -0
  112. package/dist/projection.d.ts +116 -0
  113. package/dist/projection.d.ts.map +1 -0
  114. package/dist/projection.js +408 -0
  115. package/dist/projection.js.map +1 -0
  116. package/dist/pseudo-cylindrical/equal-earth.d.ts +28 -0
  117. package/dist/pseudo-cylindrical/equal-earth.d.ts.map +1 -0
  118. package/dist/pseudo-cylindrical/equal-earth.js +124 -0
  119. package/dist/pseudo-cylindrical/equal-earth.js.map +1 -0
  120. package/dist/pseudo-cylindrical/index.d.ts +3 -0
  121. package/dist/pseudo-cylindrical/index.d.ts.map +1 -0
  122. package/dist/pseudo-cylindrical/index.js +3 -0
  123. package/dist/pseudo-cylindrical/index.js.map +1 -0
  124. package/dist/pseudo-cylindrical/natural-earth.d.ts +28 -0
  125. package/dist/pseudo-cylindrical/natural-earth.d.ts.map +1 -0
  126. package/dist/pseudo-cylindrical/natural-earth.js +118 -0
  127. package/dist/pseudo-cylindrical/natural-earth.js.map +1 -0
  128. package/package.json +70 -3
@@ -0,0 +1,145 @@
1
+ import { vec2Create, vec2Load, vec3Create, } from "@ac-kit/math-linear";
2
+ import { elementCount_ } from "../_array-length.js";
3
+ const POINT_ = vec2Create();
4
+ const VECTOR_ = vec3Create();
5
+ /**
6
+ * How far past the unit circle a plane point may lie and still be taken for the
7
+ * limb: the projection of a point on the horizon rounds to a radius of `1 ±
8
+ * 2⁻⁵³`, and must come back.
9
+ */
10
+ const LIMB_TOLERANCE_ = 2 ** -50;
11
+ /**
12
+ * The orthographic projection (Snyder, _Map Projections — A Working Manual_,
13
+ * 1987, §20, spherical form): the sphere seen from infinity, the point at
14
+ * angular distance `c` from the centre landing at plane distance `sin c`. On
15
+ * unit vectors in the canonical frame (centre `+X`, plane x east `+Y`, plane y
16
+ * north `+Z`) it is `(y, z)`, and only the hemisphere facing the viewer (`x ≥
17
+ * 0`) has an image; the far hemisphere gives `NaN`. The limb (`x = 0`) is the
18
+ * unit circle.
19
+ *
20
+ * Inputs are unit vectors, which are not checked. A `NaN` component gives `NaN`
21
+ * in each output it feeds.
22
+ */
23
+ /**
24
+ * The angular radius around the centre where the projection stops: `π / 2`
25
+ * (inclusive, the limb).
26
+ */
27
+ export const ORTHOGRAPHIC_DOMAIN_ANGLE = Math.PI / 2;
28
+ /**
29
+ * Writes the plane point of the unit vector `point` into `out`; `NaN` on the
30
+ * far hemisphere.
31
+ */
32
+ export function orthographicProject(out, point) {
33
+ // 1 in front, NaN behind (√ of a negative is NaN, and NaN − NaN stays NaN).
34
+ const root = Math.sqrt(point[0]);
35
+ const keep = root - root + 1;
36
+ out[0] = point[1] * keep;
37
+ out[1] = point[2] * keep;
38
+ return out;
39
+ }
40
+ /**
41
+ * Writes the unit vector of the plane point `point` into `out`, on the facing
42
+ * hemisphere. A point outside the unit circle (a limb rounded by `2⁻⁵⁰` still
43
+ * counts) or with a non-finite coordinate gives `NaN`.
44
+ */
45
+ export function orthographicUnproject(out, point) {
46
+ const x = point[0];
47
+ const y = point[1];
48
+ const squared = x * x + y * y;
49
+ if (squared <= 1) {
50
+ out[0] = Math.sqrt(1 - squared);
51
+ out[1] = x;
52
+ out[2] = y;
53
+ }
54
+ else if (squared <= 1 + LIMB_TOLERANCE_) {
55
+ const scale = 1 / Math.sqrt(squared);
56
+ out[0] = 0;
57
+ out[1] = x * scale;
58
+ out[2] = y * scale;
59
+ }
60
+ else {
61
+ out[0] = Number.NaN;
62
+ out[1] = Number.NaN;
63
+ out[2] = Number.NaN;
64
+ }
65
+ return out;
66
+ }
67
+ /**
68
+ * Rotates every unit vector of `input` (three numbers each) by `rotation`, then
69
+ * writes its plane point into `out` (two numbers each), in one pass: the sphere
70
+ * turns first, as for a view. `out` and `input` do not overlap. O(n).
71
+ *
72
+ * @returns `out`.
73
+ * @throws {RangeError} Unless `input` holds `n` vectors and `out` `n` points.
74
+ */
75
+ export function orthographicProjectArray(out, input, rotation) {
76
+ const count = elementCount_("orthographicProjectArray", out, input, 3, 2);
77
+ const m0 = rotation[0];
78
+ const m1 = rotation[1];
79
+ const m2 = rotation[2];
80
+ const m3 = rotation[3];
81
+ const m4 = rotation[4];
82
+ const m5 = rotation[5];
83
+ const m6 = rotation[6];
84
+ const m7 = rotation[7];
85
+ const m8 = rotation[8];
86
+ for (let index = 0; index < count; index++) {
87
+ const x = input[3 * index];
88
+ const y = input[3 * index + 1];
89
+ const z = input[3 * index + 2];
90
+ // 1 on the facing hemisphere and NaN behind it, without a branch: the
91
+ // far side of random stars is half the buffer, and a branch on it
92
+ // mispredicts (√ of a negative is NaN, and NaN − NaN stays NaN).
93
+ const root = Math.sqrt(m0 * x + m3 * y + m6 * z);
94
+ const keep = root - root + 1;
95
+ out[2 * index] = (m1 * x + m4 * y + m7 * z) * keep;
96
+ out[2 * index + 1] = (m2 * x + m5 * y + m8 * z) * keep;
97
+ }
98
+ return out;
99
+ }
100
+ /**
101
+ * Writes the unit vector of every plane point of `input` (two numbers each)
102
+ * into `out` (three numbers each), then turns it by the transpose of
103
+ * `rotation`: the inverse of {@link orthographicProjectArray}. O(n).
104
+ *
105
+ * @returns `out`.
106
+ * @throws {RangeError} Unless `input` holds `n` points and `out` `n` vectors.
107
+ */
108
+ export function orthographicUnprojectArray(out, input, rotation) {
109
+ const count = elementCount_("orthographicUnprojectArray", out, input, 2, 3);
110
+ const m0 = rotation[0];
111
+ const m1 = rotation[1];
112
+ const m2 = rotation[2];
113
+ const m3 = rotation[3];
114
+ const m4 = rotation[4];
115
+ const m5 = rotation[5];
116
+ const m6 = rotation[6];
117
+ const m7 = rotation[7];
118
+ const m8 = rotation[8];
119
+ for (let index = 0; index < count; index++) {
120
+ orthographicUnproject(VECTOR_, vec2Load(POINT_, input, index));
121
+ const x = VECTOR_[0];
122
+ const y = VECTOR_[1];
123
+ const z = VECTOR_[2];
124
+ out[3 * index] = m0 * x + m1 * y + m2 * z;
125
+ out[3 * index + 1] = m3 * x + m4 * y + m5 * z;
126
+ out[3 * index + 2] = m6 * x + m7 * y + m8 * z;
127
+ }
128
+ return out;
129
+ }
130
+ /**
131
+ * The plane distance from the centre of a point at angular distance `angle`:
132
+ * `sin(angle)`. `NaN` for an angle outside `[0, π / 2]`.
133
+ */
134
+ export function orthographicRadius(angle) {
135
+ return angle >= 0 && angle <= Math.PI / 2 ? Math.sin(angle) : Number.NaN;
136
+ }
137
+ /**
138
+ * The angular distance of a point at plane distance `radius`: `asin(radius)`,
139
+ * the inverse of {@link orthographicRadius}. `NaN` for a radius outside `[0,
140
+ * 1]`.
141
+ */
142
+ export function orthographicAngle(radius) {
143
+ return radius >= 0 && radius <= 1 ? Math.asin(radius) : Number.NaN;
144
+ }
145
+ //# sourceMappingURL=orthographic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orthographic.js","sourceRoot":"","sources":["../../src/azimuthal/orthographic.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,UAAU,EACV,QAAQ,EACR,UAAU,GACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;AAC5B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAE7B;;;;GAIG;AACH,MAAM,eAAe,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;AAEjC;;;;;;;;;;;GAWG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAW,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;AAE7D;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAS,EAAE,KAAmB;IACjE,4EAA4E;IAC5E,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC;IAC7B,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,C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CAAC,CAAC,CAAC;QACrB,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACrB,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1C,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC9C,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,GAAG,CAAC;AACZ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC/C,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AAC1E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC/C,OAAO,MAAM,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AACpE,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { type ReadonlyMat3x3, type ReadonlyVec2, type ReadonlyVec3, type Vec2, type Vec3 } from "@ac-kit/math-linear";
2
+ /**
3
+ * The stereographic projection (Snyder, _Map Projections — A Working Manual_,
4
+ * 1987, §21, spherical form; conformal, and it maps every circle of the sphere
5
+ * to a circle of the plane): the point at angular distance `c` from the centre
6
+ * lands at plane distance `2·tan(c / 2)`, so the centre is the origin and the
7
+ * unit circle of the plane is the circle at `c = 90°`. On unit vectors in the
8
+ * canonical frame (centre `+X`, plane x east `+Y`, plane y north `+Z`) it is
9
+ * `(y, z) · 2 / (1 + x)`, with no trigonometry.
10
+ *
11
+ * Inputs are unit vectors, which are not checked. The antipode of the centre
12
+ * has no image and gives `NaN`; its neighbourhood is unbounded, so clip below
13
+ * {@link STEREOGRAPHIC_DOMAIN_ANGLE} first (`sphericalPolylineClipToCap`). A
14
+ * `NaN` component gives `NaN` in each output it feeds.
15
+ */
16
+ /**
17
+ * The angular radius around the centre where the projection stops: `π`
18
+ * (exclusive).
19
+ */
20
+ export declare const STEREOGRAPHIC_DOMAIN_ANGLE: number;
21
+ /** Writes the plane point of the unit vector `point` into `out`. */
22
+ export declare function stereographicProject(out: Vec2, point: ReadonlyVec3): Vec2;
23
+ /**
24
+ * Writes the unit vector of the plane point `point` into `out`. Every finite
25
+ * point has one, however far (the scale is kept in range, so `1e200` gives the
26
+ * antipode's neighbourhood and not `NaN`); a non-finite coordinate gives
27
+ * `NaN`.
28
+ */
29
+ export declare function stereographicUnproject(out: Vec3, point: ReadonlyVec2): Vec3;
30
+ /**
31
+ * Rotates every unit vector of `input` (three numbers each) by `rotation`, then
32
+ * writes its plane point into `out` (two numbers each), in one pass: the sphere
33
+ * turns first, as for a view. `out` and `input` do not overlap. O(n).
34
+ *
35
+ * @returns `out`.
36
+ * @throws {RangeError} Unless `input` holds `n` vectors and `out` `n` points.
37
+ */
38
+ export declare function stereographicProjectArray<T extends Float64Array>(out: T, input: Float64Array, rotation: ReadonlyMat3x3): T;
39
+ /**
40
+ * Writes the unit vector of every plane point of `input` (two numbers each)
41
+ * into `out` (three numbers each), then turns it by the transpose of
42
+ * `rotation`: the inverse of {@link stereographicProjectArray}. O(n).
43
+ *
44
+ * @returns `out`.
45
+ * @throws {RangeError} Unless `input` holds `n` points and `out` `n` vectors.
46
+ */
47
+ export declare function stereographicUnprojectArray<T extends Float64Array>(out: T, input: Float64Array, rotation: ReadonlyMat3x3): T;
48
+ /**
49
+ * The plane distance from the centre of a point at angular distance `angle`:
50
+ * `2·tan(angle / 2)`. `NaN` for an angle outside `[0, π)`.
51
+ */
52
+ export declare function stereographicRadius(angle: number): number;
53
+ /**
54
+ * The angular distance of a point at plane distance `radius`: `2·atan(radius /
55
+ * 2)`, the inverse of {@link stereographicRadius}. `NaN` for a negative or
56
+ * non-finite radius.
57
+ */
58
+ export declare function stereographicAngle(radius: number): number;
59
+ //# sourceMappingURL=stereographic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stereographic.d.ts","sourceRoot":"","sources":["../../src/azimuthal/stereographic.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,IAAI,EAIT,MAAM,qBAAqB,CAAC;AAO7B;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAgB,CAAC;AAE1D,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAsBzE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAuB3E;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,YAAY,EAC/D,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,cAAc,GACtB,CAAC,CAiCH;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,YAAY,EACjE,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,cAAc,GACtB,CAAC,CAqBH;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIzD"}
@@ -0,0 +1,168 @@
1
+ import { vec2Create, vec2Load, vec3Create, } from "@ac-kit/math-linear";
2
+ import { elementCount_ } from "../_array-length.js";
3
+ const POINT_ = vec2Create();
4
+ const VECTOR_ = vec3Create();
5
+ /**
6
+ * The stereographic projection (Snyder, _Map Projections — A Working Manual_,
7
+ * 1987, §21, spherical form; conformal, and it maps every circle of the sphere
8
+ * to a circle of the plane): the point at angular distance `c` from the centre
9
+ * lands at plane distance `2·tan(c / 2)`, so the centre is the origin and the
10
+ * unit circle of the plane is the circle at `c = 90°`. On unit vectors in the
11
+ * canonical frame (centre `+X`, plane x east `+Y`, plane y north `+Z`) it is
12
+ * `(y, z) · 2 / (1 + x)`, with no trigonometry.
13
+ *
14
+ * Inputs are unit vectors, which are not checked. The antipode of the centre
15
+ * has no image and gives `NaN`; its neighbourhood is unbounded, so clip below
16
+ * {@link STEREOGRAPHIC_DOMAIN_ANGLE} first (`sphericalPolylineClipToCap`). A
17
+ * `NaN` component gives `NaN` in each output it feeds.
18
+ */
19
+ /**
20
+ * The angular radius around the centre where the projection stops: `π`
21
+ * (exclusive).
22
+ */
23
+ export const STEREOGRAPHIC_DOMAIN_ANGLE = Math.PI;
24
+ /** Writes the plane point of the unit vector `point` into `out`. */
25
+ export function stereographicProject(out, point) {
26
+ const x = point[0];
27
+ if (x > -0.9999) {
28
+ const scale = 2 / (1 + x);
29
+ out[0] = point[1] * scale;
30
+ out[1] = point[2] * scale;
31
+ return out;
32
+ }
33
+ // Beyond x = −0.9999 (0.005% of the sphere, so the branch predicts well, and
34
+ // the plain form is good to 1e−12 before it) 1 + x
35
+ // cancels: on the unit sphere it is (y² + z²) / (1 − x), written with the
36
+ // transverse part scaled by its larger component so that it neither
37
+ // underflows nor overflows.
38
+ const y = point[1];
39
+ const z = point[2];
40
+ const largest = Math.max(Math.abs(y), Math.abs(z));
41
+ const a = y / largest;
42
+ const b = z / largest;
43
+ const scale = (2 * (1 - x)) / (largest * (a * a + b * b));
44
+ out[0] = a * scale;
45
+ out[1] = b * scale;
46
+ return out;
47
+ }
48
+ /**
49
+ * Writes the unit vector of the plane point `point` into `out`. Every finite
50
+ * point has one, however far (the scale is kept in range, so `1e200` gives the
51
+ * antipode's neighbourhood and not `NaN`); a non-finite coordinate gives
52
+ * `NaN`.
53
+ */
54
+ export function stereographicUnproject(out, point) {
55
+ const x = point[0];
56
+ const y = point[1];
57
+ const squared = x * x + y * y;
58
+ if (squared === Number.POSITIVE_INFINITY) {
59
+ // The square overflowed: work with the point divided by its larger
60
+ // coordinate (S12).
61
+ const largest = Math.max(Math.abs(x), Math.abs(y));
62
+ const a = x / largest;
63
+ const b = y / largest;
64
+ const inverse = 1 / largest;
65
+ const small = 4 * inverse * inverse;
66
+ const denominator = small + a * a + b * b;
67
+ out[0] = (small - a * a - b * b) / denominator;
68
+ out[1] = (4 * inverse * a) / denominator;
69
+ out[2] = (4 * inverse * b) / denominator;
70
+ return out;
71
+ }
72
+ const denominator = 4 + squared;
73
+ out[0] = (4 - squared) / denominator;
74
+ out[1] = (4 * x) / denominator;
75
+ out[2] = (4 * y) / denominator;
76
+ return out;
77
+ }
78
+ /**
79
+ * Rotates every unit vector of `input` (three numbers each) by `rotation`, then
80
+ * writes its plane point into `out` (two numbers each), in one pass: the sphere
81
+ * turns first, as for a view. `out` and `input` do not overlap. O(n).
82
+ *
83
+ * @returns `out`.
84
+ * @throws {RangeError} Unless `input` holds `n` vectors and `out` `n` points.
85
+ */
86
+ export function stereographicProjectArray(out, input, rotation) {
87
+ const count = elementCount_("stereographicProjectArray", out, input, 3, 2);
88
+ const m0 = rotation[0];
89
+ const m1 = rotation[1];
90
+ const m2 = rotation[2];
91
+ const m3 = rotation[3];
92
+ const m4 = rotation[4];
93
+ const m5 = rotation[5];
94
+ const m6 = rotation[6];
95
+ const m7 = rotation[7];
96
+ const m8 = rotation[8];
97
+ for (let index = 0; index < count; index++) {
98
+ const x = input[3 * index];
99
+ const y = input[3 * index + 1];
100
+ const z = input[3 * index + 2];
101
+ const depth = m0 * x + m3 * y + m6 * z;
102
+ const east = m1 * x + m4 * y + m7 * z;
103
+ const north = m2 * x + m5 * y + m8 * z;
104
+ if (depth > -0.9999) {
105
+ const scale = 2 / (1 + depth);
106
+ out[2 * index] = east * scale;
107
+ out[2 * index + 1] = north * scale;
108
+ }
109
+ else {
110
+ // The back half, as stereographicProject writes it.
111
+ const largest = Math.max(Math.abs(east), Math.abs(north));
112
+ const a = east / largest;
113
+ const b = north / largest;
114
+ const scale = (2 * (1 - depth)) / (largest * (a * a + b * b));
115
+ out[2 * index] = a * scale;
116
+ out[2 * index + 1] = b * scale;
117
+ }
118
+ }
119
+ return out;
120
+ }
121
+ /**
122
+ * Writes the unit vector of every plane point of `input` (two numbers each)
123
+ * into `out` (three numbers each), then turns it by the transpose of
124
+ * `rotation`: the inverse of {@link stereographicProjectArray}. O(n).
125
+ *
126
+ * @returns `out`.
127
+ * @throws {RangeError} Unless `input` holds `n` points and `out` `n` vectors.
128
+ */
129
+ export function stereographicUnprojectArray(out, input, rotation) {
130
+ const count = elementCount_("stereographicUnprojectArray", out, input, 2, 3);
131
+ const m0 = rotation[0];
132
+ const m1 = rotation[1];
133
+ const m2 = rotation[2];
134
+ const m3 = rotation[3];
135
+ const m4 = rotation[4];
136
+ const m5 = rotation[5];
137
+ const m6 = rotation[6];
138
+ const m7 = rotation[7];
139
+ const m8 = rotation[8];
140
+ for (let index = 0; index < count; index++) {
141
+ stereographicUnproject(VECTOR_, vec2Load(POINT_, input, index));
142
+ const x = VECTOR_[0];
143
+ const y = VECTOR_[1];
144
+ const z = VECTOR_[2];
145
+ out[3 * index] = m0 * x + m1 * y + m2 * z;
146
+ out[3 * index + 1] = m3 * x + m4 * y + m5 * z;
147
+ out[3 * index + 2] = m6 * x + m7 * y + m8 * z;
148
+ }
149
+ return out;
150
+ }
151
+ /**
152
+ * The plane distance from the centre of a point at angular distance `angle`:
153
+ * `2·tan(angle / 2)`. `NaN` for an angle outside `[0, π)`.
154
+ */
155
+ export function stereographicRadius(angle) {
156
+ return angle >= 0 && angle < Math.PI ? 2 * Math.tan(angle / 2) : Number.NaN;
157
+ }
158
+ /**
159
+ * The angular distance of a point at plane distance `radius`: `2·atan(radius /
160
+ * 2)`, the inverse of {@link stereographicRadius}. `NaN` for a negative or
161
+ * non-finite radius.
162
+ */
163
+ export function stereographicAngle(radius) {
164
+ return radius >= 0 && radius < Number.POSITIVE_INFINITY
165
+ ? 2 * Math.atan(radius / 2)
166
+ : Number.NaN;
167
+ }
168
+ //# sourceMappingURL=stereographic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stereographic.js","sourceRoot":"","sources":["../../src/azimuthal/stereographic.ts"],"names":[],"mappings":"AAAA,OAAO,EAMN,UAAU,EACV,QAAQ,EACR,UAAU,GACV,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;AAC5B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;AAE7B;;;;;;;;;;;;;GAaG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAW,IAAI,CAAC,EAAE,CAAC;AAE1D,oEAAoE;AACpE,MAAM,UAAU,oBAAoB,CAAC,GAAS,EAAE,KAAmB;IAClE,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACnB,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;QACjB,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1B,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;QAC1B,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC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,CAAC;AAC7E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAChD,OAAO,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,MAAM,CAAC,iBAAiB;QACtD,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3B,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AACf,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * The constants of a conic projection, computed once from its two standard
3
+ * parallels (radians): `n` is the cone constant (the plane angle per radian of
4
+ * longitude; negative south of the equator, `0` for the cylindrical limit of
5
+ * parallels symmetric about the equator), `a` a constant of the projection that
6
+ * the three families use alike. Made by `conicEqualAreaCreate`,
7
+ * `conicConformalCreate` or `conicEquidistantCreate`; a record is only valid
8
+ * for the functions of the family that made it. The unit sphere is the model,
9
+ * the cone's apex at the pole of the standard parallels, and the plane's origin
10
+ * at longitude `0` on the equator.
11
+ */
12
+ export type ConicProjection = Readonly<{
13
+ /** The family that made the record. */
14
+ kind: "conic-equal-area" | "conic-conformal" | "conic-equidistant";
15
+ /** The cone constant, `0` when the parallels are symmetric about the equator. */
16
+ n: number;
17
+ /**
18
+ * The family's constant: `√C` (equal-area), `G` (conformal), `K`
19
+ * (equidistant).
20
+ */
21
+ a: number;
22
+ }>;
23
+ /** A cone constant closer to zero than this is the cylindrical limit. */
24
+ export declare const CONIC_CYLINDRICAL_LIMIT_ = 1e-12;
25
+ /**
26
+ * The families' writers only ever see buffers (S23): a single value goes
27
+ * through this pair, copied out at once.
28
+ */
29
+ export declare const CONIC_PAIR_: Float64Array<ArrayBuffer>;
30
+ /**
31
+ * How far past the map's edge a rounded point may lie and still be taken for
32
+ * it.
33
+ */
34
+ export declare const CONIC_EDGE_TOLERANCE_: number;
35
+ /**
36
+ * Throws `RangeError` unless both standard parallels are finite and within
37
+ * `[−π/2, π/2]`.
38
+ */
39
+ export declare function assertParallels_(name: string, standardParallel1: number, standardParallel2: number): void;
40
+ /**
41
+ * Writes the plane point of a conic family into `out[offset]`, `out[offset +
42
+ * 1]` from the family's two quantities at the latitude: `radius` (`n·ρ`, `ρ`
43
+ * the distance from the apex) and `drop` (`ρ₀ − ρ`, the northing of the
44
+ * parallel on the central meridian). `x = ρ·sin(nλ)` and `y = (ρ₀ − ρ) + ρ·(1 −
45
+ * cos(nλ))`, the second written so that no digits cancel as `n → 0`.
46
+ */
47
+ export declare function conicWrite_(out: Float64Array, offset: number, n: number, radius: number, drop: number, longitude: number): void;
48
+ /** The distance `n·ρ` from the apex, scaled by `n`, of the plane point `(x, y)`. */
49
+ export declare function conicRadius_(n: number, a: number, x: number, y: number): number;
50
+ /**
51
+ * The longitude of the plane point `(x, y)`, `θ / n`; `0` at the apex (a pole,
52
+ * where every longitude is the same point and the rounded `θ` may be `π`).
53
+ */
54
+ export declare function conicLongitude_(n: number, a: number, x: number, y: number): number;
55
+ //# sourceMappingURL=_conic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_conic.d.ts","sourceRoot":"","sources":["../../src/conic/_conic.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACtC,uCAAuC;IACvC,IAAI,EAAE,kBAAkB,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;IACnE,iFAAiF;IACjF,CAAC,EAAE,MAAM,CAAC;IACV;;;OAGG;IACH,CAAC,EAAE,MAAM,CAAC;CACV,CAAC,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,WAAW,2BAAsB,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,qBAAqB,QAAW,CAAC;AAE9C;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,IAAI,EAAE,MAAM,EACZ,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,GACvB,IAAI,CAUN;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAC1B,GAAG,EAAE,YAAY,EACjB,MAAM,EAAE,MAAM,EACd,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GACf,IAAI,CASN;AAED,oFAAoF;AACpF,wBAAgB,YAAY,CAC3B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACP,MAAM,CAIR;AAQD;;;GAGG;AACH,wBAAgB,eAAe,CAC9B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACP,MAAM,CAUR"}
@@ -0,0 +1,68 @@
1
+ import { describeValue } from "@ac-kit/core";
2
+ /** A cone constant closer to zero than this is the cylindrical limit. */
3
+ export const CONIC_CYLINDRICAL_LIMIT_ = 1e-12;
4
+ /**
5
+ * The families' writers only ever see buffers (S23): a single value goes
6
+ * through this pair, copied out at once.
7
+ */
8
+ export const CONIC_PAIR_ = new Float64Array(2);
9
+ /**
10
+ * How far past the map's edge a rounded point may lie and still be taken for
11
+ * it.
12
+ */
13
+ export const CONIC_EDGE_TOLERANCE_ = 2 ** -40;
14
+ /**
15
+ * Throws `RangeError` unless both standard parallels are finite and within
16
+ * `[−π/2, π/2]`.
17
+ */
18
+ export function assertParallels_(name, standardParallel1, standardParallel2) {
19
+ const half = Math.PI / 2;
20
+ if (!(Math.abs(standardParallel1) <= half) ||
21
+ !(Math.abs(standardParallel2) <= half)) {
22
+ throw new RangeError(`${name}: the standard parallels must be within [−π/2, π/2] radians, got ${describeValue(standardParallel1)} and ${describeValue(standardParallel2)}.`);
23
+ }
24
+ }
25
+ /**
26
+ * Writes the plane point of a conic family into `out[offset]`, `out[offset +
27
+ * 1]` from the family's two quantities at the latitude: `radius` (`n·ρ`, `ρ`
28
+ * the distance from the apex) and `drop` (`ρ₀ − ρ`, the northing of the
29
+ * parallel on the central meridian). `x = ρ·sin(nλ)` and `y = (ρ₀ − ρ) + ρ·(1 −
30
+ * cos(nλ))`, the second written so that no digits cancel as `n → 0`.
31
+ */
32
+ export function conicWrite_(out, offset, n, radius, drop, longitude) {
33
+ if (n === 0) {
34
+ out[offset] = radius * longitude;
35
+ out[offset + 1] = drop;
36
+ return;
37
+ }
38
+ const half = Math.sin((n * longitude) / 2);
39
+ out[offset] = (radius * Math.sin(n * longitude)) / n;
40
+ out[offset + 1] = drop + (2 * radius * half * half) / n;
41
+ }
42
+ /** The distance `n·ρ` from the apex, scaled by `n`, of the plane point `(x, y)`. */
43
+ export function conicRadius_(n, a, x, y) {
44
+ const across = n * x;
45
+ const along = a - n * y;
46
+ return Math.sqrt(across * across + along * along);
47
+ }
48
+ /**
49
+ * How close to the apex, relative to `a`, a plane point is taken for it: the
50
+ * forward maps put a pole there to within a few roundings.
51
+ */
52
+ const CONIC_APEX_TOLERANCE_ = 16 * Number.EPSILON;
53
+ /**
54
+ * The longitude of the plane point `(x, y)`, `θ / n`; `0` at the apex (a pole,
55
+ * where every longitude is the same point and the rounded `θ` may be `π`).
56
+ */
57
+ export function conicLongitude_(n, a, x, y) {
58
+ if (n === 0) {
59
+ return x / a;
60
+ }
61
+ const across = n * x;
62
+ const along = a - n * y;
63
+ if (Math.abs(across) + Math.abs(along) <= CONIC_APEX_TOLERANCE_ * a) {
64
+ return 0;
65
+ }
66
+ return Math.atan2(across, along) / n;
67
+ }
68
+ //# sourceMappingURL=_conic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_conic.js","sourceRoot":"","sources":["../../src/conic/_conic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAyB7C,yEAAyE;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG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,CAAC;AACzD,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,YAAY,CAC3B,CAAS,EACT,CAAS,EACT,CAAS,EACT,CAAS;IAET,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,qBAAqB,GAAG,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;AAElD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC9B,CAAS,EACT,CAAS,EACT,CAAS,EACT,CAAS;IAET,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACb,OAAO,CAAC,GAAG,CAAC,CAAC;IACd,CAAC;IACD,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,qBAAqB,GAAG,CAAC,EAAE,CAAC;QACrE,OAAO,CAAC,CAAC;IACV,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC"}
@@ -0,0 +1,52 @@
1
+ import type { LongitudeLatitude, ReadonlyLongitudeLatitude } from "@ac-kit/math-geometry";
2
+ import type { ReadonlyVec2, Vec2 } from "@ac-kit/math-linear";
3
+ import { type ConicProjection } from "./_conic.js";
4
+ /**
5
+ * Lambert's conformal conic projection (Snyder, _Map Projections — A Working
6
+ * Manual_, 1987, §15, spherical form, on the unit sphere): with the standard
7
+ * parallels `φ₁`, `φ₂`, `ψ = asinh(tan φ)` (the isometric latitude, `ln tan(π/4 +
8
+ * φ/2)`), `n = ln(cos φ₁ / cos φ₂) / (ψ₂ − ψ₁)` (`sin φ₁` when the parallels
9
+ * are equal), `ρ = F·e^(−nψ)` and `F = cos φ₁·e^(nψ₁) / n`, `x = ρ·sin (nλ)`,
10
+ * `y = ρ₀ − ρ·cos(nλ)`. The formulas are rearranged so that no digits cancel as
11
+ * `n → 0`, where the map becomes Mercator's (a cone constant within `1e−12` of
12
+ * `0` is that limit exactly, inverted as Mercator's is, poles included). The
13
+ * pole farthest from the apex has no image: it gives `±∞` or `NaN`; the apex
14
+ * inverts to its pole. Inputs are longitude–latitude pairs in radians; a
15
+ * longitude outside `[−π, π]` or a latitude outside `[−π/2, π/2]` gives `NaN`,
16
+ * as does a `NaN` component. The inverses need plane coordinates below `1e150`
17
+ * in magnitude.
18
+ */
19
+ /**
20
+ * Makes the record for the standard parallels `standardParallel1` and
21
+ * `standardParallel2`, in radians, once; it is reused by every call.
22
+ *
23
+ * @throws {RangeError} Unless both parallels are strictly within `(−π/2, π/2)`:
24
+ * a pole is no standard parallel of a conformal cone.
25
+ */
26
+ export declare function conicConformalCreate(standardParallel1: number, standardParallel2: number): ConicProjection;
27
+ /** Writes the plane point of `coords` into `out`. */
28
+ export declare function conicConformalProject(out: Vec2, coords: ReadonlyLongitudeLatitude, projection: ConicProjection): Vec2;
29
+ /**
30
+ * Writes the longitude and latitude of the plane point `point` into `out`; a
31
+ * point outside the map gives `NaN`.
32
+ */
33
+ export declare function conicConformalUnproject(out: LongitudeLatitude, point: ReadonlyVec2, projection: ConicProjection): LongitudeLatitude;
34
+ /**
35
+ * Writes the plane point of every longitude–latitude pair of `input` into `out`
36
+ * (as many numbers), as {@link conicConformalProject} does for one. `out` may be
37
+ * `input`. O(n).
38
+ *
39
+ * @returns `out`.
40
+ * @throws {RangeError} Unless `out` and `input` have the same even length.
41
+ */
42
+ export declare function conicConformalProjectArray<T extends Float64Array>(out: T, input: Float64Array, projection: ConicProjection): T;
43
+ /**
44
+ * Writes the longitude–latitude pair of every plane point of `input` into `out`
45
+ * (as many numbers), as {@link conicConformalUnproject} does for one. `out` may
46
+ * be `input`. O(n).
47
+ *
48
+ * @returns `out`.
49
+ * @throws {RangeError} Unless `out` and `input` have the same even length.
50
+ */
51
+ export declare function conicConformalUnprojectArray<T extends Float64Array>(out: T, input: Float64Array, projection: ConicProjection): T;
52
+ //# sourceMappingURL=conic-conformal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conic-conformal.d.ts","sourceRoot":"","sources":["../../src/conic/conic-conformal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,yBAAyB,EACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAI9D,OAAO,EAKN,KAAK,eAAe,EAGpB,MAAM,aAAa,CAAC;AAIrB;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CACnC,iBAAiB,EAAE,MAAM,EACzB,iBAAiB,EAAE,MAAM,GACvB,eAAe,CAkCjB;AA+DD,qDAAqD;AACrD,wBAAgB,qBAAqB,CACpC,GAAG,EAAE,IAAI,EACT,MAAM,EAAE,yBAAyB,EACjC,UAAU,EAAE,eAAe,GACzB,IAAI,CAKN;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,eAAe,GACzB,iBAAiB,CAKnB;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,YAAY,EAChE,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,eAAe,GACzB,CAAC,CAYH;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,YAAY,EAClE,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,eAAe,GACzB,CAAC,CAYH"}