get_intersection: Get Intersection Point of Two Lines

View source: R/get_intersection.R

get_intersectionR Documentation

Get Intersection Point of Two Lines

Description

Get the intersection point of two straight lines given in slope–intercept form.

Usage

get_intersection(x, y)

Arguments

x

A named vector with intercept ["a"] and slope ["b"].

y

A named vector with intercept ["a"] and slope ["b"].

Value

A named vector giving the intersection, NULL if the lines do not intersect, NaN if they are identical.

See Also

Other geometry functions: points2equation(), vector_length()

Examples

get_intersection(x = c(a = 0, b = 1), y = c(a = 2, b = -1))
get_intersection(x = c(a = 0, b = 1), y = c(a = 2, b = 1))
x <- c(a = 0, b = 1)
get_intersection(x = x, y = x)

treePlotArea documentation built on June 22, 2024, 6:57 p.m.