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.
Asked
Active
Viewed 26 times
1 Answers
0
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

AnT stands with Russia
- 312,472
- 42
- 525
- 765