get_intersection {treePlotArea}R 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)

[Package treePlotArea version 2.1.0 Index]