2

I have a 3rd-degree polynomial $f(x)$ and a 2D point $p=(x,y)$. I want to find a point $p'$ on the polynomial that has the smallest distance between $p$ and $p'$: $$\min_{p'=(x',y'), p'\in{f}}{\sqrt{(x'-x)^2+(y'-y)^2)}}$$

Is there a formula to find such $p'$?

nrofis
  • 210
  • 1
    Minimizing $,(x'-x)^2+(f(x')-y)^2,$ amounts to solving a quintic equation in $,x',$, which means no closed form solutions in the general case. – dxiv Dec 10 '21 at 23:07
  • I don't believe there's a closed-form solution even in the case $f(x)=x^3$ and $p'=(1,0)$. – Greg Martin Dec 10 '21 at 23:25
  • @dxiv : Probably easier to solve each of $f(x') - y = \pm (x' -x)$. If I weren't travelling in a few hours, I'd see if there is any hope of deforming $f( (x'-u) +u)$ (applying the binomial formula) to deform $f$ along $u \in [0,x]$ to tie the minimum/-a to features of $f(x')$. – Eric Towers Dec 11 '21 at 08:50
  • @EricTowers I may be missing something but I don't see how those two equations follow. As to the second part, there is indeed the possibility that the particular form of the equation allows for some shortcut, though that's not immediately obvious. – dxiv Dec 11 '21 at 17:34
  • @dxiv : You are right. I had misread "minimize $A^2 + B^2$" as "solve $A^2 + B^2 = 0$". Regarding the deformation: I expect that when $y$ is greater than the $y'$ for $x'$ in a sufficiently wide neighborhood of $x$, a local maximum of $p$ deforms approximately to the minimum of the objective. Symmetrically, for $y \ll y'$s near $x$, a local minimum of $p$ deforms to the approximate minimum of the objective. When $y'$ is close to the polynomial, though, the deformation will not be as simple. – Eric Towers Dec 12 '21 at 00:56

0 Answers0