I'm trying to work out an algorithm where, given the equation for a spiral in polar coordinates, $r(\theta)$, and a point rectilinear coordinates, $P(x,y)$, I can work out the minimum distance between that point and the curve traced by that spiral. I was hoping to have a general solution for any spiral form, but if that's not possible, then a solution for a Fermat spiral $$r(\theta)=\pm a\sqrt{\theta}$$ would be most preferable.
I've tried to find a global minima using the second and third differential of the distance equation, but I keep getting stumped. Any one have any ideas? Thanks very much in advance.