Examine the code for Example 2. Notice that the only difference between this example and Example 1 is the call to set igr to indicate that gradient estimates are to be used. Compare the plot from example 1 with the plot from example 2. The plot from example 2 has continuous partial derivatives, even at the original data values.

For further background on non-linear natural neighbor interpolation, review the section in the introduction on the interpolation method used in Natgrid. Complete details are in Dr. Watson's book nngridr.

Increasing bI to values larger than the default value of 1.5 may produce an underflow, since bI is ultimately used in a negative exponent of an exponential function. If an underflow occurs, you need not be concerned about it.

The default values for bI and bJ are chosen to produce a relatively smooth plot for most data sets. You may want to modify the values of bI and bJ to see what effect this has on your interpolations. The values can be adjusted so that the ultimate results can vary from nearly natural neighbor linear interpolation to a very smooth surface.