3 ms·
It looks like the author found this line using manual inspection, but it seems possible to automate the search: https://github.com/BradleyWood/Longest-Line-In-P
by jkaptur 4y ago
It looks like the author found this line using manual inspection, but it seems possible to automate the search: https://github.com/BradleyWood/Longest-Line-In-Polygon/blob/master/README.md https://github.com/BradleyWood/Longest-Line-In-Polygon/blob/.... It might even be sufficiently fast, despite the O(n^3) running time, because the 'n' is the number of points per polygon, not total, and you can operate on each polygon in order of "wingspan" (you can't stop once you find the longest straight line in the longest polygon, but you can once your best line is greater than the wingspan of the remaining polygons).