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/S2Cap.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  /*
2
3
  * Copyright 2005 Google Inc.
3
4
  *
@@ -13,16 +14,18 @@
13
14
  * See the License for the specific language governing permissions and
14
15
  * limitations under the License.
15
16
  */
16
- "use strict";
17
- var S2_1 = require("./S2");
18
- var S2Point_1 = require("./S2Point");
19
- var S1Angle_1 = require("./S1Angle");
20
- var S2LatLngRect_1 = require("./S2LatLngRect");
21
- var S2LatLng_1 = require("./S2LatLng");
22
- var R1Interval_1 = require("./R1Interval");
23
- var S1Interval_1 = require("./S1Interval");
24
- var Long = require('long');
25
- var decimal_1 = require('./decimal');
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.S2Cap = void 0;
19
+ const S2_1 = require("./S2");
20
+ const S2Point_1 = require("./S2Point");
21
+ const S1Angle_1 = require("./S1Angle");
22
+ const S2LatLngRect_1 = require("./S2LatLngRect");
23
+ const S2LatLng_1 = require("./S2LatLng");
24
+ const R1Interval_1 = require("./R1Interval");
25
+ const S1Interval_1 = require("./S1Interval");
26
+ const S1ChordAngle_1 = require("./S1ChordAngle");
27
+ const Platform_1 = require("./Platform");
28
+ const Long = require("long");
26
29
  /**
27
30
  * This class represents a spherical cap, i.e. a portion of a sphere cut off by
28
31
  * a plane. The cap is defined by its axis and height. This representation has
@@ -37,192 +40,196 @@ var decimal_1 = require('./decimal');
37
40
  * h = 1 - cos(theta) = 2 sin^2(theta/2) d^2 = 2 h = a^2 + h^2
38
41
  *
39
42
  */
