View source: R/geom_l2lIntersect.R
lineIntersect2D | R Documentation |
Compute line intersects based on coordinates for points along the lines
lineIntersect2D(l1, l2)
l1 |
a 2D coordinate matrix-like object defining two points (one per row) along the first line. Only the first two columns (x,y) will be used. |
l2 |
a 2D coordinate matrix-like object defining two points (one per row) along the second line. Only the first two columns (x,y) will be used. |
A vector with 2D intersection coordinates or NA if lines are parallel
This is a wrapper function for the l2lIntersect, which is awkward to use as is.
Cornel M. Pop
l1 <- rbind(c(1,5), c(3,2))
l2 <- rbind(c(2,3), c(4,4))
lineIntersect2D(l1, l2) # 2.250, 3.125
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.