I have rectangular matrix of 3d points sampled from a parametric surface. In my program this matrix provides base points for bilinear interpolation of surface (In any (u,v) point it returns 3d point interpolated from neighboring sampled values). Now I want to find closest point on surface from any other point in 3d space, considering values "between" sampled points of grid.
I'll attach picture with example on 2d curve. Here yellow points are sampled points, red point - point to which we want to find closest, and green - point which we need to find as closest (witness point).