Learn R Programming

IceCast (version 2.1.0)

check_intersect: Check if line segments intersect

Description

Find if two line segments intersect

Usage

check_intersect(a, b, c, d, seq = FALSE)

Arguments

a

first coordinate of first line segment

b

second coordinate of first line segment

c

first coordinate of second line segment

d

second coordinate of second line segment

seq

indicator for whether the two line segments are intersecting

Value

boolean indicating if there is an intersection

Examples

Run this code
# 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