@mocanvas/editor · function

intersectLineSegmentLineSegment

declare function intersectLineSegmentLineSegment(a1: VecLike, a2: VecLike, b1: VecLike, b2: VecLike, precision?: number): null | Vec

Where the segments a1→a2 and b1→b2 cross, or null if they do not.

precision is the tolerance on the parametric bounds, so that two segments meeting exactly at an endpoint after a transform still count as meeting.

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.