For example, if we consider a shape in 2D like a circle at center $(x_0,y_0)$ with radius R so the equation would be:
$$f(x,y)=(x-x_0)^2+(y-y_0)^2-R^2$$
now the normal on the surface is $${\bf \hat n}=\frac{\nabla f}{\|\nabla f\|}=\frac{(x-x_0,y-y_0)}{\sqrt{(x-x_0)^2+(y-y_0)^2}}$$ In this problem, I don't know the point on the circle to compute the normal. I have a point outside of the circle and I would like to find the normal vector from that point to the circle.
One idea is consider the point on the surface as a parametric form $$x=x_0+R\cos t,\\ y=y_0+R\sin t$$ then consider the normal vector as a function of $t$ and then find $t$. In this way, I have to solve fourth order equation, which makes my algorithm very expensive. I was wondering if there is an easier method which doesn't need to solve an equation.
Given a curve a $c$ and with normal $n_0$ at $P_0$ and $P$ outside, the condition is given by
$$P_0\subseteq \{(P+\vec n_o\cdot t) \cap c\}$$
For the circle it suffices that the line is through the center of the circle.
In general, for a generic curve $c$, the problem is hard to solve.