Find the Intersection Points of All the Line Segments

元气小坏坏 提交于 2019-12-18 14:46:14

问题


Given a list of line segments, the easiest way to find the intersection points is to loop through the line segment list, check whether they are intersecting and record the intersection point if they do.

But the runtime of this method is O(n^2), which is very inefficient. Is there any other algorithm that could speed up this process?


回答1:


The Bentley-Ottmann Algorithm may be what you are looking for.



来源:https://stackoverflow.com/questions/4125452/find-the-intersection-points-of-all-the-line-segments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!