       Re: Data interpolation

• To: mathgroup at smc.vnet.net
• Subject: [mg130798] Re: Data interpolation
• From: Bob Hanlon <hanlonr357 at gmail.com>
• Date: Thu, 16 May 2013 03:27:40 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-outx@smc.vnet.net
• Delivered-to: mathgroup-newsendx@smc.vnet.net
• References: <20130514071748.85CC969EA@smc.vnet.net>

```Without an example it is difficult to address your specific issue. Here is
an interpolation function:

data =
Table[
With[
{r = RandomReal[{0, 5}], t = RandomReal[{0, 2 Pi}]},
{r Cos[t], r Sin[t], Sin[r^2]/r^2}],
{2*10^4}];

f = Interpolation[{Most[#], Last[#]} & /@ data,
InterpolationOrder -> 1];

g[x_?NumericQ, y_?NumericQ] :=
f[x, y]*Boole[x^2 + y^2 <= 25]

Grid[{
{ListDensityPlot[data,
ImageSize -> 300],
Plot3D[g[x, y], {x, -5, 5}, {y, -5, 5},
PlotRange -> All,
RegionFunction ->
Function[{x, y, z}, x^2 + y^2 < 25],
ImageSize -> 300]},
{DensityPlot[g[x, y], {x, -5, 5}, {y, -5, 5},
RegionFunction ->
Function[{x, y, z}, x^2 + y^2 <= 25],
ImageSize -> 300],
ContourPlot[g[x, y] == 0, {x, -5, 5}, {y, -5, 5},
RegionFunction ->
Function[{x, y, z}, x^2 + y^2 <= 25],
ImageSize -> 300]}}] // Quiet

Bob Hanlon

On Tue, May 14, 2013 at 3:17 AM, BBabic <bipsich101 at gmail.com> wrote:

> I have exactly the same problem.
> I can plot list of data with form{{x,y,z}}, with ListDensityPlot.
> However, the interpolation or ListInterpolation do not get similar result
> or complain that it is not rectangular grid.
> Since the data can be easyly plotted and interpolated using
> ListDensityPlot can somebody from Mathematica developers explain us how it
> is done for this purpose.
> Or how we can get the numbers {z} from ListDensityPlot.
> Thank you !
>