Determine if there are intersecting segments among others

50 views Asked by At

I have a problem. I have some array of segments(their coordinats) and need to determine which of them are intersecting. I know how to determine if 2 segments are intersecting, it is a bit obvious, but how to do in with an array of segments and with a good time. All that i know, that there is we may use AVL-tree, but i can't figure it out how. Any suggestion how to do it? Thanks in advance.

1

There are 1 answers

0
AnT stands with Russia On

Finding all intersections in an arbitrary group of segments is a classic problem solved by the classic sweep line approach. There's massive amount of information on the Net about how to use sweep line for solving the segment intersection problem.

http://www.cs.tufts.edu/comp/163/notes05/seg_intersection_handout.pdf