Polygon.contains

Polygon.contains

Class Overview | Class Members | This Package | All Packages

Syntax 1
public boolean contains( Point p )
Parameters
p
the point to be tested
Description
Determines whether the specified point is inside the Polygon. Uses an even-odd insideness rule (also known as an alternating rule).



Syntax 2
public boolean contains( int x, int y )
Parameters
x
the x coordinate of the point to be tested.
y
the y coordinate of the point to be tested.
Returns
true if the point (xy) is contained by this polygon; false otherwise.
Description
Determines whether the specified point is contained by this polygon.

(The contains method is based on code by Hanpeter van Vliet [hvvliet@inter.nl.net].)