crossing.point: Crossing Point

View source: R/crossing.point.R

crossing.pointR Documentation

Crossing Point

Description

Return point where two lines cross

Usage

crossing.point(l1, l2)

Arguments

l1, l2

matrices representing two lines, where first two columns are x and y values respectively

Value

a data.frame of x and y values of points where lines cross

Author(s)

Eric Archer eric.archer@noaa.gov

Examples

x <- 1:100
line1 <- cbind(x, 3 + 3 * x)
line2 <- cbind(x, 10 - 3 * x)
plot(line1[, 1], line1[, 2], type = "l", col = "red")
lines(line2[, 1], line2[, 2], col = "blue")
cr.pt <- crossing.point(line1, line2)
print(cr.pt)


swfscMisc documentation built on Sept. 8, 2023, 5:55 p.m.