powered by
Find if two line segments intersect
check_intersect(a, b, c, d, seq = FALSE)
first coordinate of first line segment
second coordinate of first line segment
first coordinate of second line segment
second coordinate of second line segment
indicator for whether the two line segments are intersecting
boolean indicating if there is an intersection
# NOT RUN { check_intersect(c(0, 0), c(1, 1), c(2, 2), c(3, 3)) check_intersect(c(0, 0), c(1, 1), c(0.5, 0.5), c(2, 2)) # }
Run the code above in your browser using DataLab