Dylan B. answered 11/10/20
Computer science Tutor, Associates degree, Real world experience
The distance between a point (c,d) and your curve is the minimum of the function
To find its minimum, we can forget about the sqrt
and look at the first derivative. Find out where it's 0 (it has to be the minimal distance, as there's no maximum distance). That gives you the x coordinate of the nearest point on the curve. To get the distance you need to calculate the y coordinate, and then calculate the distance to the point (you can just calculate the distance function at that x
, it's the same thing).
Repeat for each of your points.
The first derivative of the distance function, is, unfortunately, a kind of bitch. Using Wolfram's derivator, the result is hopefully (if I haven't made any copying errors):