I have a regular grid in cylindrical co-ordinates (R, z, theta). At each grid point I have a value for the density at that point. I am looking for advice on how to interpolate the density values to get the value at a certain point within a 3D grid cell, using the values from the 8 grid points around it. Is there an R package that will make this simple?
I have tried to search for answers, but most seem to be related to the 'grid' plotting package.
e.g., some sample data:
R <- c(1,2,3)
z <- c(1,2,3)
th <- c(1,2,3)
dens <- array(rep(1, 3*3*3), dim=c(3, 3, 3))
dens[1,2,1] <- 2
How do I get the value of dens at (R,z,th) = (1.5,1.5,1.5) ?