Skip to content

flekschas/line-seg-intersect

Repository files navigation

Line Segment Intersection

npm version build status code style prettier

Fast testing whether two line segments intersect

Install

npm i line-seg-intersect

API

const isIntersecting = lineSegIntersect(x1, x2, x3, x4, y1, y2, y3, y4)

Checks if two line segments (x1,y1)-(x2,y2) and (x3,y3)-(x4,y4) are intersecting.

Returns true if the two line segments intersect.