Find all intersections between two sets of line segments
Given two sets of line segments, find all pairs of intersections between the two of them.
var findIntersections =var red =0 0 10 1010 10 10 0var blue =10 1 8
segments [ [ 0, 0 ], [ 10, 10 ] ] [ [ 1, 0 ], [ 1, 8 ] ] intersect
npm install red-blue-line-segment-intersect
Finds all pair of segments between
blue which intersect.
redis a list of line segments encoded as pairs of length 2 arrays
blueis a second list of line segments
visit(r,b)is a function which is called once for each pair of line segments that intersect. If
visitreturns truthy value, then iteration is terminated and that value is returned from the traversal.
Returns The return value of the last call to
(c) 2013-2014 Mikola Lysenko. MIT License