Check if two polygons overlap: Difference between revisions
Content added Content deleted
(→{{header|jq}}: any) |
|||
Line 283:
end;
# If there's an axis for which the projections do not overlap, then false; else true
def polygonsOverlap($poly1; $poly2):
. as $axis
| ($poly1 | projectOntoAxis($axis)) as $proj1▼
|
def poly1: [[0, 0], [0, 2], [1, 4], [2, 2], [2, 0]];
|