determine if two line segments intersect
SegmentsIntersect( L1, L2 )
SegmentsIntersect( L1, L2, intersection )
SegmentsIntersect( M, locs )
SegmentsIntersect( M, locs, intersection )
line segments given as pairs of points in 2-D space
an array of point coordinates in 2-D space. Each point is a row in the array. M must be C_order and datatype=float
positive integer indices of the three rows of M to treat as input the first location is the point and the other two the ends of the segment
This command returns true if the two line segments intersect and false if they do not. It does so using four calls to PointOrientation.
If the intersection option is given and the segments do not intersect false will be returned, otherwise the coordinate of the intersection will be returned.
If one segment is completely contained within the other, the list of endpoints of the smaller segment will be returned.
plots:-display⁡plottools:-line⁡L,legend=L,color=Red,seq⁡plottools:-line⁡Ki,legend=K ‖i,color=Blue,i=1..7,seq⁡plottools:-line⁡Ki,legend=K ‖i,color=Green,i=8..14,axes=boxed
None of the blue segments intersect L
All of the green segments intersect L
Line 11, completely contained in L
Line 14, partially overlaps L
The ComputationalGeometry[SegmentsIntersect] command was introduced in Maple 2019.
For more information on Maple 2019 changes, see Updates in Maple 2019.
Download Help Document
What kind of issue would you like to report? (Optional)