normal-line
✓ Published0🌍 Public
11wheel
Last edited Jun 4, 2017
Created on Jun 4, 2017
Two draggable points define a line segment, and the visualization highlights both its angle and its normal (perpendicular) line, which rotate and rescale as the points move. The code uses D3 v4.8.0 and a custom `drag` interaction to update an SVG. It draws the angle and normal as colored strokes, while a filled path forms a rectangle spanning the two points, with the distance computed via `Math.atan2` and `Math.sqrt`. The example demonstrates basic geometric calculations and interactive SVG rendering.
AI-generated descriptionCalculating the normal between two points