SubCircle extends AbstractSubHyperplane<Sphere2D, Sphere1D> { @Override public Side side(final Hyperplane<Sphere2D> hyperplane) { final Circle thisCircle = (Circle) getHyperplane(); final Circle otherCircle = (Circle) hyperplane; final double angle = Vector3D.angle(thisCircle.getPole(), otherCircle.getPole()); if (angle < thisCircle.getTolerance() || angle > FastMath.PI - thisCircle.getTolerance()) { return Side.HYPER; } else { return ((ArcsSet) getRemainingRegion()).side(thisCircle.getInsideArc(otherCircle)); } } SubCircle(final Hyperplane<Sphere2D> hyperplane,
                     final Region<Sphere1D> remainingRegion); @Override Side side(final Hyperplane<Sphere2D> hyperplane); @Override SplitSubHyperplane<Sphere2D> split(final Hyperplane<Sphere2D> hyperplane);  }
@Test public void testSide() { Circle xzPlane = new Circle(Vector3D.PLUS_J, 1.0e-10); SubCircle sc1 = create(Vector3D.PLUS_K, Vector3D.PLUS_I, Vector3D.PLUS_J, 1.0e-10, 1.0, 3.0, 5.0, 6.0); Assert.assertEquals(Side.BOTH, sc1.side(xzPlane)); SubCircle sc2 = create(Vector3D.PLUS_K, Vector3D.PLUS_I, Vector3D.PLUS_J, 1.0e-10, 1.0, 3.0); Assert.assertEquals(Side.MINUS, sc2.side(xzPlane)); SubCircle sc3 = create(Vector3D.PLUS_K, Vector3D.PLUS_I, Vector3D.PLUS_J, 1.0e-10, 5.0, 6.0); Assert.assertEquals(Side.PLUS, sc3.side(xzPlane)); SubCircle sc4 = create(Vector3D.PLUS_J, Vector3D.PLUS_K, Vector3D.PLUS_I, 1.0e-10, 5.0, 6.0); Assert.assertEquals(Side.HYPER, sc4.side(xzPlane)); SubCircle sc5 = create(Vector3D.MINUS_J, Vector3D.PLUS_I, Vector3D.PLUS_K, 1.0e-10, 5.0, 6.0); Assert.assertEquals(Side.HYPER, sc5.side(xzPlane)); }