View source: R/get_intersection.R
get_intersection | R Documentation |
Get the intersection point of two straight lines given in slope–intercept form.
get_intersection(x, y)
x |
A named vector with intercept ["a"] and slope ["b"]. |
y |
A named vector with intercept ["a"] and slope ["b"]. |
A named vector giving the intersection, NULL
if the
lines do not intersect, NaN
if they are identical.
Other geometry functions:
points2equation()
,
vector_length()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.