/external/s2-geometry-library-java/tests/com/google/common/geometry/ |
D | S2LatLngTest.java | 21 S2LatLng llRad = S2LatLng.fromRadians(S2.M_PI_4, S2.M_PI_2); in testBasic() 25 S2LatLng llDeg = S2LatLng.fromDegrees(45, 90); in testBasic() 28 assertTrue(!S2LatLng.fromDegrees(-91, 0).isValid()); in testBasic() 29 assertTrue(!S2LatLng.fromDegrees(0, 181).isValid()); in testBasic() 31 S2LatLng bad = S2LatLng.fromDegrees(120, 200); in testBasic() 33 S2LatLng better = bad.normalized(); in testBasic() 38 bad = S2LatLng.fromDegrees(-100, -360); in testBasic() 45 assertTrue((S2LatLng.fromDegrees(10, 20).add(S2LatLng.fromDegrees(20, 30))).approxEquals( in testBasic() 46 S2LatLng.fromDegrees(30, 50))); in testBasic() 47 assertTrue((S2LatLng.fromDegrees(10, 20).sub(S2LatLng.fromDegrees(20, 30))).approxEquals( in testBasic() [all …]
|
D | S2LatLngRectTest.java | 38 if (y.getSize() == S2LatLng.fromRadians(0, 0)) { in testIntervalOps() 86 S2LatLngRect.fromCenterSize(S2LatLng.fromDegrees(80, 170), S2LatLng.fromDegrees(40, 60)) in testBasic() 89 .fromCenterSize(S2LatLng.fromDegrees(10, 40), S2LatLng.fromDegrees(210, 400)).isFull()); in testBasic() 91 S2LatLngRect.fromCenterSize(S2LatLng.fromDegrees(-90, 180), S2LatLng.fromDegrees(20, 50)) in testBasic() 97 S2LatLngRect.fromPointPair(S2LatLng.fromDegrees(-35, -140), S2LatLng.fromDegrees(15, 155)), in testBasic() 100 S2LatLngRect.fromPointPair(S2LatLng.fromDegrees(25, -70), S2LatLng.fromDegrees(-90, 80)), in testBasic() 104 S2LatLng eqM180 = S2LatLng.fromRadians(0, -S2.M_PI); in testBasic() 105 S2LatLng northPole = S2LatLng.fromRadians(S2.M_PI_2, 0); in testBasic() 108 assertEquals(r1.getCenter(), S2LatLng.fromRadians(S2.M_PI_4, -S2.M_PI_2)); in testBasic() 109 assertEquals(r1.getVertex(0), S2LatLng.fromRadians(0, S2.M_PI)); in testBasic() [all …]
|
D | S2PolylineTest.java | 123 latLngs.add(S2LatLng.fromDegrees(0, 0).toPoint()); 124 latLngs.add(S2LatLng.fromDegrees(0, 1).toPoint()); 125 latLngs.add(S2LatLng.fromDegrees(0, 2).toPoint()); 126 latLngs.add(S2LatLng.fromDegrees(1, 2).toPoint()); 132 testPoint = S2LatLng.fromDegrees(0.5, -0.5).toPoint(); 135 line.projectToEdge(testPoint, edgeIndex), S2LatLng.fromDegrees(0, 0).toPoint())); 138 testPoint = S2LatLng.fromDegrees(0.5, 0.5).toPoint(); 141 line.projectToEdge(testPoint, edgeIndex), S2LatLng.fromDegrees(0, 0.5).toPoint())); 144 testPoint = S2LatLng.fromDegrees(0.5, 1).toPoint(); 147 line.projectToEdge(testPoint, edgeIndex), S2LatLng.fromDegrees(0, 1).toPoint())); [all …]
|
D | S2EdgeUtilTest.java | 394 S2Point a = S2LatLng.fromDegrees(-0.5, 0).toPoint(); in testGetClosestPoint() 395 S2Point b = S2LatLng.fromDegrees(+0.5, 0).toPoint(); in testGetClosestPoint() 402 S2Point mid = S2LatLng.fromDegrees(0, 0).toPoint(); in testGetClosestPoint() 406 assertEquals(a, S2EdgeUtil.getClosestPoint(S2LatLng.fromDegrees(-1, 0).toPoint(), a, b)); in testGetClosestPoint() 407 assertEquals(b, S2EdgeUtil.getClosestPoint(S2LatLng.fromDegrees(+1, 0).toPoint(), a, b)); in testGetClosestPoint() 410 S2Point x = S2LatLng.fromDegrees(+0.1, 1).toPoint(); in testGetClosestPoint() 411 S2Point expectedClosestPoint = S2LatLng.fromDegrees(+0.1, 0).toPoint(); in testGetClosestPoint()
|
D | S2LoopTest.java | 107 new S2LatLngRect(S2LatLng.fromDegrees(80, -180), S2LatLng.fromDegrees(90, 180))); in testBounds() 109 new S2LatLngRect(S2LatLng.fromDegrees(-90, -180), S2LatLng.fromDegrees(-80, 180))); in testBounds() 114 assertDoubleNear(arctic80.getRectBound().latHi().radians(), new S2LatLng(mid).lat().radians()); in testBounds() 190 assertTrue(candyCane.contains(S2LatLng.fromDegrees(5, 71).toPoint())); in testContains() 492 assertEquals(0d, s1.getDistance(S2LatLng.fromDegrees(0.5, 1).toPoint()).radians(), epsilon); 499 S2Point origin = S2LatLng.fromDegrees(0, 0).toPoint();
|
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 | S2PolygonTest.java | 188 S2LatLng latLng = new S2LatLng(s2Loop.vertex(vertexIndex)); 333 S2Point origin = S2LatLng.fromDegrees(0, 0).toPoint(); in testGetDistance()
|
D | S2CellIdTest.java | 33 S2CellId id = S2CellId.fromLatLng(S2LatLng.fromDegrees(latDegrees, lngDegrees)); in getCellId() 95 S2LatLng center = id.toLatLng(); in testInverses()
|
D | GeometryTestCase.java | 178 vertices.add(S2LatLng.fromDegrees(lat, lng).toPoint());
|
D | S2CellTest.java | 232 System.out.println("Latlng of vertex: " + new S2LatLng(children[i].getVertex(j))); in testSubdivide() 241 System.out.println("Latlng of vertex: " + new S2LatLng(children[i].getVertexRaw(j))); in testSubdivide()
|
D | S2CapTest.java | 21 return S2LatLng.fromDegrees(latDegrees, lngDegrees).toPoint(); in getLatLngPoint()
|
/external/s2-geometry-library-java/src/com/google/common/geometry/ |
D | S2LatLng.java | 26 public strictfp class S2LatLng { class 34 public static final S2LatLng CENTER = new S2LatLng(0.0, 0.0); 39 public static S2LatLng fromRadians(double latRadians, double lngRadians) { in fromRadians() 40 return new S2LatLng(latRadians, lngRadians); in fromRadians() 43 public static S2LatLng fromDegrees(double latDegrees, double lngDegrees) { in fromDegrees() 44 return new S2LatLng(S1Angle.degrees(latDegrees), S1Angle.degrees(lngDegrees)); in fromDegrees() 47 public static S2LatLng fromE5(long latE5, long lngE5) { in fromE5() 48 return new S2LatLng(S1Angle.e5(latE5), S1Angle.e5(lngE5)); in fromE5() 51 public static S2LatLng fromE6(long latE6, long lngE6) { in fromE6() 52 return new S2LatLng(S1Angle.e6(latE6), S1Angle.e6(lngE6)); in fromE6() [all …]
|
D | S2LatLngRect.java | 35 public S2LatLngRect(final S2LatLng lo, final S2LatLng hi) { in S2LatLngRect() 76 public static S2LatLngRect fromCenterSize(S2LatLng center, S2LatLng size) { in fromCenterSize() 81 public static S2LatLngRect fromPoint(S2LatLng p) { in fromPoint() 93 public static S2LatLngRect fromPointPair(S2LatLng p1, S2LatLng p2) { in fromPointPair() 107 S2LatLngRect r = fromPointPair(new S2LatLng(a), new S2LatLng(b)); in fromEdge() 169 public S2LatLng lo() { in lo() 170 return new S2LatLng(latLo(), lngLo()); in lo() 173 public S2LatLng hi() { in hi() 174 return new S2LatLng(latHi(), lngHi()); in hi() 198 public S2LatLng getVertex(int k) { in getVertex() [all …]
|
D | S2EdgeUtil.java | 168 private S2LatLng aLatLng; 184 S2LatLng bLatLng = new S2LatLng(b); in addPoint() 353 this.lng0 = S2LatLng.longitude(v0).radians(); in LongitudePruner() 361 double lng1 = S2LatLng.longitude(v1).radians(); in intersects()
|
D | S2Point.java | 183 S2LatLng s2LatLng = new S2LatLng(this); in toDegreesString()
|
D | S2Loop.java | 776 new S2LatLng(vertex(a1)).toStringDegrees(), in isValid() 777 new S2LatLng(vertex(a2)).toStringDegrees(), in isValid() 778 new S2LatLng(vertex(b1)).toStringDegrees(), in isValid() 779 new S2LatLng(vertex(b2)).toStringDegrees())); in isValid()
|
D | S2Cap.java | 249 S2LatLng axisLatLng = new S2LatLng(axis); in getRectBound()
|
D | S2CellId.java | 158 public static S2CellId fromLatLng(S2LatLng ll) { in fromLatLng() 202 public S2LatLng toLatLng() { in toLatLng() 203 return new S2LatLng(toPointRaw()); in toLatLng()
|
D | S2Cell.java | 60 public S2Cell(S2LatLng ll) { in S2Cell()
|