I'm facing the following problem: Given an implicit curve given by $f(x,y)=0$ and an initial guess $(x_0,y_0)$ which is hopefully close to the curve, I want to find the point $(x,y)$ on the curve which is closest to $(x_0,y_0)$.
My attempt:
I thought of using FindRoot with the equation repeated twice, i.e.
FindRoot[{f[x,y],f[x,y]},{{x,x0},{y,y0}}]
But this fails spectacularly with $f(x,y)=y-x^2$ and initial points $(0,y_0)$ with $y_0$ large.
Is there a good way to solve this problem?
Thanks!
NMinimize[{EuclideanDistance[{x, y}, {x0, y0}], f[x, y] == 0}, {x, y}]
? $\endgroup$Minimize[]
, no? $\endgroup$