How to find the shortest distance from a point on a cardinal plane to any function?

17 Views Asked by At

I understand it is possible to find the shortest distance from a point to a straight line, but how do we extend this to any function. For a straight line it is simply the equation of the perpendicular which intersects the point of interest.

If we have a cubic or a quartic function how would I model the shortest (straight line) distance to that function from somewhere on the plane?

I anxiously wait a response.

1

There are 1 best solutions below

0
On

If the curve can be parametrically represented using a single parameter, such as $t\mapsto (x(t),y(t))$ then your task will be minimizing the function $$d(t)=(x(t)-x_0)^2+(y(t)-y_0)^2.$$

If your curve is the graph of a function, then the mapping will be $(t,f(t))$ and so the function to minimize will be $$d(t)=(t-x_0)^2+(f(t)-y_0)^2.$$