powered by
Given a list of x, y coordinates on a curve, function determines the elbow point of the curve.
elbowPoint(x, y)
vector of x coordinates of points on the curve
vector of y coordinates of points on the curve
an x, y coordinates of the elbow point.
highlight the maximum curvature to identify the elbow point (credit: 'github.com/agentlans')
# NOT RUN { # Generate some curve x <- runif(100, min=-2, max=3) y <- -exp(-x) * (1+rnorm(100)/3) plot(x, y) # Plot elbow points abline(v=elbowPoint(x,y)$y, col="blue", pch=20, cex=3) # }
Run the code above in your browser using DataLab