View source: R/points2equation.R
points2equation | R Documentation |
Two-point from is often seen in German national forest inventory data, we want to get an equation of form y = a + bx.
points2equation(p1, p2 = c(0, 0))
p1 |
The first point (x, y). |
p2 |
The second point (x, y). |
A named vector with intercept ["a"] and slope ["b"].
If both points have the same value for x, no function exists. Then
the intercept is NA
and the slope gives the value of x.
Other geometry functions:
get_intersection()
,
vector_length()
points2equation(c(0, 4), c(1, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.