MathGroup Archive 2010

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

Search the Archive

Re: How to interpolate vectors?

Mathematica should be able to do this straight off, as long as you might
represent the data on a rectilinear grid, just supply vectors as function
values for the control points. An example:

a = Flatten[
  N[Table[{x, y, {Sin[x] Sin[y], Cos[x] Cos[y]}}, {x, 0, 2*Pi, 
     Pi/6}, {y, 0, 2*Pi, Pi/6}]], 1];

Interpolation[a][0.3, 0.4]

gives {0.116014, 0.882871}

({Sin[x] Sin[y], Cos[x] Cos[y]} /. {x -> 0.3, y -> 0.4} gives {0.115081,

You might also do

b = Flatten[
  N[Table[{{x, y}, {Sin[x] Sin[y], Cos[x] Cos[y]}}, {x, 0, 2*Pi, 
     Pi/6}, {y, 0, 2*Pi, Pi/6}]], 1]

Interpolation[b][0.3, 0.4]

which gives the same.
You mention something about a curvilinear grid, but maybe you could use some
rectilinear parameters to represent this?
(Longitude and latitude?) Then one might ask if an interpolation function is
adequate for wind data, but that is another question, maybe outside the
realm of Mathematica.

I am still working on another of your questions, but please be patient. I
have my job to do (what I am doing just now cannot be mentioned here) and a
garden to harvest.

Best regards

Ingolf Dahl

> -----Original Message-----
> From: Szymon Roziewski [mailto:szymon.roziewski at]
> Sent: den 5 oktober 2010 11:37
> To: mathgroup at
> Subject: [mg112907] How to interpolate vectors?
> Hello there,
> Does anybody know how to interpolate vector data e.g. wind data?
> For example I have wind data on grid 448 columns and 615 rows on
> grid and I need this on grid 132x145 which is uniform.
> Does Mathematica provide such a function or maybe someone has that.
> Kind regards,
> Szymon

  • Prev by Date: Re: suggestions for version control or backup systems?
  • Next by Date: Re: More universal way of writing gradient
  • Previous by thread: How to interpolate vectors?
  • Next by thread: Re: How to interpolate vectors?