Class Polyside


  • public final class Polyside
    extends Object
    A utility for determining whether a specified coordinate is inside a polygon defined by IQuadEdge instances.
    • 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 point
        y - the Cartesian coordinate of the query point
        Returns:
        a valid Result enumeration