Determines which point in a list is closest to the input. 0 is used if all are further from epsilon.
findNearestPoint(x, y, points, eps, deep = TRUE)
A numeric x coordinate.
A numeric y coordinate.
A list comprised of x coordinates, y coordinates, such as output by pointsToList
. Should represent the attractors of fun
.
An epsilon, expected to already be squared, used to determine when a point is close enough. Only important if deep
is true.
If true, only return a point if it is within epsilon distance. Otherwise, return the closest point.