MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Question about interpolation and ListPlot3D

>   I have an array representing 3 dimensional points
> in a form of their Eucledean coordinates:
> arr = {{x1,y1,z1}, ... ,{xN,yN,zN}};
> (they were generated from a very smooth function).
> 1. I wish to generate a 3D plot of this surface (approximately),
> but format of ListPlot3D does not permit it, since my points
> {xi, yi} do not form a regular grid.
> How I can draw the surface?
> 2. I would like to find value of this function at another point
> {x, y}, the answer obviously depend on the way the function was
> interpolated (extrapolated), but I am interested in any way, as
> simple as possible.
> How to extract the Interpolating Function's value at {x, y} ?
> Zvi Wiener
> zwiener at

For a simple, crude approximation, you might want to have a look at the
message included below:

----- Begin Included Message -----

>From mathgroup-adm at  Sun Mar 19 00:11:36 1995
>Date: Thu, 16 Mar 95 14:22:53 JST
>From: el at (E. Lange)
?To: mathgroup at
>Subject: [mg554] Re: [mg549] suggestions?
>Content-Length: 1548

> There is a rectangular plot of land, several acres in size, which is
> contaminated by a single hazardous waste. We have some chemical
> measurements of the concentation of the waste in the soils at N randomly
> spaced points -- these points are NOT on a grid.
> From other information about the deposition of the waste, we know that the
> function
>         concentration( x, y )
> is well behaved and smoothly varying.....
> So, I want to use a 2D InterpolationFunction in Mma to model the

You might try a simple interpolation using radial basis functions:

data = Table[Random[], {10}, {3}]
c = 5

Transpose[data][[3]] . # / Plus @@ # & [
        E^(-c^2((x-#[[1]])^2 + (y-#[[2]])^2))& /@ data ]
Plot3D[%, {x, 0, 1}, {y, 0, 1}]

The parameter c adjusts the `stiffness' of the interpolation.
For c = 0, the interpolation result is the average concentration of the
waste. For c-->Infinity, the interpolation result is the concentration
at the closest measurement point. You can also try to use other basis
functions, such as 1/d^c instead of E^(-c^2 d), or incorporate
knowledge about the physics of the problem.

In readable notation:

InterpolationRBF[data_, c_][x_, y_] :=
        radial = Table[ E^(-c^2 (
                    (x - data[[i, 1]])^2 + (y - data[[i, 2]])^2) ),
                    {i, Length[data]} ];
        Transpose[data][[3]] . radial / Apply[Plus, radial]
f = InterpolationRBF[data, c];
Show[ Plot3D[f[x, y], {x, 0, 1}, {y, 0, 1}],
      Graphics3D[Point /@ data] ]

Eberhard Lange

----- End Included Message -----

  • Prev by Date: Re: question
  • Next by Date: Re: 1/f noise
  • Previous by thread: Re: Question about interpolation and ListPlot3D
  • Next by thread: Mathematica DXF & Graphics Interest ?