Interpolate Vectors into rotated grid

3 views (last 30 days)
James
James on 15 Aug 2014
Commented: Ahmet Cecen on 16 Aug 2014
Hello,
I am having trouble finding which is the best functions to use for an interpolation I am doing. I have a set of data stored within a spatial grid in 3D, where each grid point contains a vector. The grid spacing is uniform in x,y,z but not necessarily the same between each direction. This grid is specified by the location of the first grid location (x0,y0,z0) as well as the number of gridpoints along each axis (nx,ny,nz) and the grid spacing in each direction (sx,sy,sz).
I have a second grid which is rotated relative to the first. This grid is specified by the location of the first grid location (u0,v0,w0), the number of gridpoints along each axis (ux,vy,wz), the grid spacing in each direction (su,sv,sw), and the rotation (theta) in the x-y plane relative to the first grid, the second grid cannot have a rotation out of the x-y plane relative the the first grid.
I am hoping to find a simple way interpolate the vectors stored in the original grid onto the rotated grid without having to do massive amounts of restructuring of my data. Any help would be appreciated.
Thanks

Answers (1)

Ahmet Cecen
Ahmet Cecen on 15 Aug 2014
I would first stretch your original grid to be uniform in all directions. Then do planar rotation twice to obtain the new grid. Finally re-size back into your distorted grid if you really need it that way. If you like this and try to implement some of it, I might be able to provide further help, but this is not my expertise. I am simply sharing how I would approach the problem.
  2 Comments
James
James on 15 Aug 2014
I may be misunderstanding, but I do not think that would work. Say my 2nd grid is rotated at an angle 90 degrees from the first. If I have a datapoint which lies on the x-axis originally, if I apply a 90 degree rotation to the first grid it will physically move that point from the x-axis to the y-axis. What I am looking for would be the (interpolated) value in the original grid for all points within the rotated grid.
Ahmet Cecen
Ahmet Cecen on 16 Aug 2014
You can apply 43.2 degree rotations too, it doesn't have to be 90. But yes if you do rotate it 90 degrees it would become the y-axis, then again, that's what your data would actually mean anyways. Check "imrotate" with bilinear interpolation.

Sign in to comment.

Categories

Find more on Interpolation in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!