Interpolation, Method -> "Voronoi"

Interpolation[funcvaluelist, Method→"Voronoi", (options)][x], where funcvaluelist is a list of scattered control points together with the function values in these points, returns the function value of the nearest control point to x. The function is thus constant in regions.     If two control points are at the same minimum distance, the function value of the first is returned.
  • To use Interpolation, Method→"Voronoi", you first need to load the Obtuse Package using Needs["Obtuse`"].
  • The following options can be given:
DistanceFunctionAutomaticdistance function to use in calculation of the distance matrix and the calculation of the distance from the interpolation point to the control points. Note, that the function here is expected to return the square of the distance
Click for copyable input
Some 2D points:
Click for copyable input
Add function values to the 2D point table:
Click for copyable input
Test interpolation in one point:
Click for copyable input
Check with the original function in the same point:
Click for copyable input
If the same interpolation should be used in many different points, the function can be precompiled without specifying in which point it will be used. Not very much time is gained by this, in this case.
Click for copyable input