Arc { public Location checkPoint(final double point) { final double normalizedPoint = MathUtils.normalizeAngle(point, middle); if (normalizedPoint < lower - tolerance || normalizedPoint > upper + tolerance) { return Location.OUTSIDE; } else if (normalizedPoint > lower + tolerance && normalizedPoint < upper - tolerance) { return Location.INSIDE; } else { return (getSize() >= MathUtils.TWO_PI - tolerance) ? Location.INSIDE : Location.BOUNDARY; } } Arc(final double lower, final double upper, final double tolerance); double getInf(); double getSup(); double getSize(); double getBarycenter(); double getTolerance(); Location checkPoint(final double point);  }
@Test public void testTolerance() { Assert.assertEquals(Region.Location.OUTSIDE, new Arc(2.3, 5.7, 1.0).checkPoint(1.2)); Assert.assertEquals(Region.Location.BOUNDARY, new Arc(2.3, 5.7, 1.2).checkPoint(1.2)); Assert.assertEquals(Region.Location.OUTSIDE, new Arc(2.3, 5.7, 0.7).checkPoint(6.5)); Assert.assertEquals(Region.Location.BOUNDARY, new Arc(2.3, 5.7, 0.9).checkPoint(6.5)); Assert.assertEquals(Region.Location.INSIDE, new Arc(2.3, 5.7, 0.6).checkPoint(3.0)); Assert.assertEquals(Region.Location.BOUNDARY, new Arc(2.3, 5.7, 0.8).checkPoint(3.0)); }