nodes2ts 1.1.9 → 3.0.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 (105) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.cjs +11 -0
  3. package/.github/workflows/lint.js.yml +22 -0
  4. package/.github/workflows/node.js.yml +22 -0
  5. package/.mocharc.js +7 -0
  6. package/README.md +22 -5
  7. package/dist/Interval.d.ts +7 -8
  8. package/dist/Interval.js +12 -12
  9. package/dist/Interval.js.map +1 -1
  10. package/dist/MutableInteger.js +5 -4
  11. package/dist/MutableInteger.js.map +1 -1
  12. package/dist/Platform.d.ts +15 -0
  13. package/dist/Platform.js +53 -0
  14. package/dist/Platform.js.map +1 -0
  15. package/dist/R1Interval.d.ts +8 -9
  16. package/dist/R1Interval.js +59 -78
  17. package/dist/R1Interval.js.map +1 -1
  18. package/dist/R2Vector.d.ts +12 -13
  19. package/dist/R2Vector.js +65 -85
  20. package/dist/R2Vector.js.map +1 -1
  21. package/dist/S1Angle.d.ts +38 -5
  22. package/dist/S1Angle.js +89 -37
  23. package/dist/S1Angle.js.map +1 -1
  24. package/dist/S1ChordAngle.d.ts +166 -0
  25. package/dist/S1ChordAngle.js +318 -0
  26. package/dist/S1ChordAngle.js.map +1 -0
  27. package/dist/S1Interval.d.ts +11 -12
  28. package/dist/S1Interval.js +134 -140
  29. package/dist/S1Interval.js.map +1 -1
  30. package/dist/S2.d.ts +8 -5
  31. package/dist/S2.js +91 -108
  32. package/dist/S2.js.map +1 -1
  33. package/dist/S2Cap.d.ts +33 -25
  34. package/dist/S2Cap.js +199 -203
  35. package/dist/S2Cap.js.map +1 -1
  36. package/dist/S2Cell.d.ts +15 -13
  37. package/dist/S2Cell.js +196 -206
  38. package/dist/S2Cell.js.map +1 -1
  39. package/dist/S2CellId.d.ts +37 -14
  40. package/dist/S2CellId.js +407 -359
  41. package/dist/S2CellId.js.map +1 -1
  42. package/dist/S2CellUnion.d.ts +1 -2
  43. package/dist/S2CellUnion.js +137 -133
  44. package/dist/S2CellUnion.js.map +1 -1
  45. package/dist/S2EdgeUtil.js +14 -17
  46. package/dist/S2EdgeUtil.js.map +1 -1
  47. package/dist/S2LatLng.d.ts +15 -11
  48. package/dist/S2LatLng.js +100 -114
  49. package/dist/S2LatLng.js.map +1 -1
  50. package/dist/S2LatLngRect.d.ts +8 -4
  51. package/dist/S2LatLngRect.js +215 -197
  52. package/dist/S2LatLngRect.js.map +1 -1
  53. package/dist/S2Metric.d.ts +4 -5
  54. package/dist/S2Metric.js +30 -27
  55. package/dist/S2Metric.js.map +1 -1
  56. package/dist/S2Point.d.ts +48 -14
  57. package/dist/S2Point.js +156 -109
  58. package/dist/S2Point.js.map +1 -1
  59. package/dist/S2Projections.d.ts +43 -9
  60. package/dist/S2Projections.js +226 -47
  61. package/dist/S2Projections.js.map +1 -1
  62. package/dist/S2Region.js +2 -1
  63. package/dist/S2Region.js.map +1 -1
  64. package/dist/S2RegionCoverer.d.ts +21 -6
  65. package/dist/S2RegionCoverer.js +144 -109
  66. package/dist/S2RegionCoverer.js.map +1 -1
  67. package/dist/export.d.ts +0 -1
  68. package/dist/export.js +42 -32
  69. package/dist/export.js.map +1 -1
  70. package/dist/utils/preconditions.d.ts +2 -0
  71. package/dist/utils/preconditions.js +16 -0
  72. package/dist/utils/preconditions.js.map +1 -0
  73. package/package.json +28 -34
  74. package/.npmignore +0 -8
  75. package/.nyc_output/1eb1f420a13c15f529aac41a40bcaa21.json +0 -1
  76. package/.nyc_output/5ff62256eb1c111254ba0b469fb547da.json +0 -1
  77. package/.nyc_output/949d6e8c2061067f3bdfd27dfff5ba83.json +0 -1
  78. package/coverage/Interval.ts.html +0 -203
  79. package/coverage/MutableInteger.ts.html +0 -77
  80. package/coverage/R1Interval.ts.html +0 -647
  81. package/coverage/R2Vector.ts.html +0 -587
  82. package/coverage/S1Angle.ts.html +0 -344
  83. package/coverage/S1Interval.ts.html +0 -1349
  84. package/coverage/S2.ts.html +0 -1178
  85. package/coverage/S2Cap.ts.html +0 -1433
  86. package/coverage/S2Cell.ts.html +0 -1415
  87. package/coverage/S2CellId.ts.html +0 -3329
  88. package/coverage/S2EdgeUtil.ts.html +0 -2534
  89. package/coverage/S2LatLng.ts.html +0 -848
  90. package/coverage/S2LatLngRect.ts.html +0 -2222
  91. package/coverage/S2Point.ts.html +0 -758
  92. package/coverage/S2Projections.ts.html +0 -518
  93. package/coverage/base.css +0 -212
  94. package/coverage/decimal.ts.html +0 -68
  95. package/coverage/index.html +0 -288
  96. package/coverage/prettify.css +0 -1
  97. package/coverage/prettify.js +0 -1
  98. package/coverage/sort-arrow-sprite.png +0 -0
  99. package/coverage/sorter.js +0 -158
  100. package/dist/decimal.d.ts +0 -3
  101. package/dist/decimal.js +0 -4
  102. package/dist/decimal.js.map +0 -1
  103. package/dist/decimal_augmentation.d.ts +0 -24
  104. package/dist/decimal_augmentation.js +0 -2
  105. package/dist/decimal_augmentation.js.map +0 -1
