Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14506

Re: Data interpolation

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Data interpolation
Date 2013-05-16 07:28 +0000
Message-ID <kn21qk$1he$1@smc.vnet.net> (permalink)
References <20130514071748.85CC969EA@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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@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 !
>
> P.S. I have read many threads about the same subject, it seems to be
> serious issue which is not properly addressed.
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Data interpolation Bob Hanlon <hanlonr357@gmail.com> - 2013-05-16 07:28 +0000

csiph-web