Line Intersection Detector
Overview
The Line Intersection Detector finds all intersections among a set of line segments using the Bentley-Ottmann sweep line algorithm. Add line segments and watch as the algorithm discovers intersections efficiently. Perfect for understanding plane sweep algorithms and computational geometry techniques.
Tips
- Bentley-Ottmann algorithm runs in O((n + k) log n) where k is intersections
- Uses sweep line and event queue for efficiency
- Much faster than naive O(n²) pairwise checking
- Applications: CAD systems, map overlay, polygon operations
- Watch the sweep line move from left to right
- Maintains active segments intersecting the sweep line
- Detects both endpoint events and intersection events