Package org.tinfour.utils
Class Polyside
- java.lang.Object
-
- org.tinfour.utils.Polyside
-
public final class Polyside extends Object
A utility for determining whether a specified coordinate is inside a polygon defined by IQuadEdge instances.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPolyside.ResultAn enumeration indicating the result of a point-in-poygon test
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Polyside.ResultisPointInPolygon(List<IQuadEdge> list, double x, double y)Determines if a point is inside a polygon.
-
-
-
Method Detail
-
isPointInPolygon
public static Polyside.Result isPointInPolygon(List<IQuadEdge> list, double x, double y)
Determines if a point is inside a polygon. The polygon must be a simple (non-self-intersecting) loop, but may be either convex or non-convex. The polygon must have complete closure so that the terminal vertex of the last edge has the same coordinates as the initial vertex of the first edge. The polygon must have a non-zero area.- Parameters:
list- a list of edges.x- the Cartesian coordinate of the query pointy- the Cartesian coordinate of the query point- Returns:
- a valid Result enumeration
-
-