l2lIntersect: Compute 2D line/line intersect

View source: R/geom_l2lIntersect.R

l2lIntersectR Documentation

Compute 2D line/line intersect

Description

Compute line intersects based on line equation coefficients This function is not meant to be called directly.

Usage

l2lIntersect(l1, l2)

Arguments

l1

2D line coefficients

l2

2D line coefficients

Value

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

Note

translated from rook at http://stackoverflow.com/questions/20677795/how-do-i-compute-the-intersection-point-of-two-lines-in-python

Author(s)

Cornel M. Pop

Examples

l1 <- rbind(c(1,5), c(3,2))
l2 <- rbind(c(2,3), c(4,4))
# 2.250, 3.125
Lithics3D:::l2lIntersect(Lithics3D:::lineCoefs(l1[1,], l1[2,]),
                         Lithics3D:::lineCoefs(l2[1,], l2[2,]))

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