I have a smooth data distribution on a 2D regular grid that is not a rectangular (it is a cross-section of a channel) and I need to find an Interpolating function f[x,y]. I have tried Interpolation[{{x1,y1},f1},{x2,y2},f2},...}] but it doesn't work. Does Interpolation work only on rectangular grid?

Thanks Giovanni

  • $\begingroup$ Have you tried a search on this very site? $\endgroup$ May 29, 2013 at 13:16
  • $\begingroup$ Or how about the Mathematica help? To give a short answer, Interpolation works not only on rectangular grids. $\endgroup$
    – partial81
    May 29, 2013 at 13:24
  • $\begingroup$ Please could you be more specific about the meaning of "doesn't work"? Also, see (20372). (This was suggested by the review panel as a possible duplicate. Clearly the question is not a duplicate so I skipped the review, but the answer is highly relevant. I am leaning toward closing this as TL unless clarification comes from the OP.) $\endgroup$ May 29, 2013 at 19:11

1 Answer 1


Interpolation does not only work on rectangular grids. The grid even need not to be regular.

E.g. let us produce some data (x, y,z) which are not on a regular grid on a disk with radius of 5 in the x-y plane and which have z-values between 4 and 5 with:

data = Transpose[{x, y, z}];

If you plot them with


You get something like

output of plot

You can interpolate the data easily with

f = Interpolation[data, InterpolationOrder -> 1];

Plotting them with

Plot3D[f[x, y], {x, -6, 6}, {y, -6, 6}, 
RegionFunction -> Function[{x, y}, Sqrt[x^2 + y^2] < radius]]


ContourPlot[f[x, y], {x, -6, 6}, {y, -6, 6}, 
RegionFunction -> Function[{x, y}, Sqrt[x^2 + y^2] < radius]]

give you a similar picture as the first one. So you see, interpolation still works for such data.

  • $\begingroup$ This does not work with dimensions greater than 4, e.g. data={{a,b,c,d,e}, ...} -> f[a,b,c,d]=e $\endgroup$
    – image357
    May 3, 2017 at 14:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.