lineCoefs: Compute 2D line coefficients

View source: R/geom_l2lIntersect.R

lineCoefsR Documentation

Compute 2D line coefficients

Description

Computes line equation coefficients This function is not meant to be called directly.

Usage

lineCoefs(pt1, pt2)

Arguments

pt1

a vector with 2D coordinates of a point on the line. Additional dimensions are ignored

pt2

a vector with 2D coordinates of a second point on the (direction). Additional dimensions are ignored

Value

A vector with computed line equation coefficients

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

l <- rbind(c(1,5), c(3,2))
Lithics3D:::lineCoefs(l[1,], l[2,]) # 3, 2, 13
l <- rbind(c(1,5,2), c(3,2,0))
Lithics3D:::lineCoefs(l[1,], l[2,]) # 3, 2, 13

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