Find lines crossings algorithm [duplicate]
Possible Duplicate:
Find the Intersection Points of All the Line Segments
Hi,
I have a set of lines defined by 2 points. Could you please recommend me a fast algorithm which finds all the crossings?
Thanks
In case you mean line-segments, you can use the Bentley-Ottmann algorithm which finds all crossings in O((n+k)*log(n))
where k
is the total numer of crossings and n
is the number of segments in your set.
精彩评论