{"version":"1.0","type":"rich","title":"line-intersection","description":"This interactive visualization demonstrates the Bentley–Ottmann algorithm for finding all intersections among a set of line segments. Users can drag endpoints to reposition lines, click to add new segments, and right-click to remove them. The algorithm employs a sweep line that moves down the screen, maintaining the left-to-right order of line x-positions at the current y-coordinate in the panel on the right. As the sweep line encounters segment endpoints or intersections, it checks only adjacent pairs, achieving O(n log n + I log n) complexity instead of O(n²) for all pairs. The SVG rendering shows the line segments with draggable endpoints and displays the current sweep-line state, with red points marking intersection events.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-42118e82a0756867276c9afe5567e0c5?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}