/external/s2-geometry-library-java/src/com/google/common/geometry/ |
D | S1Angle.java | 19 public final strictfp class S1Angle implements Comparable<S1Angle> { class 46 public S1Angle() { in S1Angle() method in S1Angle 50 private S1Angle(double radians) { in S1Angle() method in S1Angle 59 public S1Angle(S2Point x, S2Point y) { in S1Angle() method in S1Angle 65 if (that instanceof S1Angle) { in equals() 66 return this.radians() == ((S1Angle) that).radians(); in equals() 77 public boolean lessThan(S1Angle that) { in lessThan() 81 public boolean greaterThan(S1Angle that) { in greaterThan() 85 public boolean lessOrEquals(S1Angle that) { in lessOrEquals() 89 public boolean greaterOrEquals(S1Angle that) { in greaterOrEquals() [all …]
|
D | S2LatLng.java | 44 return new S2LatLng(S1Angle.degrees(latDegrees), S1Angle.degrees(lngDegrees)); in fromDegrees() 48 return new S2LatLng(S1Angle.e5(latE5), S1Angle.e5(lngE5)); in fromE5() 52 return new S2LatLng(S1Angle.e6(latE6), S1Angle.e6(lngE6)); in fromE6() 56 return new S2LatLng(S1Angle.e7(latE7), S1Angle.e7(lngE7)); in fromE7() 59 public static S1Angle latitude(S2Point p) { in latitude() 62 return S1Angle.radians( in latitude() 66 public static S1Angle longitude(S2Point p) { in longitude() 68 return S1Angle.radians(Math.atan2(p.get(1), p.get(0))); in longitude() 83 public S2LatLng(S1Angle lat, S1Angle lng) { in S2LatLng() 110 public S1Angle lat() { in lat() [all …]
|
D | S2LatLngRect.java | 145 public S1Angle latLo() { in latLo() 146 return S1Angle.radians(lat.lo()); in latLo() 149 public S1Angle latHi() { in latHi() 150 return S1Angle.radians(lat.hi()); in latHi() 153 public S1Angle lngLo() { in lngLo() 154 return S1Angle.radians(lng.lo()); in lngLo() 157 public S1Angle lngHi() { in lngHi() 158 return S1Angle.radians(lng.hi()); in lngHi() 227 public S1Angle getDistance(S2LatLng p) { in getDistance() 236 return S1Angle.radians(Math.max(0.0, Math.max(p.lat().radians() - a.lat().hi(), in getDistance() [all …]
|
D | S2Polyline.java | 101 public S1Angle getArclengthAngle() { in getArclengthAngle() 106 return S1Angle.radians(lengthSum); in getArclengthAngle() 222 S1Angle minDistance = S1Angle.radians(10); in getNearestEdgeIndex() 227 S1Angle distanceToSegment = S2EdgeUtil.getDistance(point, vertex(i), vertex(i + 1)); in getNearestEdgeIndex()
|
D | S2Cap.java | 73 public static S2Cap fromAxisAngle(S2Point axis, S1Angle angle) { in fromAxisAngle() 121 public S1Angle angle() { in angle() 126 return S1Angle.radians(-1); in angle() 128 return S1Angle.radians(2 * Math.asin(Math.sqrt(0.5 * height))); in angle()
|
D | S2EdgeUtil.java | 40 public static final S1Angle DEFAULT_INTERSECTION_TOLERANCE = S1Angle.radians(1.5e-15); 750 public static S1Angle getDistance(S2Point x, S2Point a, S2Point b) { in getDistance() 760 public static S1Angle getDistance(S2Point x, S2Point a, S2Point b, S2Point aCrossB) { in getDistance() 777 return S1Angle.radians(Math.asin(Math.min(1.0, sinDist))); in getDistance() 786 return S1Angle.radians(2 * Math.asin(Math.min(1.0, 0.5 * Math.sqrt(linearDist2)))); in getDistance()
|
D | S2Polygon.java | 344 public S1Angle getDistance(S2Point p) { in getDistance() 346 return S1Angle.radians(0); in getDistance() 351 S1Angle minDistance = S1Angle.radians(Math.PI); in getDistance() 353 minDistance = S1Angle.min(minDistance, loop(i).getDistance(p)); in getDistance() 689 final S2Polygon a, final S2Polygon b, S1Angle vertexMergeRadius) { in initToIntersectionSloppy() 714 public void initToUnionSloppy(final S2Polygon a, final S2Polygon b, S1Angle vertexMergeRadius) { in initToUnionSloppy() 746 List<S2Polygon> polygons, S1Angle vertexMergeRadius) { in destructiveUnionSloppy()
|
D | S2PolygonBuilder.java | 120 private S1Angle mergeDistance; 126 this.mergeDistance = S1Angle.radians(0); in Options() 173 public S1Angle getMergeDistance() { in getMergeDistance() 200 public void setMergeDistance(S1Angle mergeDistance) { in setMergeDistance()
|
D | S2Loop.java | 661 public S1Angle getDistance(S2Point p) { in getDistance() 666 S1Angle minDistance = S1Angle.radians(Math.PI); in getDistance() 669 S1Angle.min(minDistance, S2EdgeUtil.getDistance(normalized, vertex(i), vertex(i + 1))); in getDistance()
|
D | S2CellUnion.java | 392 public void expand(S1Angle minRadius, int maxLevelDiff) { in expand()
|
/external/s2-geometry-library-java/tests/com/google/common/geometry/ |
D | S1AngleTest.java | 25 assertEquals(S1Angle.radians(Math.PI).radians(), Math.PI); in testBasic() 26 assertEquals(S1Angle.radians(Math.PI).degrees(), 180.0); in testBasic() 27 assertEquals(S1Angle.degrees(180).radians(), Math.PI); in testBasic() 28 assertEquals(S1Angle.degrees(180).degrees(), 180.0); in testBasic() 30 assertEquals(S1Angle.radians(Math.PI / 2).degrees(), 90.0); in testBasic() 33 assertEquals(S1Angle.radians(-Math.PI / 2).degrees(), -90.0); in testBasic() 34 assertEquals(S1Angle.degrees(-45).radians(), -Math.PI / 4); in testBasic() 37 assertEquals(S1Angle.e5(2000000), S1Angle.degrees(20)); in testBasic() 38 assertEquals(S1Angle.e6(-60000000), S1Angle.degrees(-60)); in testBasic() 39 assertEquals(S1Angle.e7(750000000), S1Angle.degrees(75)); in testBasic() [all …]
|
D | S2LatLngRectTest.java | 188 .convolveWithCap(S1Angle.degrees(15)); in testBasic() 194 .convolveWithCap(S1Angle.degrees(15)); in testBasic() 203 .getCapBound().approxEquals(S2Cap.fromAxisAngle(new S2Point(0, 0, 1), S1Angle.degrees(2)))); in testBasic() 208 .approxEquals(S2Cap.fromAxisAngle(new S2Point(0, 0, -1), S1Angle.degrees(80)))); in testBasic() 295 S1Angle zero = S1Angle.radians(0); in testGetDistanceOverlapping() 388 private static S1Angle bruteForceDistance(S2LatLngRect a, S2LatLngRect b) { in bruteForceDistance() 390 return S1Angle.radians(0); in bruteForceDistance() 404 S1Angle latA[] = {a.latLo(), a.latHi()}; in bruteForceDistance() 405 S1Angle latB[] = {b.latLo(), b.latHi()}; in bruteForceDistance() 411 S1Angle minDistance = S1Angle.degrees(180.0); in bruteForceDistance() [all …]
|
D | S2CapTest.java | 55 S2Cap yaxis = S2Cap.fromAxisAngle(new S2Point(0, 1, 0), S1Angle.radians(0)); in testBasic() 75 S2Cap.fromAxisAngle(S2Point.normalize(new S2Point(1, 2, 3)), S1Angle.radians(kTinyRad)); in testBasic() 90 S2Cap concave = S2Cap.fromAxisAngle(getLatLngPoint(80, 10), S1Angle.degrees(150)); in testBasic() 109 S2Cap.fromAxisAngle(new S2Point(1, 0, 0), S1Angle.radians(S2.M_PI_4 - EPS)))); in testBasic() 111 S2Cap.fromAxisAngle(new S2Point(1, 0, 0), S1Angle.radians(S2.M_PI_4 + EPS)))); in testBasic() 128 S2Cap.fromAxisAngle(getLatLngPoint(-45, 57), S1Angle.degrees(50)).getRectBound(); in testRectBound() 134 rect = S2Cap.fromAxisAngle(S2Point.normalize(new S2Point(1, 0, 1)), S1Angle.radians(S2.M_PI_4)) in testRectBound() 141 .fromAxisAngle(S2Point.normalize(new S2Point(1, 0, 1)), S1Angle.degrees(45)).getRectBound(); in testRectBound() 148 .fromAxisAngle(new S2Point(0, 1, 0), S1Angle.radians(S2.M_PI_2 + 5e-16)).getRectBound(); in testRectBound() 154 rect = S2Cap.fromAxisAngle(getLatLngPoint(0, 50), S1Angle.degrees(20)).getRectBound(); in testRectBound() [all …]
|
D | S2EdgeUtilTest.java | 480 S1Angle maxPointDist = new S1Angle(); in testIntersectionTolerance() 481 S1Angle maxEdgeDist = new S1Angle(); in testIntersectionTolerance() 516 S1Angle distAb = S2EdgeUtil.getDistance(x, a, b); in testIntersectionTolerance() 517 S1Angle distCd = S2EdgeUtil.getDistance(x, c, d); in testIntersectionTolerance() 526 maxEdgeDist = S1Angle.max(maxEdgeDist, S1Angle.max(distAb, distCd)); in testIntersectionTolerance() 527 maxPointDist = S1Angle.max(maxPointDist, new S1Angle(p, x)); in testIntersectionTolerance()
|
D | S2LatLngTest.java | 35 assertEquals(better.lat(), S1Angle.degrees(90)); in testBasic() 36 assertDoubleNear(better.lng().radians(), S1Angle.degrees(-160).radians()); in testBasic() 42 assertEquals(better.lat(), S1Angle.degrees(-90)); in testBasic()
|
D | S2PolygonBuilderTest.java | 257 S2Cap cap = S2Cap.fromAxisAngle(axis, S1Angle.radians(maxPerturbation)); in getVertices() 363 double minMerge = S1Angle.degrees(test.minMerge).radians(); in testBuilder() 364 double maxMerge = S1Angle.degrees(test.maxMerge).radians(); in testBuilder() 373 options.setMergeDistance(S1Angle.radians( in testBuilder()
|
D | S2EdgeIndexTest.java | 66 edgeCenter, S1Angle.radians(maxLengthMeters / S2LatLng.EARTH_RADIUS_METERS / 2)); in randomEdgeCrossingCap() 80 randomPoint(), S1Angle.radians(capSpanMeters / S2LatLng.EARTH_RADIUS_METERS)); in generateRandomEarthEdges()
|
D | S2PolylineTest.java | 64 S1Angle length = line.getArclengthAngle(); in testGetLengthCentroid()
|
D | S2PolygonTest.java | 272 S2Polygon union = S2Polygon.destructiveUnionSloppy(polygons, S1Angle.degrees(0.1));
|
D | S2CellUnionTest.java | 339 covering.expand(S1Angle.radians(radius), maxLevelDiff); in testExpand()
|