image thumbnail

Fast Line Segment Intersection

version (3.5 KB) by U. Murat Erdem
Finds the pairwise intersection points between line segments in 2D Cartesian space.


Updated 10 Apr 2010

View License

OUT = LINESEGMENTINTERSECT(XY1,XY2) generates intersection analysis between the line segment sets given in XY1 and XY2. Code can handle coincident and parallel lines.

The main emphasis is on speed. The code is fully vectorized and it runs pretty fast (orders of magnitude) compared to some of the previous postings.

Cite As

U. Murat Erdem (2022). Fast Line Segment Intersection (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!