Line Segment Intersection
✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Oct 3, 2014
An interactive line segment intersection test visualizes a red segment controlled by the mouse crossing a black horizontal sine wave. A spatial index tree organizes the wave's segments, and as the mouse moves, the d3.geo.path projection is used to redraw the test line, highlighting any intersecting segments in red. The example uses D3.js and a custom tree.js data structure to efficiently query for collisions based on bounding-box extents.
AI-generated descriptiongpl-3.0 Licensed