Private
constructorPrivate
boundsPrivate
containsChecks if this polygon contains any of the points of the other polygon.
Polygon whose points are or are not part of this polygon.
Verifies whether a point reside inside this polygon or not. If the point is positioned at the periphery, it should be considered as not contained.
Checks if this polygon and the other polygon contains the same points.
Polygon to compare with.
Private
firstReturns the first segment that is intersected by the argument segment, and the point where they intersect. Returns none if no intersect exists.
Private
intersectionReturns a set with tuples of all the intersecting points and the corresponding line segment where they intersect.
Private
lineReturns the line segment that starts from point p, throws exception if no such line segment exists.
Identifies if this polygon somehow overlaps the other polygon.
Static
fromCreates a Polygon from the given points. The points should preferably be given clockwise for the polygon, but if they are not, the given line segments will be corrected to make sure that they are clockwise oriented. The points are also not allowed to define lines that intersect other lines in the polygon. Ie. giving [0,0], [1,1], [1,0], [0,1] would not be allowed since line segments would intersect in the point [0.5, 0.5].
The given points that define the polygon. Lines are defined between points next to each other in the array.
Generated using TypeDoc
A polygon is defined by a number of line segments that enclose an area.