dhale / jtk

The Mines Java Toolkit
http://inside.mines.edu/~dhale/jtk/
Apache License 2.0
83 stars 56 forks source link

extrapolate for points outside the convex hull by returning the value of the nearest neighbor sample point. #9

Closed dizzzz closed 9 years ago

dizzzz commented 9 years ago

Patch supplied by my colleague; Please could you check if it is worth pulling it in?

My colleagues discription:

Before: Sibson's interpolant is undefined at points on or outside the convex hull of sample points. In this sense, Sibson interpolation does not extrapolate; the interpolant is implicitly bounded by the convex hull, and null values are returned when attempting to interpolate outside those bounds.

After: Sibson’s interpolant will extrapolate for points outside the convex hull by returning the value of the nearest neighbor sample point.

dhale commented 9 years ago

These changes are inconsistent with the class documentation. Moreover, this nearest-sample extrapolation will yield discontinuities in values computed on and outside the convex hull of scattered sample points. To avoid such discontinuities is one of the reasons we use Sibson interpolation.