Visualization of Line Intersections search by brute force algorithm

preview_player
Показать описание
The initial step for implementation of an efficient Plane sweep Line Segment Intersection. This visualization shows how lines work its way in a 2D loop to find all the intersections. Basically, every line (yellow envelope) checks against the others (cyan envelope) to find some point intersection.
For this particular setup, there are 25 lines, 60 intersections found, 300 checks and we can see how inefficient this is, as lines found intersections and then they are searched again. But surprisingly, even with this inefficient setup it is faster and efficient than Bentley-Ottmann algorithm for this size of segment lines. In fact, this bruteforce method is faster than Bentley-Ottmann algorithm up to around 200 lines.
The implementation is pretty general and can be used with Java stand alone.

Song: Weirder Stuff - by Geographer

Done in processing and available on GitHub:
Рекомендации по теме