powered by
compute the distance of a point from a line given the x, y axes of the point and the slope and intercept of the line.
distancePointLine(x, y, slope, intercept)
A numeric vector, x axis of the points
A numeric vector, y axis of the points
A number, the slope of the line
A number, the intercept of the line
A numeric vector, the length of the pointS from the line.
http://healthcare.ai
This helper funtion is originally found here http://paulbourke.net/geometry/pointlineplane/pointline.r
https://github.com/bryanhanson/ChemoSpecMarkeR/blob/master/R/findElbow.R
healthcareai
# NOT RUN { distancePointLine(c(2,0),c(3,2),-0.5,2.5) # }
Run the code above in your browser using DataLab