Possible Duplicate:
Find the Intersection Points of All the Line Segments
嗨,
我有一组由 2 个点定义的线。您能给我推荐一种可以找到所有交叉点的快速算法吗?
谢谢
最佳答案
如果您指的是线段,您可以使用 Bentley-Ottmann algorithm它查找 O((n+k)*log(n))
中的所有交叉点,其中 k
是交叉点总数,n
是您的集合中的段数。
关于algorithm - 查找线交叉点算法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4997071/