Re: Algorithm for distance from point to function



glen herrmannsfeldt wrote:
Thomas Koenig wrote:
Mike.Prager <mike.prager¿@noaa.gov> wrote:

Does there exist any reasonably general algorithm for computer
the distance between the point (x,y) and a function y = f(x)?

Minimize sqrt((xi-x)**2 + (f(xi)-y)**2).

There may be local minima, so you might want a routine that
is good at finding a global minimum. It is only one dimension,
so it shouldn't be too hard.

I usually look in Numerical Recipes.

-- glen

There are at least two ways to look at this. Suppose that the point is
(a,b).

1. Simplify the problem by minimizing the distance squared instead of
the distance. See the recent discussion in this newsgrop of Cernlib's
MINFC.

2. Take the derivative of the distance squared and set it equal to
zero. Equivalently, note that the distance will be minimal where the
line from the point to the curve is perpendicular to the tangent line
to the curve or when their slopes are negative reciprocals.

(y-b)/(x-a) f'(x) = -1 where y=f(x), solve for (x,y).

-- elliot

.



Relevant Pages

  • Re: Average distance between points
    ... convert these distances (one distance for each of the points in your ... image) into a cumulative distribution function curve. ... wouldn't vary much as a function of how dense the dots are distributed ...
    (sci.image.processing)
  • Re: SRs velocity addition -- ANY Experimental Evidence?
    ... >Insisting that the light curve of binaries will be as cahotic ... >About half of all stars are binaries. ... >> The most important is observer distance. ... >while very few of them are, it means that the ballistic theory is wrong. ...
    (sci.physics)
  • Re: SRs velocity addition -- ANY Experimental Evidence?
    ... >Insisting that the light curve of binaries will be as cahotic ... >About half of all stars are binaries. ... >> The most important is observer distance. ... >while very few of them are, it means that the ballistic theory is wrong. ...
    (sci.physics.relativity)
  • Re: Quick and earnest question about MMX
    ... Distance is all the explanation needed, ... The curve gives a wealth of information, ... WHAT observed velocity curve? ... close observer should measure. ...
    (sci.physics.relativity)
  • Plotting the Curves of Coriolis, Einstein, and NoEinstein (is Copyrighted.)
    ... The experimentally measured distance of fall at ... his curve on the same graph will have ... increases as the square of the velocity at any point in time. ... And static weight doesn't change for objects ...
    (sci.physics)