找到交点所有的线段 [英] Find the Intersection Points of All the Line Segments

查看:143
本文介绍了找到交点所有的线段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于线段的列表,找到交点的最简单的方法是遍历线段列表中,检查它们是否相交,并记录交点如果他们做

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.

不过,这种方法的运行时间为O(n ^ 2),这是非常低效的。是否有任何其他的算法,可以加速这一进程?

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?

推荐答案

宾利奥特曼算法可能是你所期待的。

这篇关于找到交点所有的线段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