How can I detect that a Polygon is intersects with a Rectangle?

James Outlaw

If your Polygon Class inherits from java.awt.Shape, you can use the intersects() method to determine if the polygon intersects the rectangle. Something like this:

if (myPolygon.interesects(myRectangle))  {
// do something
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.