Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualParadigm Shifter

Posted 26 April 2013 - 10:13 AM

Depends if you want a bounding box (find max/min x and y extents of the object), or if you want an irregular shaped region, in which case you want a point in polygon test, here's one in Java

 

http://stackoverflow.com/questions/8721406/how-to-determine-if-a-point-is-inside-a-2d-convex-polygon

 

and that also mentions this:

 

The java.awt.Polygon class has a number of contains(...) methods if you use Polygon objects to represent your polygon.


#1Paradigm Shifter

Posted 26 April 2013 - 10:13 AM

Depends if you want a bounding box (find max/min x and y extents of the object), or if you want an irregular shaped region, in which case you either want a point in polygon test, here's one in Java

 

http://stackoverflow.com/questions/8721406/how-to-determine-if-a-point-is-inside-a-2d-convex-polygon

 

and that also mentions this:

 

The java.awt.Polygon class has a number of contains(...) methods if you use Polygon objects to represent your polygon.


PARTNERS