lineIntersect2D: Compute 2D line/line intersection

View source: R/geom_l2lIntersect.R

lineIntersect2DR Documentation

Compute 2D line/line intersection

Description

Compute line intersects based on coordinates for points along the lines

Usage

lineIntersect2D(l1, l2)

Arguments

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.

Value

A vector with 2D intersection coordinates or NA if lines are parallel

Note

This is a wrapper function for the l2lIntersect, which is awkward to use as is.

Author(s)

Cornel M. Pop

Examples

l1 <- rbind(c(1,5), c(3,2))
l2 <- rbind(c(2,3), c(4,4))
lineIntersect2D(l1, l2) # 2.250, 3.125

cornelmpop/Lithics3D documentation built on Feb. 10, 2024, 11:54 p.m.