Description Usage Arguments Details Value Examples
Computes 2D orthogonal distance between a point and a line given the points coordinates and the line's slope and intercept or model formula
1 |
x |
numeric, the x coordinate of the point |
y |
numeric, the y coordinate of the point |
slope |
numeric, the slope of the line |
intercept |
numeric, the slope of the line |
form |
formula of type |
if slope
and intercept
are missing, a model formula of form lm(y~x)
can be passed to form
.
The distance between the point and line
1 2 3 4 5 6 7 8 9 10 11 12 | x <- runif(1:10)
y <- x*0.5
xy.lm <- lm(y~x)
x.p <- y.p <- -3
#one way . . .
dist.2d.line(x.p,y.p,form=xy.lm)
#or another
dist.2d.line(x.p,y.p,slope=coef(xy.lm)[2],intercept=coef(xy.lm)[1])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.