40
- var S2Cap = (function () {
43
+ class S2Cap {
41
44
  /**
42
45
  * Create a cap given its axis and the cap height, i.e. the maximum projected
43
46
  * distance along the cap axis from the cap center. 'axis' should be a
44
47
  * unit-length vector.
45
48
  */
46
- function S2Cap(axis, _height) {
49
+ constructor(axis, radius) {
47
50
  this.axis = axis;
48
- this.height = S2_1.S2.toDecimal(_height);
51
+ this.radius = radius;
49
52
  // assert (isValid());
50
53
  }
54
+ static fromAxisChord(center, radius) {
55
+ return new S2Cap(center, radius);
56
+ }
57
+ /**
58
+ * Create a cap given its axis and the cap height, i.e. the maximum projected distance along the
59
+ * cap axis from the cap center. 'axis' should be a unit-length vector.
60
+ */
61
+ static fromAxisHeight(axis, height) {
62
+ // assert (S2.isUnitLength(axis));
63
+ return new S2Cap(axis, S1ChordAngle_1.S1ChordAngle.fromLength2(2 * height));
64
+ }
51
65
  /**
52
66
  * Create a cap given its axis and the cap opening angle, i.e. maximum angle
53
67
  * between the axis and a point on the cap. 'axis' should be a unit-length
54
68
  * vector, and 'angle' should be between 0 and 180 degrees.
55
69
  */
56
- S2Cap.fromAxisAngle = function (axis, angle) {
57
- // The height of the cap can be computed as 1-cos(angle), but this isn't
58
- // very accurate for angles close to zero (where cos(angle) is almost 1).
59
- // Computing it as 2*(sin(angle/2)**2) gives much better precision.
70
+ static fromAxisAngle(axis, angle) {
71
+ // The "min" calculation below is necessary to handle S1Angle.INFINITY.
60
72
  // assert (S2.isUnitLength(axis));
61
- var d = angle.radians.times(0.5).sin();
62
- // ecimal.sin(0.5 * angle.radians.times(0.5));
63
- return new S2Cap(axis, d.pow(2).times(2));
64
- };
73
+ return this.fromAxisChord(axis, S1ChordAngle_1.S1ChordAngle.fromS1Angle(S1Angle_1.S1Angle.radians(Math.min(angle.radians, S2_1.S2.M_PI))));
74
+ }
65
75
  /**
66
- * Create a cap given its axis and its area in steradians. 'axis' should be a
67
- * unit-length vector, and 'area' should be between 0 and 4 * M_PI.
76
+ * Create a cap given its axis and its area in steradians. 'axis' should be a unit-length vector,
77
+ * and 'area' should be between 0 and 4 * M_PI.
68
78
  */
69
- S2Cap.fromAxisArea = function (axis, _area) {
70
- var area = S2_1.S2.toDecimal(_area);
79
+ static fromAxisArea(axis, area) {
71
80
  // assert (S2.isUnitLength(axis));
72
- return new S2Cap(axis, area.dividedBy(S2_1.S2.toDecimal(2).times(S2_1.S2.M_PI)));
73
- };
81
+ return new S2Cap(axis, S1ChordAngle_1.S1ChordAngle.fromLength2(area / S2_1.S2.M_PI));
82
+ }
74
83
  /** Return an empty cap, i.e. a cap that contains no points. */
75
- S2Cap.empty = function () {
76
- return new S2Cap(new S2Point_1.S2Point(1, 0, 0), -1);
77
- };
84
+ static empty() {
85
+ return new S2Cap(S2Point_1.S2Point.X_POS, S1ChordAngle_1.S1ChordAngle.NEGATIVE);
86
+ }
78
87
  /** Return a full cap, i.e. a cap that contains all points. */
79
- S2Cap.full = function () {
80
- return new S2Cap(new S2Point_1.S2Point(1, 0, 0), 2);
81
- };
82
- S2Cap.prototype.getCapBound = function () {
88
+ static full() {
89
+ return new S2Cap(S2Point_1.S2Point.X_POS, S1ChordAngle_1.S1ChordAngle.STRAIGHT);
90
+ }
91
+ getCapBound() {
83
92
  return this;
84
- };
85
- S2Cap.prototype.area = function () {
86
- return decimal_1.Decimal.max(0, this.height)
87
- .times(S2_1.S2.M_PI)
88
- .times(2);
89
- // return 2 * S2.M_PI * Math.max(0.0, this.height);
90
- };
93
+ }
94
+ height() {
95
+ return 0.5 * this.radius.getLength2();
96
+ }
97
+ area() {
98
+ return 2 * S2_1.S2.M_PI * Math.max(0.0, this.height());
99
+ }
91
100
  /**
92
- * Return the cap opening angle in radians, or a negative number for empty
93
- * caps.
101
+ * Returns the cap radius as an S1Angle. Since the cap angle is stored internally as an
102
+ * S1ChordAngle, this method requires a trigonometric operation and may yield a slightly different
103
+ * result than the value passed to {@link #fromAxisAngle(S2Point, S1Angle)}.
94
104
  */
95
- S2Cap.prototype.angle = function () {
96
- // This could also be computed as acos(1 - height_), but the following
97
- // formula is much more accurate when the cap height is small. It
98
- // follows from the relationship h = 1 - cos(theta) = 2 sin^2(theta/2).
99
- if (this.isEmpty()) {
100
- return new S1Angle_1.S1Angle(-1);
101
- }
102
- return new S1Angle_1.S1Angle(decimal_1.Decimal.asin(this.height.times(0.5).sqrt())
103
- .times(2));
104
- };
105
+ angle() {
106
+ return this.radius.toAngle();
107
+ }
105
108
  /**
106
- * We allow negative heights (to represent empty caps) but not heights greater
107
- * than 2.
109
+ * Returns true if the axis is {@link S2#isUnitLength unit length}, and the angle is less than Pi.
110
+ *
111
+ * <p>Negative angles or heights are valid, and represent empty caps.
108
112
  */
109
- S2Cap.prototype.isValid = function () {
110
- return S2_1.S2.isUnitLength(this.axis) && this.height.lte(2);
111
- };
113
+ isValid() {
114
+ return S2_1.S2.isUnitLength(this.axis) && this.radius.getLength2() <= 4;
115
+ }
112
116
  /** Return true if the cap is empty, i.e. it contains no points. */
113
- S2Cap.prototype.isEmpty = function () {
114
- return this.height.lt(0);
115
- };
117
+ isEmpty() {
118
+ return this.radius.isNegative();
119
+ }
116
120
  /** Return true if the cap is full, i.e. it contains all points. */
117
- S2Cap.prototype.isFull = function () {
118
- return this.height.gte(2);
119
- };
121
+ isFull() {
122
+ return S1ChordAngle_1.S1ChordAngle.STRAIGHT.equals(this.radius);
123
+ }
120
124
  /**
121
- * Return the complement of the interior of the cap. A cap and its complement
122
- * have the same boundary but do not share any interior points. The complement
123
- * operator is not a bijection, since the complement of a singleton cap
124
- * (containing a single point) is the same as the complement of an empty cap.
125
+ * Return the complement of the interior of the cap. A cap and its complement have the same
126
+ * boundary but do not share any interior points. The complement operator is not a bijection,
127
+ * since the complement of a singleton cap (containing a single point) is the same as the
128
+ * complement of an empty cap.
125
129
  */
126
- S2Cap.prototype.complement = function () {
130
+ complement() {
127
131
  // The complement of a full cap is an empty cap, not a singleton.
128
- // Also make sure that the complement of an empty cap has height 2.
129
- var cHeight = this.isFull() ? -1 : decimal_1.Decimal.max(this.height, 0).neg().plus(2);
130
- return new S2Cap(S2Point_1.S2Point.neg(this.axis), cHeight);
131
- };
132
+ // Also make sure that the complement of an empty cap is full.
133
+ if (this.isFull()) {
134
+ return S2Cap.empty();
135
+ }
136
+ if (this.isEmpty()) {
137
+ return S2Cap.full();
138
+ }
139
+ return S2Cap.fromAxisChord(S2Point_1.S2Point.neg(this.axis), S1ChordAngle_1.S1ChordAngle.fromLength2(4 - this.radius.getLength2()));
140
+ }
132
141
  /**
133
142
  * Return true if and only if this cap contains the given other cap (in a set
134
143
  * containment sense, e.g. every cap contains the empty cap).
135
144
  */
136
- S2Cap.prototype.containsCap = function (other) {
145
+ containsCap(other) {
137
146
  if (this.isFull() || other.isEmpty()) {
138
147
  return true;
139
148
  }
140
- return this.angle().radians.gte(this.axis.angle(other.axis).plus(other.angle().radians));
141
- };
149
+ else {
150
+ const axialDistance = S1ChordAngle_1.S1ChordAngle.fromS2Point(this.axis, other.axis);
151
+ return this.radius.compareTo(S1ChordAngle_1.S1ChordAngle.add(axialDistance, other.radius)) >= 0;
152
+ }
153
+ }
142
154
  /**
143
- * Return true if and only if the interior of this cap intersects the given
144
- * other cap. (This relationship is not symmetric, since only the interior of
145
- * this cap is used.)
155
+ * Return true if and only if the interior of this cap intersects the given other cap. (This
156
+ * relationship is not symmetric, since only the interior of this cap is used.)
146
157
  */
147
- S2Cap.prototype.interiorIntersects = function (other) {
158
+ interiorIntersects(other) {
148
159
  // Interior(X) intersects Y if and only if Complement(Interior(X))
149
160
  // does not contain Y.
150
161
  return !this.complement().containsCap(other);
151
- };
162
+ }
152
163
  /**
153
- * Return true if and only if the given point is contained in the interior of
154
- * the region (i.e. the region excluding its boundary). 'p' should be a
155
- * unit-length vector.
164
+ * Return true if and only if the given point is contained in the interior of the region (i.e. the
165
+ * region excluding its boundary). 'p' should be a unit-length vector.
156
166
  */
157
- S2Cap.prototype.interiorContains = function (p) {
167
+ interiorContains(p) {
158
168
  // assert (S2.isUnitLength(p));
159
- return this.isFull() || S2Point_1.S2Point.sub(this.axis, p).norm2().lt(this.height.times(2));
160
- };
169
+ return this.isFull() || S1ChordAngle_1.S1ChordAngle.fromS2Point(this.axis, p).compareTo(this.radius) < 0;
170
+ }
161
171
  /**
162
- * Increase the cap height if necessary to include the given point. If the cap
163
- * is empty the axis is set to the given point, but otherwise it is left
164
- * unchanged. 'p' should be a unit-length vector.
172
+ * Increase the cap radius if necessary to include the given point. If the cap is empty the axis
173
+ * is set to the given point, but otherwise it is left unchanged.
174
+ *
175
+ * @param p must be {@link S2#isUnitLength unit length}
165
176
  */
166
- S2Cap.prototype.addPoint = function (p) {
167
- // Compute the squared chord length, then convert it into a height.
177
+ addPoint(p) {
168
178
  // assert (S2.isUnitLength(p));
169
179
  if (this.isEmpty()) {
170
- return new S2Cap(p, 0);
180
+ return new S2Cap(p, S1ChordAngle_1.S1ChordAngle.ZERO);
171
181
  }
172
182
  else {
173
- // To make sure that the resulting cap actually includes this point,
174
- // we need to round up the distance calculation. That is, after
175
- // calling cap.AddPoint(p), cap.Contains(p) should be true.
176
- var dist2 = S2Point_1.S2Point.sub(this.axis, p).norm2();
177
- var newHeight = decimal_1.Decimal.max(this.height, S2Cap.ROUND_UP.times(0.5).times(dist2));
178
- return new S2Cap(this.axis, newHeight);
183
+ // After adding p to this cap, we require that the result contains p. However we don't need to
184
+ // do anything special to achieve this because contains() does exactly the same distance
185
+ // calculation that we do here.
186
+ return new S2Cap(this.axis, S1ChordAngle_1.S1ChordAngle.fromLength2(Math.max(this.radius.getLength2(), this.axis.getDistance2(p))));
179
187
  }
180
- };
188
+ }
181
189
  // Increase the cap height if necessary to include "other". If the current
182
190
  // cap is empty it is set to the given other cap.
183
- S2Cap.prototype.addCap = function (other) {
191
+ addCap(other) {
184
192
  if (this.isEmpty()) {
185
- return new S2Cap(other.axis, other.height);
193
+ return other;
194
+ }
195
+ else if (other.isEmpty()) {
196
+ return this;
186
197
  }
187
198
  else {
188
- // See comments for FromAxisAngle() and AddPoint(). This could be
189
- // optimized by doing the calculation in terms of cap heights rather
190
- // than cap opening angles.
191
- var angle = this.axis.angle(other.axis).plus(other.angle().radians);
192
- if (angle.gte(S2_1.S2.M_PI)) {
193
- return new S2Cap(this.axis, 2); //Full cap
194
- }
195
- else {
196
- var d = angle.times(0.5).sin();
197
- var newHeight = decimal_1.Decimal.max(this.height, S2Cap.ROUND_UP.times(2).times(d.pow(2)));
198
- return new S2Cap(this.axis, newHeight);
199
- }
199
+ // We round up the distance to ensure that the cap is actually contained.
200
+ // TODO(user): Do some error analysis in order to guarantee this.
201
+ const dist = S1ChordAngle_1.S1ChordAngle.add(S1ChordAngle_1.S1ChordAngle.fromS2Point(this.axis, other.axis), other.radius);
202
+ const roundedUp = dist.plusError(S2_1.S2.DBL_EPSILON * dist.getLength2());
203
+ return new S2Cap(this.axis, S1ChordAngle_1.S1ChordAngle.max(this.radius, roundedUp));
200
204
  }
201
- };
205
+ }
202
206
  // //////////////////////////////////////////////////////////////////////
203
207
  // S2Region interface (see {@code S2Region} for details):
204
- S2Cap.prototype.getRectBound = function () {
208
+ getRectBound() {
205
209
  if (this.isEmpty()) {
206
210
  return S2LatLngRect_1.S2LatLngRect.empty();
207
211
  }
212
+ if (this.isFull()) {
213
+ return S2LatLngRect_1.S2LatLngRect.full();
214
+ }
208
215
  // Convert the axis to a (lat,lng) pair, and compute the cap angle.
209
- var axisLatLng = S2LatLng_1.S2LatLng.fromPoint(this.axis);
210
- var capAngle = this.angle().radians;
211
- var allLongitudes = false;
212
- var lat = Array(2);
213
- var lng = Array(2);
214
- lng[0] = S2_1.S2.toDecimal(-S2_1.S2.M_PI);
215
- lng[1] = S2_1.S2.toDecimal(S2_1.S2.M_PI);
216
+ const axisLatLng = S2LatLng_1.S2LatLng.fromPoint(this.axis);
217
+ const capAngle = this.angle().radians;
218
+ let allLongitudes = false;
219
+ const lat = [];
220
+ const lng = [];
221
+ lng[0] = -S2_1.S2.M_PI;
222
+ lng[1] = S2_1.S2.M_PI;
216
223
  // Check whether cap includes the south pole.
217
- lat[0] = axisLatLng.latRadians.minus(capAngle);
218
- if (lat[0].lte(-S2_1.S2.M_PI_2)) {
219
- lat[0] = S2_1.S2.toDecimal(-S2_1.S2.M_PI_2);
224
+ lat[0] = axisLatLng.lat().radians - capAngle;
225
+ if (lat[0] <= -S2_1.S2.M_PI_2) {
226
+ lat[0] = -S2_1.S2.M_PI_2;
220
227
  allLongitudes = true;
221
228
  }
222
229
  // Check whether cap includes the north pole.
223
- lat[1] = axisLatLng.latRadians.plus(capAngle);
224
- if (lat[1].gte(S2_1.S2.M_PI_2)) {
225
- lat[1] = S2_1.S2.toDecimal(S2_1.S2.M_PI_2);
230
+ lat[1] = axisLatLng.lat().radians + capAngle;
231
+ if (lat[1] >= S2_1.S2.M_PI_2) {
232
+ lat[1] = S2_1.S2.M_PI_2;
226
233
  allLongitudes = true;
227
234
  }
228
235
  if (!allLongitudes) {
@@ -234,64 +241,43 @@ var S2Cap = (function () {
234
241
  // we have sin(a)/sin(A) = sin(c)/sin(C), or sin(A) = sin(a)/sin(c).
235
242
  // Here "a" is the cap angle, and "c" is the colatitude (90 degrees
236
243
  // minus the latitude). This formula also works for negative latitudes.
237
- //
238
- // The formula for sin(a) follows from the relationship h = 1 - cos(a).
239
- // double sinA = Math.sqrt(this.height * (2 - this.height));
240
- // double sinC = Math.cos(axisLatLng.lat().radians());
241
- var sinA = this.height.times(this.height.neg().plus(2)).sqrt();
242
- var sinC = axisLatLng.latRadians.cos();
243
- if (sinA.lte(sinC)) {
244
- var angleA = decimal_1.Decimal.asin(sinA.dividedBy(sinC));
245
- lng[0] = S2_1.S2.IEEEremainder(axisLatLng.lngRadians.minus(angleA), 2 * S2_1.S2.M_PI);
246
- lng[1] = S2_1.S2.IEEEremainder(axisLatLng.lngRadians.plus(angleA), 2 * S2_1.S2.M_PI);
244
+ const sinA = S1ChordAngle_1.S1ChordAngle.sin(this.radius);
245
+ const sinC = Math.cos(axisLatLng.lat().radians);
246
+ if (sinA <= sinC) {
247
+ const angleA = Math.asin(sinA / sinC);
248
+ lng[0] = Platform_1.Platform.IEEEremainder(axisLatLng.lng().radians - angleA, 2 * S2_1.S2.M_PI);
249
+ lng[1] = Platform_1.Platform.IEEEremainder(axisLatLng.lng().radians + angleA, 2 * S2_1.S2.M_PI);
247
250
  }
248
251
  }
249
252
  return new S2LatLngRect_1.S2LatLngRect(new R1Interval_1.R1Interval(lat[0], lat[1]), new S1Interval_1.S1Interval(lng[0], lng[1]));
250
- };
251
- S2Cap.prototype.containsC = function (cell) {
252
- // If the cap does not contain all cell vertices, return false.
253
- // We check the vertices before taking the Complement() because we can't
254
- // accurately represent the complement of a very small cap (a height
255
- // of 2-epsilon is rounded off to 2).
256
- var vertices = new Array(4);
257
- for (var k = 0; k < 4; ++k) {
258
- vertices[k] = cell.getVertex(k);
259
- if (!this.contains(vertices[k])) {
260
- return false;
261
- }
262
- }
263
- // Otherwise, return true if the complement of the cap does not intersect
264
- // the cell. (This test is slightly conservative, because technically we
265
- // want Complement().InteriorIntersects() here.)
266
- return !this.complement().intersects(cell, vertices);
267
- };
253
+ }
268
254
  // public mayIntersectC(cell:S2Cell):boolean {
269
255
  // const toRet = this._mayIntersectC(cell);
270
256
  // console.log("intersects? ",toRet, cell.id.pos().toString(16), cell.level);
271
257
  // return toRet;
272
258
  // }
273
- S2Cap.prototype.mayIntersectC = function (cell) {
259
+ mayIntersectC(cell) {
274
260
  // If the cap contains any cell vertex, return true.
275
- var vertices = new Array(4);
276
- for (var k = 0; k < 4; ++k) {
261
+ const vertices = new Array(4);
262
+ for (let k = 0; k < 4; ++k) {
277
263
  vertices[k] = cell.getVertex(k);
278
264
  if (this.contains(vertices[k])) {
279
265
  return true;
280
266
  }
281
267
  }
282
268
  return this.intersects(cell, vertices);
283
- };
269
+ }
284
270
  /**
285
271
  * Return true if the cap intersects 'cell', given that the cap vertices have
286
272
  * alrady been checked.
287
273
  */
288
- S2Cap.prototype.intersects = function (cell, vertices) {
274
+ intersects(cell, vertices) {
289
275
  // Return true if this cap intersects any point of 'cell' excluding its
290
276
  // vertices (which are assumed to already have been checked).
291
277
  // If the cap is a hemisphere or larger, the cell and the complement of the
292
278
  // cap are both convex. Therefore since no vertex of the cell is contained,
293
279
  // no other interior point of the cell is contained either.
294
- if (this.height.gte(1)) {
280
+ if (this.radius.compareTo(S1ChordAngle_1.S1ChordAngle.RIGHT) >= 0) {
295
281
  return false;
296
282
  }
297
283
  // We need to check for empty caps due to the axis check just below.
@@ -306,14 +292,11 @@ var S2Cap = (function () {
306
292
  // At this point we know that the cell does not contain the cap axis,
307
293
  // and the cap does not contain any cell vertex. The only way that they
308
294
  // can intersect is if the cap intersects the interior of some edge.
309
- var sin2Angle = this.height.times(this.height.neg().plus(2)); // sin^2(capAngle)
310
- // if (cell.id.pos().toString(16) === '77c040000000000') {
311
- // console.log("DIOCAN");
312
- // }
313
- for (var k = 0; k < 4; ++k) {
314
- var edge = cell.getEdgeRaw(k);
315
- var dot = this.axis.dotProd(edge);
316
- if (dot.gt(0)) {
295
+ const sin2Angle = S1ChordAngle_1.S1ChordAngle.sin2(this.radius);
296
+ for (let k = 0; k < 4; ++k) {
297
+ const edge = cell.getEdgeRaw(k);
298
+ const dot = this.axis.dotProd(edge);
299
+ if (dot > 0) {
317
300
  // The axis is in the interior half-space defined by the edge. We don't
318
301
  // need to consider these edges, since if the cap intersects this edge
319
302
  // then it also intersects the edge on the opposite side of the cell
@@ -321,28 +304,41 @@ var S2Cap = (function () {
321
304
  continue;
322
305
  }
323
306
  // The Norm2() factor is necessary because "edge" is not normalized.
324
- if (dot.pow(2).gt(sin2Angle.times(edge.norm2()))) {
325
- // if (cell.id.pos().toString(16) === '77c040000000000') {
326
- // console.log("DIOCaAN", k, dot.toString(), sin2Angle.toString(), sin2Angle.times(edge.norm2()).toString());
327
- // }
307
+ if (dot * dot > sin2Angle * edge.norm2()) {
328
308
  return false; // Entire cap is on the exterior side of this edge.
329
309
  }
330
310
  // Otherwise, the great circle containing this edge intersects
331
311
  // the interior of the cap. We just need to check whether the point
332
312
  // of closest approach occurs between the two edge endpoints.
333
- var dir = S2Point_1.S2Point.crossProd(edge, this.axis);
334
- if (dir.dotProd(vertices[k]).lt(0)
335
- && dir.dotProd(vertices[(k + 1) & 3]).gt(0)) {
313
+ const dir = S2Point_1.S2Point.crossProd(edge, this.axis);
314
+ if (dir.dotProd(vertices[k]) < 0 && dir.dotProd(vertices[(k + 1) & 3]) > 0) {
336
315
  return true;
337
316
  }
338
317
  }
339
318
  return false;
340
- };
341
- S2Cap.prototype.contains = function (p) {
319
+ }
320
+ contains(p) {
342
321
  // The point 'p' should be a unit-length vector.
343
322
  // assert (S2.isUnitLength(p));
344
- return S2Point_1.S2Point.sub(this.axis, p).norm2().lte(this.height.times(2));
345
- };
323
+ return S1ChordAngle_1.S1ChordAngle.fromS2Point(this.axis, p).compareTo(this.radius) <= 0;
324
+ }
325
+ containsC(cell) {
326
+ // If the cap does not contain all cell vertices, return false.
327
+ // We check the vertices before taking the Complement() because we can't
328
+ // accurately represent the complement of a very small cap (a height
329
+ // of 2-epsilon is rounded off to 2).
330
+ const vertices = [];
331
+ for (let k = 0; k < 4; ++k) {
332
+ vertices[k] = cell.getVertex(k);
333
+ if (!this.contains(vertices[k])) {
334
+ return false;
335
+ }
336
+ }
337
+ // Otherwise, return true if the complement of the cap does not intersect
338
+ // the cell. (This test is slightly conservative, because technically we
339
+ // want Complement().InteriorIntersects() here.)
340
+ return !this.complement().intersects(cell, vertices);
341
+ }
346
342
  //
347
343
  // /** Return true if two caps are identical. */
348
344
  // public equals(that:Object ):boolean {
@@ -377,27 +373,27 @@ var S2Cap = (function () {
377
373
  * Return true if the cap axis and height differ by at most "max_error" from
378
374
  * the given cap "other".
379
375
  */
380
- S2Cap.prototype.approxEquals = function (other, maxError) {
381
- if (maxError === void 0) { maxError = 1e-14; }
382
- return (this.axis.aequal(other.axis, maxError) && this.height.minus(other.height).lte(maxError))
383
- || (this.isEmpty() && other.height.lte(maxError))
384
- || (other.isEmpty() && this.height.lte(maxError))
385
- || (this.isFull() && other.height.gte(2 - maxError))
386
- || (other.isFull() && this.height.gte(2 - maxError));
387
- };
388
- S2Cap.prototype.toString = function () {
389
- return "[Point = " + this.axis.toString() + " Height = " + this.height.toString() + "]";
390
- };
391
- S2Cap.prototype.toGEOJSON = function () {
376
+ approxEquals(other, maxError = 1e-14) {
377
+ const r2 = this.radius.getLength2();
378
+ const otherR2 = other.radius.getLength2();
379
+ return (S2_1.S2.approxEqualsPointError(this.axis, other.axis, maxError) && Math.abs(r2 - otherR2) <= maxError)
380
+ || (this.isEmpty() && otherR2 <= maxError)
381
+ || (other.isEmpty() && r2 <= maxError)
382
+ || (this.isFull() && otherR2 >= 2 - maxError)
383
+ || (other.isFull() && r2 >= 2 - maxError);
384
+ }
385
+ toString() {
386
+ return "[Point = " + this.axis + " Radius = " + this.radius + "]";
387
+ }
388
+ toGEOJSON() {
392
389
  return this.getRectBound().toGEOJSON();
393
- };
394
- /**
395
- * Multiply a positive number by this constant to ensure that the result of a
396
- * floating point operation is at least as large as the true
397
- * infinite-precision result.
398
- */
399
- S2Cap.ROUND_UP = S2_1.S2.toDecimal(1).dividedBy(new Long(1).shiftLeft(52).toString()).plus(1);
400
- return S2Cap;
401
- }());
390
+ }
391
+ }
402
392
  exports.S2Cap = S2Cap;
393
+ /**
394
+ * Multiply a positive number by this constant to ensure that the result of a
395
+ * floating point operation is at least as large as the true
396
+ * infinite-precision result.
397
+ */
398
+ S2Cap.ROUND_UP = 1 / new Long(1).shiftLeft(52).toNumber() + 1;
403
399
  //# sourceMappingURL=S2Cap.js.map
package/dist/S2Cap.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"S2Cap.js","sourceRoot":"","sources":["../src/S2Cap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;;AAIH,mBAAiB,MAAM,CAAC,CAAA;AACxB,wBAAsB,WAAW,CAAC,CAAA;AAClC,wBAAsB,WAAW,CAAC,CAAA;AAClC,6BAA2B,gBAAgB,CAAC,CAAA;AAC5C,yBAAuB,YAAY,CAAC,CAAA;AACpC,2BAAyB,cAAc,CAAC,CAAA;AACxC,2BAAyB,cAAc,CAAC,CAAA;AAExC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,wBAAsB,WAAW,CAAC,CAAA;AAClC;;;;;;;;;;;;;GAaG;AACH;IAaE;;;;OAIG;IACH,eAAY,IAAY,EAAE,OAA8B;QACtD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,OAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACpC,sBAAsB;IACxB,CAAC;IAED;;;;OAIG;IACW,mBAAa,GAA3B,UAA4B,IAAY,EAAE,KAAa;QACrD,wEAAwE;QACxE,yEAAyE;QACzE,mEAAmE;QAEnE,kCAAkC;QAClC,IAAM,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QACzC,8CAA8C;QAC9C,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5C,CAAC;IAED;;;OAGG;IACW,kBAAY,GAA1B,UAA2B,IAAY,EAAE,KAA4B;QACnE,IAAM,IAAI,GAAG,OAAE,CAAC,SAAS,CAAC,KAAK,CAA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