You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/01/07 15:24:49 UTC

[GitHub] [commons-geometry] singhbaljit commented on a change in pull request #51: [GEOMETRY-71] Add test for RegionBSPTree2S barycenter

singhbaljit commented on a change in pull request #51: [GEOMETRY-71] Add test for RegionBSPTree2S barycenter
URL: https://github.com/apache/commons-geometry/pull/51#discussion_r363800994
 
 

 ##########
 File path: commons-geometry-spherical/src/test/java/org/apache/commons/geometry/spherical/twod/RegionBSPTree2STest.java
 ##########
 @@ -626,6 +626,17 @@ public void testGeographicMap() {
         checkBarycenterConsistency(france);
     }
 
+    @Test
+    public void testCircleToPolygonBarycenter() {
+        Point2S center = Point2S.of(1.0, 1.0);
+        RegionBSPTree2S ccw = circleToPolygon(center, 0.0001, 200, false);
+        SphericalTestUtils.assertPointsEq(center, ccw.getBarycenter(), BARYCENTER_EPS);
+
+        // clockwise should just be antipodal for the center
+        RegionBSPTree2S cw = circleToPolygon(center, 0.0001, 200, true);
+        SphericalTestUtils.assertPointsEq(center.antipodal(), cw.getBarycenter(), BARYCENTER_EPS);
 
 Review comment:
   This test is currently failing!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services