@mocanvas/mocanvas · function

intersectSegments

declare function intersectSegments(a1: VecLike, a2: VecLike, b1: VecLike, b2: VecLike): Vec | null

Intersection point of segments a1-a2 and b1-b2, or null when they do not cross. Parallel and degenerate segments never intersect.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.