Arc2D aNegative = new Arc2D.Double(-100, -100, 200, 200,
-45, -270, Arc2D.PIE); // this rectangle surely have all vertices inside the // arc above but intersects the pie slices
Rectangle2D rect = new Rectangle2D.Double(-20, -40, 40, 80);
String failText = "Test failed: rect should not be contained in arc due to "
+ "intersections with radii";
publicvoid runTest() {
boolean contains = aNegative.contains(rect.getX(),
rect.getY(),
rect.getWidth(),
rect.getHeight()); if (contains) { // test failed thrownew RuntimeException(failText);
}
}
publicstaticvoid main(String[] args) {
NotConvexPieTest test = new NotConvexPieTest();
test.runTest();
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.