Arc { public Arc(final double lower, final double upper, final double tolerance) throws NumberIsTooLargeException { this.tolerance = tolerance; if (Precision.equals(lower, upper, 0) || (upper - lower) >= MathUtils.TWO_PI) { this.lower = 0; this.upper = MathUtils.TWO_PI; this.middle = FastMath.PI; } else if (lower <= upper) { this.lower = MathUtils.normalizeAngle(lower, FastMath.PI); this.upper = this.lower + (upper - lower); this.middle = 0.5 * (this.lower + this.upper); } else { throw new NumberIsTooLargeException(LocalizedFormats.ENDPOINTS_NOT_AN_INTERVAL, lower, upper, true); } } 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 testArc() { Arc arc = new Arc(2.3, 5.7, 1.0e-10); Assert.assertEquals(3.4, arc.getSize(), 1.0e-10); Assert.assertEquals(4.0, arc.getBarycenter(), 1.0e-10); Assert.assertEquals(Region.Location.BOUNDARY, arc.checkPoint(2.3)); Assert.assertEquals(Region.Location.BOUNDARY, arc.checkPoint(5.7)); Assert.assertEquals(Region.Location.OUTSIDE, arc.checkPoint(1.2)); Assert.assertEquals(Region.Location.OUTSIDE, arc.checkPoint(8.5)); Assert.assertEquals(Region.Location.INSIDE, arc.checkPoint(8.7)); Assert.assertEquals(Region.Location.INSIDE, arc.checkPoint(3.0)); Assert.assertEquals(2.3, arc.getInf(), 1.0e-10); Assert.assertEquals(5.7, arc.getSup(), 1.0e-10); Assert.assertEquals(4.0, arc.getBarycenter(), 1.0e-10); Assert.assertEquals(3.4, arc.getSize(), 1.0e-10); }