package/dist/S2.js CHANGED
@@ -1,30 +1,22 @@
1
1
  "use strict";
2
- var S2Point_1 = require("./S2Point");
3
- var decimal_1 = require('./decimal');
4
- var S2Metric_1 = require("./S2Metric");
5
- exports.S2Metric = S2Metric_1.S2Metric;
6
- var Long = require('long');
7
- var S2 = (function () {
8
- function S2() {
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.S2Metric = exports.S2 = void 0;
4
+ const S2Point_1 = require("./S2Point");
5
+ const S2Metric_1 = require("./S2Metric");
6
+ Object.defineProperty(exports, "S2Metric", { enumerable: true, get: function () { return S2Metric_1.S2Metric; } });
7
+ const Platform_1 = require("./Platform");
8
+ const Long = require("long");
9
+ class S2 {
10
+ static IEEEremainder(f1, f2) {
11
+ return Platform_1.Platform.IEEEremainder(f1, f2);
9
12
  }
10
- S2.IEEEremainder = function (_f1, _f2) {
11
- var f1 = S2.toDecimal(_f1);
12
- var f2 = S2.toDecimal(_f2);
13
- var r = f1.mod(f2);
14
- if (r.isNaN() || r.eq(f2) || r.lessThanOrEqualTo(f2.abs().dividedBy(2))) {
15
- return r;
16
- }
17
- else {
18
- return (f1.gte(0) ? S2.toDecimal(1) : S2.toDecimal(-1)).times(r.minus(f2));
19
- }
20
- };
21
13
  /**
22
14
  * Return true if the given point is approximately unit length (this is mainly
23
15
  * useful for assertions).
24
16
  */
25
- S2.isUnitLength = function (p) {
26
- return p.norm2().minus(1).abs().lte(1e-15);
27
- };
17
+ static isUnitLength(p) {
18
+ return Math.abs(p.norm2() - 1) <= (1e-15);
19
+ }
28
20
  /**
29
21
  * If v is non-zero, return an integer {@code exp} such that
30
22
  * {@code (0.5 <= |v|*2^(-exp) < 1)}. If v is zero, return 0.
@@ -36,21 +28,9 @@ var S2 = (function () {
36
28
  *
37
29
  * TODO(dbeaumont): Replace this with "DoubleUtils.getExponent(v) - 1" ?
38
30
  */
39
- S2.exp = function (v /*double*/) {
40
- if (v == 0) {
41
- return 0;
42
- }
43
- // IT should always be ((int)log(2,v))+1;
44
- var start = Math.floor(Math.log(v) / Math.log(2));
45
- for (var i = start; i < start + 10; i++) {
46
- var curVal = Math.abs(v) * Math.pow(2, -i);
47
- if (curVal >= 0.5 && curVal < 1) {
48
- return i;
49
- }
50
- }
51
- throw new Error('method not written yet');
52
- // return (int)((S2.EXPONENT_MASK & bits) >> S2.EXPONENT_SHIFT) - 1022;
53
- };
31
+ static exp(v /*double*/) {
32
+ return Platform_1.Platform.getExponent(v);
33
+ }
54
34
  /**
55
35
  * Return a vector "c" that is orthogonal to the given unit-length vectors "a"
56
36
  * and "b". This function is similar to a.CrossProd(b) except that it does a
@@ -63,7 +43,7 @@ var S2 = (function () {
63
43
  * a == -b (3) RCP(-a,b) == -RCP(a,b) unless a == b or a == -b (4) RCP(a,-b)
64
44
  * == -RCP(a,b) unless a == b or a == -b
65
45
  */
66
- S2.robustCrossProd = function (a, b) {
46
+ static robustCrossProd(a, b) {
67
47
  // The direction of a.CrossProd(b) becomes unstable as (a + b) or (a - b)
68
48
  // approaches zero. This leads to situations where a.CrossProd(b) is not
69
49
  // very orthogonal to "a" and/or "b". We could fix this using Gram-Schmidt,
@@ -73,14 +53,14 @@ var S2 = (function () {
73
53
  // Given that "a" and "b" are unit-length, this has good orthogonality to
74
54
  // "a" and "b" even if they differ only in the lowest bit of one component.
75
55
  // assert (isUnitLength(a) && isUnitLength(b));
76
- var x = S2Point_1.S2Point.crossProd(S2Point_1.S2Point.add(b, a), S2Point_1.S2Point.sub(b, a));
56
+ const x = S2Point_1.S2Point.crossProd(S2Point_1.S2Point.add(b, a), S2Point_1.S2Point.sub(b, a));
77
57
  if (!x.equals(new S2Point_1.S2Point(0, 0, 0))) {
78
58
  return x;
79
59
  }
80
60
  // The only result that makes sense mathematically is to return zero, but
81
61
  // we find it more convenient to return an arbitrary orthogonal vector.
82
62
  return a.ortho();
83
- };
63
+ }
84
64
  /**
85
65
  * Return the area of triangle ABC. The method used is about twice as
86
66
  * expensive as Girard's formula, but it is numerically stable for both large
@@ -91,7 +71,7 @@ var S2 = (function () {
91
71
  * becomes numerically unstable as the length of any edge approaches 180
92
72
  * degrees.
93
73
  */
94
- S2.area = function (a, b, c) {
74
+ static area(a, b, c) {
95
75
  // This method is based on l'Huilier's theorem,
96
76
  //
97
77
  // tan(E/4) = sqrt(tan(s/2) tan((s-a)/2) tan((s-b)/2) tan((s-c)/2))
@@ -125,52 +105,43 @@ var S2 = (function () {
125
105
  // quantities to 64 bits. Otherwise it may compute a value of dmin > 0
126
106
  // simply because it chose to spill one of the intermediate values to
127
107
  // memory but not one of the others.
128
- var sa = b.angle(c);
129
- var sb = c.angle(a);
130
- var sc = a.angle(b);
131
- var s = sa.plus(sb).plus(sc).times(0.5);
108
+ const sa = b.angle(c);
109
+ const sb = c.angle(a);
110
+ const sc = a.angle(b);
111
+ const s = sa + (sb) + (sc) * (0.5);
132
112
  // 0.5 * (sa + sb + sc);
133
- if (s.gte(3e-4)) {
113
+ if (s >= (3e-4)) {
134
114
  // Consider whether Girard's formula might be more accurate.
135
- var s2 = s.pow(2);
136
- var dmin = s.minus(decimal_1.Decimal.max(sa, sb, sc));
137
- if (dmin.lt(s2.pow(2).times(s).times(1e-2))) {
115
+ const s2 = s * 2;
116
+ const dmin = s - Math.max(sa, sb, sc);
117
+ if (dmin < (s2 * s2 * (s) * (1e-2))) {
138
118
  // This triangle is skinny enough to consider Girard's formula.
139
- var area = S2.girardArea(a, b, c);
140
- if (dmin.lt(s.times(area.times(0.1)))) {
119
+ const area = S2.girardArea(a, b, c);
120
+ if (dmin < (s * (area * (0.1)))) {
141
121
  return area;
142
122
  }
143
123
  }
144
124
  }
145
125
  // Use l'Huilier's formula.
146
- return S2.toDecimal(4)
147
- .times(decimal_1.Decimal.atan(decimal_1.Decimal.sqrt(decimal_1.Decimal.max(0.0, decimal_1.Decimal.tan(s.times(0.5))
148
- .times(decimal_1.Decimal.tan(s.minus(sa).times(0.5)))
149
- .times(decimal_1.Decimal.tan(s.minus(sb).times(0.5)))
150
- .times(decimal_1.Decimal.tan(s.minus(sc).times(0.5)))))));
151
- };
126
+ return 4 * (Math.atan(Math.sqrt(Math.max(0.0, Math.tan(s * (0.5))
127
+ * (Math.tan(s - (sa) * (0.5)))
128
+ * (Math.tan(s - (sb) * (0.5)))
129
+ * (Math.tan(s - (sc) * (0.5)))))));
130
+ }
152
131
  /**
153
132
  * Return the area of the triangle computed using Girard's formula. This is
154
133
  * slightly faster than the Area() method above is not accurate for very small
155
134
  * triangles.
156
135
  */
157
- S2.girardArea = function (a, b, c) {
136
+ static girardArea(a, b, c) {
158
137
  // This is equivalent to the usual Girard's formula but is slightly
159
138
  // more accurate, faster to compute, and handles a == b == c without
160
139
  // a special case.
161
- var ab = S2Point_1.S2Point.crossProd(a, b);
162
- var bc = S2Point_1.S2Point.crossProd(b, c);
163
- var ac = S2Point_1.S2Point.crossProd(a, c);
164
- return decimal_1.Decimal.max(0, ab.angle(ac)
165
- .minus(ab.angle(bc))
166
- .plus(bc.angle(ac)));
167
- };
168
- S2.toDecimal = function (value) {
169
- if (typeof (value) === 'number' || typeof (value) === 'string') {
170
- return new decimal_1.Decimal(value);
171
- }
172
- return value;
173
- };
140
+ const ab = S2Point_1.S2Point.crossProd(a, b);
141
+ const bc = S2Point_1.S2Point.crossProd(b, c);
142
+ const ac = S2Point_1.S2Point.crossProd(a, c);
143
+ return Math.max(0, ab.angle(ac) - ab.angle(bc) + bc.angle(ac));
144
+ }
174
145
  /**
175
146
  * Return true if the points A, B, C are strictly counterclockwise. Return
176
147
  * false if the points are clockwise or colinear (i.e. if they are all
@@ -184,7 +155,7 @@ var S2 = (function () {
184
155
  *
185
156
  * In other words, ABC and CBA are guaranteed not to be both CCW
186
157
  */
187
- S2.simpleCCW = function (a, b, c) {
158
+ static simpleCCW(a, b, c) {
188
159
  // We compute the signed volume of the parallelepiped ABC. The usual
189
160
  // formula for this is (AxB).C, but we compute it here using (CxA).B
190
161
  // in order to ensure that ABC and CBA are not both CCW. This follows
@@ -193,8 +164,8 @@ var S2 = (function () {
193
164
  //
194
165
  // (1) x.CrossProd(y) == -(y.CrossProd(x))
195
166
  // (2) (-x).DotProd(y) == -(x.DotProd(y))
196
- return S2Point_1.S2Point.crossProd(c, a).dotProd(b).gt(0);
197
- };
167
+ return S2Point_1.S2Point.crossProd(c, a).dotProd(b) > 0;
168
+ }
198
169
  /**
199
170
  *
200
171
  * Return true if edge AB crosses CD at a point that is interior to both
@@ -203,46 +174,58 @@ var S2 = (function () {
203
174
  * (1) SimpleCrossing(b,a,c,d) == SimpleCrossing(a,b,c,d) (2)
204
175
  * SimpleCrossing(c,d,a,b) == SimpleCrossing(a,b,c,d)
205
176
  */
206
- S2.simpleCrossing = function (a, b, c, d) {
177
+ static simpleCrossing(a, b, c, d) {
207
178
  // We compute SimpleCCW() for triangles ACB, CBD, BDA, and DAC. All
208
179
  // of these triangles need to have the same orientation (CW or CCW)
209
180
  // for an intersection to exist. Note that this is slightly more
210
181
  // restrictive than the corresponding definition for planar edges,
211
182
  // since we need to exclude pairs of line segments that would
212
183
  // otherwise "intersect" by crossing two antipodal points.
213
- var ab = S2Point_1.S2Point.crossProd(a, b);
214
- var cd = S2Point_1.S2Point.crossProd(c, d);
215
- var acb = ab.dotProd(c).neg();
216
- var cbd = cd.dotProd(b).neg();
217
- var bda = ab.dotProd(d);
218
- var dac = cd.dotProd(a);
219
- return (acb.times(cbd).gt(0)) && (cbd.times(bda).gt(0)) && (bda.times(dac).gt(0));
220
- };
221
- S2.M_PI = Math.PI;
222
- S2.M_1_PI = 1.0 / Math.PI;
223
- S2.M_PI_2 = Math.PI / 2.0;
224
- S2.M_PI_4 = Math.PI / 4.0;
225
- S2.M_SQRT2 = Math.sqrt(2);
226
- S2.M_E = Math.E;
227
- // the axis directions are reversed).
228
- S2.SWAP_MASK = 0x01;
229
- S2.INVERT_MASK = 0x02;
230
- // Number of bits in the mantissa of a double.
231
- S2.EXPONENT_SHIFT = 52;
232
- // Mask to extract the exponent from a double.
233
- S2.EXPONENT_MASK = Long.fromString('0x7ff0000000000000', true, 16);
234
- /** Mapping from cell orientation + Hilbert traversal to IJ-index. */
235
- S2.POS_TO_ORIENTATION = [S2.SWAP_MASK, 0, 0, S2.INVERT_MASK + S2.SWAP_MASK];
236
- S2.POS_TO_IJ = [
237
- // 0 1 2 3
238
- [0, 1, 3, 2],
239
- [0, 2, 3, 1],
240
- [3, 2, 0, 1],
241
- [3, 1, 0, 2],
242
- ];
243
- S2.MAX_LEVEL = 30;
244
- S2.Metric = S2Metric_1.S2Metric;
245
- return S2;
246
- }());
184
+ const ab = S2Point_1.S2Point.crossProd(a, b);
185
+ const cd = S2Point_1.S2Point.crossProd(c, d);
186
+ const acb = ab.dotProd(c) * -1;
187
+ const cbd = cd.dotProd(b) * -1;
188
+ const bda = ab.dotProd(d);
189
+ const dac = cd.dotProd(a);
190
+ return (acb * (cbd) > (0)) && (cbd * (bda) > (0)) && (bda * (dac) > (0));
191
+ }
192
+ static approxEqualsPointError(a, b, maxError) {
193
+ return a.angle(b) <= maxError;
194
+ }
195
+ static approxEqualsPoint(a, b) {
196
+ return this.approxEqualsPointError(a, b, 1e-15);
197
+ }
198
+ static approxEqualsNumberError(a, b, maxError) {
199
+ return Math.abs(a - b) <= maxError;
200
+ }
201
+ static approxEqualsNumber(a, b) {
202
+ return this.approxEqualsNumberError(a, b, 1e-15);
203
+ }
204
+ }
247
205
  exports.S2 = S2;
206
+ S2.M_PI = Math.PI;
207
+ S2.M_1_PI = 1.0 / Math.PI;
208
+ S2.M_PI_2 = Math.PI / 2.0;
209
+ S2.M_PI_4 = Math.PI / 4.0;
210
+ S2.M_SQRT2 = Math.sqrt(2);
211
+ S2.M_E = Math.E;
212
+ // the axis directions are reversed).
213
+ S2.SWAP_MASK = 0x01;
214
+ S2.INVERT_MASK = 0x02;
215
+ // Number of bits in the mantissa of a double.
216
+ S2.EXPONENT_SHIFT = 52;
217
+ // Mask to extract the exponent from a double.
218
+ S2.EXPONENT_MASK = Long.fromString('0x7ff0000000000000', true, 16);
219
+ /** Mapping from cell orientation + Hilbert traversal to IJ-index. */
220
+ S2.POS_TO_ORIENTATION = [S2.SWAP_MASK, 0, 0, S2.INVERT_MASK + S2.SWAP_MASK];
221
+ S2.DBL_EPSILON = 2 * Number.EPSILON;
222
+ S2.POS_TO_IJ = [
223
+ // 0 1 2 3
224
+ [0, 1, 3, 2],
225
+ [0, 2, 3, 1],
226
+ [3, 2, 0, 1],
227
+ [3, 1, 0, 2], // swapped & inverted: (1,1), (0,1), (0,0), (1,0)
228
+ ];
229
+ S2.MAX_LEVEL = 30;
230
+ S2.Metric = S2Metric_1.S2Metric;
248
231
  //# sourceMappingURL=S2.js.map
package/dist/S2.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"S2.js","sourceRoot":"","sources":["../src/S2.ts"],"names":[],"mappings":";AAAA,wBAAsB,WAAW,CAAC,CAAA;AAClC,wBAAsB,WAAW,CAAC,CAAA;AAClC,yBAAuB,YAAY,CAAC,CAAA;AAyR3B,gBAAQ;A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;AACvB,SAAM,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;AACvB,SAAM,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;AACvB,UAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACvB,MAAG,GAAG,IAAI,CAAC,CAAC,CAAC;AAC3B,qCAAqC;AACvB,YAAS,GAAG,IAAI,CAAC;AACjB,cAAW,GAAG,IAAI,CAAC;AAEjC,8CAA8C;AAC/B,iBAAc,GAAG,EAAE,CAAC;AACnC,8CAA8C;AAC/B,gBAAa,GAAG,IAAI,CAAC,UAAU,CAAC,oBAAoB,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;AAC/E,qEAAqE;AACvD,qBAAkB,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;AACzE,cAAW,GAAG,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;AAEjC,YAAS,GAAG;IACxB,UAAU;IACV,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACZ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACZ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACZ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,iDAAiD;CAChE,CAAC;AACK,YAAS,GAAG,EAAE,CAAC;AAuOf,SAAM,GAAG,mBAAQ,CAAA"}
package/dist/S2Cap.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- /// <reference types="decimal.js" />
2
1
  import { S2Region } from "./S2Region";
3
2
  import { S2Point } from "./S2Point";
4
3
  import { S1Angle } from "./S1Angle";
5
4
  import { S2LatLngRect } from "./S2LatLngRect";
6
5
  import { S2Cell } from "./S2Cell";
6
+ import { S1ChordAngle } from "./S1ChordAngle";
7
7
  /**
8
8
  * This class represents a spherical cap, i.e. a portion of a sphere cut off by
9
9
  * a plane. The cap is defined by its axis and height. This representation has
@@ -26,13 +26,19 @@ export declare class S2Cap implements S2Region {
26
26
  */
27
27
  private static ROUND_UP;
28
28
  axis: S2Point;
29
- height: decimal.Decimal;
29
+ radius: S1ChordAngle;
30
30
  /**
31
31
  * Create a cap given its axis and the cap height, i.e. the maximum projected
32
32
  * distance along the cap axis from the cap center. 'axis' should be a
33
33
  * unit-length vector.
34
34
  */
35
- constructor(axis: S2Point, _height: number | decimal.Decimal);
35
+ constructor(axis: S2Point, radius: S1ChordAngle);
36
+ static fromAxisChord(center: S2Point, radius: S1ChordAngle): S2Cap;
37
+ /**
38
+ * Create a cap given its axis and the cap height, i.e. the maximum projected distance along the
39
+ * cap axis from the cap center. 'axis' should be a unit-length vector.
40
+ */
41
+ static fromAxisHeight(axis: S2Point, height: number): S2Cap;
36
42
  /**
37
43
  * Create a cap given its axis and the cap opening angle, i.e. maximum angle
38
44
  * between the axis and a point on the cap. 'axis' should be a unit-length
@@ -40,24 +46,27 @@ export declare class S2Cap implements S2Region {
40
46
  */
41
47
  static fromAxisAngle(axis: S2Point, angle: S1Angle): S2Cap;
42
48
  /**
43
- * Create a cap given its axis and its area in steradians. 'axis' should be a
44
- * unit-length vector, and 'area' should be between 0 and 4 * M_PI.
49
+ * Create a cap given its axis and its area in steradians. 'axis' should be a unit-length vector,
50
+ * and 'area' should be between 0 and 4 * M_PI.
45
51
  */
46
- static fromAxisArea(axis: S2Point, _area: number | decimal.Decimal): S2Cap;
52
+ static fromAxisArea(axis: S2Point, area: number): S2Cap;
47
53
  /** Return an empty cap, i.e. a cap that contains no points. */
48
54
  static empty(): S2Cap;
49
55
  /** Return a full cap, i.e. a cap that contains all points. */
50
56
  static full(): S2Cap;
51
57
  getCapBound(): S2Cap;
52
- area(): decimal.Decimal;
58
+ height(): number;
59
+ area(): number;
53
60
  /**
54
- * Return the cap opening angle in radians, or a negative number for empty
55
- * caps.
61
+ * Returns the cap radius as an S1Angle. Since the cap angle is stored internally as an
62
+ * S1ChordAngle, this method requires a trigonometric operation and may yield a slightly different
63
+ * result than the value passed to {@link #fromAxisAngle(S2Point, S1Angle)}.
56
64
  */
57
65
  angle(): S1Angle;
58
66
  /**
59
- * We allow negative heights (to represent empty caps) but not heights greater
60
- * than 2.
67
+ * Returns true if the axis is {@link S2#isUnitLength unit length}, and the angle is less than Pi.
68
+ *
69
+ * <p>Negative angles or heights are valid, and represent empty caps.
61
70
  */
62
71
  isValid(): boolean;
63
72
  /** Return true if the cap is empty, i.e. it contains no points. */
@@ -65,10 +74,10 @@ export declare class S2Cap implements S2Region {
65
74
  /** Return true if the cap is full, i.e. it contains all points. */
66
75
  isFull(): boolean;
67
76
  /**
68
- * Return the complement of the interior of the cap. A cap and its complement
69
- * have the same boundary but do not share any interior points. The complement
70
- * operator is not a bijection, since the complement of a singleton cap
71
- * (containing a single point) is the same as the complement of an empty cap.
77
+ * Return the complement of the interior of the cap. A cap and its complement have the same
78
+ * boundary but do not share any interior points. The complement operator is not a bijection,
79
+ * since the complement of a singleton cap (containing a single point) is the same as the
80
+ * complement of an empty cap.
72
81
  */
73
82
  complement(): S2Cap;
74
83
  /**
@@ -77,26 +86,24 @@ export declare class S2Cap implements S2Region {
77
86
  */
78
87
  containsCap(other: S2Cap): boolean;
79
88
  /**
80
- * Return true if and only if the interior of this cap intersects the given
81
- * other cap. (This relationship is not symmetric, since only the interior of
82
- * this cap is used.)
89
+ * Return true if and only if the interior of this cap intersects the given other cap. (This
90
+ * relationship is not symmetric, since only the interior of this cap is used.)
83
91
  */
84
92
  interiorIntersects(other: S2Cap): boolean;
85
93
  /**
86
- * Return true if and only if the given point is contained in the interior of
87
- * the region (i.e. the region excluding its boundary). 'p' should be a
88
- * unit-length vector.
94
+ * Return true if and only if the given point is contained in the interior of the region (i.e. the
95
+ * region excluding its boundary). 'p' should be a unit-length vector.
89
96
  */
90
97
  interiorContains(p: S2Point): boolean;
91
98
  /**
92
- * Increase the cap height if necessary to include the given point. If the cap
93
- * is empty the axis is set to the given point, but otherwise it is left
94
- * unchanged. 'p' should be a unit-length vector.
99
+ * Increase the cap radius if necessary to include the given point. If the cap is empty the axis
100
+ * is set to the given point, but otherwise it is left unchanged.
101
+ *
102
+ * @param p must be {@link S2#isUnitLength unit length}
95
103
  */
96
104
  addPoint(p: S2Point): S2Cap;
97
105
  addCap(other: S2Cap): S2Cap;
98
106
  getRectBound(): S2LatLngRect;
99
- containsC(cell: S2Cell): boolean;
100
107
  mayIntersectC(cell: S2Cell): boolean;
101
108
  /**
102
109
  * Return true if the cap intersects 'cell', given that the cap vertices have
@@ -104,6 +111,7 @@ export declare class S2Cap implements S2Region {
104
111
  */
105
112
  intersects(cell: S2Cell, vertices: S2Point[]): boolean;
106
113
  contains(p: S2Point): boolean;
114
+ containsC(cell: S2Cell): boolean;
107
115
  /**
108
116
  * Return true if the cap axis and height differ by at most "max_error" from
109
117
  * the given cap "other".