Skip to main content
100%

two line intersection

✓ Published0🌍 Public
11wheel
Last edited Aug 21, 2016
Created on May 15, 2015

A draggable line-intersection demo lets the user move four endpoints to see where two line segments cross. The intersection point is drawn as a small circle, which turns red only when the segments actually intersect; otherwise it stays gray. The visualization uses D3’s drag behavior and data joins to bind the points and path elements, while a custom `intersection` function in `geometry.js` computes the crossing and checks whether it lies on both segments. Rendering relies on SVG paths and circle elements, with coordinates updated on each drag event.

AI-generated description

Similar vizzes