Tests whether the segment a-b intersects the polygon, i.e. it has an endpoint inside the polygon or crosses one of its edges. Works for convex and concave polygons.
a
b
polygon vertices as a flat array [x0, y0, x1, y1, ...]
[x0, y0, x1, y1, ...]
number of vertices to read from vertices
vertices
start of the segment
end of the segment
true if the segment intersects the polygon
Tests whether the segment
a-bintersects the polygon, i.e. it has an endpoint inside the polygon or crosses one of its edges. Works for convex and concave polygons.