Check if a polygon overlaps with a rectangle: Difference between revisions
Check if a polygon overlaps with a rectangle (view source)
Revision as of 06:11, 23 October 2023
, 7 months ago→{{header|Julia}}
mNo edit summary |
|||
Line 515:
for axis in a
if projectionoverlaps(projectiononaxis(poly1, axis), projectiononaxis(poly2, axis))
return
end
end
end
return
end
Line 538:
rect2 = Rectangle with (x = 1.0, y = 0.0, w = 8.0, h = 2.0)
poly and rect1 overlap?
poly and rect2 overlap?
</pre>
|