# NOT RUN {
# Straight lines (empirical)
line1 <- data.frame(x = c(1, 9), y = c(1, 9))
line2 <- data.frame(x = c(9, 1), y = c(1, 9))
curve_intersect(line1, line2)
# Curved lines (empirical)
curve1 <- data.frame(Hmisc::bezier(c(1, 8, 9), c(1, 5, 9)))
curve2 <- data.frame(Hmisc::bezier(c(1, 3, 9), c(9, 3, 1)))
curve_intersect(curve1, curve2)
# Curved lines (functional)
curve1 <- function(q) (q - 10)^2
curve2 <- function(q) q^2 + 2*q + 8
curve_intersect(curve1, curve2, empirical = FALSE, domain = c(0, 5))
# }
Run the code above in your browser using DataLab