Take a look at the kd-tree and octree datastructures on Wikipedia. I think a kd-tree or octree would work for you. I'm assuming you have randomly scattered pairs of points, not some lattice of calculated values. (Which do you have?)
Be more clear in your description. First of all, why would you have trouble representing your gradient? It's a triple of real numbers. I don't know what language you're using, but this is easy to do.
As for calculating the gradient, I take it you mean you want to interpolate. Search for interpolation methods online. If linear interpolation is sufficient, you'd want to find the four nearest neighbors and use them to get a linear function of gradient w.r.t. position. (It's just solving a linear system of equations.) If you need some other kind of interpolation (approximating second derivatives, etc), I don't really know anything about those methods (I could make up a few on the spot that would work, but wouldn't be ideal), but if you told me what you were thinking, I could tell you if it makes sense.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
I wouldn't say it's 6-dimensional. What does dimension even mean in this context? You have pairs of three-dimensional points.
What do you mean by 'gradient'? Do you know what you mean? The term 'gradient' generally refers to functions that map values in R^n into R (where R is the set of real numbers, R^n the set of n-tuples of real numbers). For functions that map value in R^3 into R^3 (which your set of points represents?) there is no such thing as the 'gradient'. There is however, the generalization of the gradient, known as the Jacobian (which is more like a generalization of the derivative of a single-variable function). You'd get a 3x3 matrix for the Jacobian of a function f : R^3 -> R^3.
So is your set of points a set of gradients of some other implicit function? Or is it a function of which you want to take the Jacobian? You seem to be unclear about what you want.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177