How do I compute the linear index of a 3D coordinate and vice versa?
If I have a point (x, y z), how do I find the linear index, i for that point? My numbering scheme would be (0,0,0) is 0, (1, 0, 0) is 1, . . ., (0, 1, 0) is the max-x-dimension, .... Also, if I have a linear coordinate, i, how do I find (x, y, z)? I can't seem to find this on google, all the results are filled with other irrelevant stuff. Thank you! Kevin There are a few ways to map a 3d coordinate to a single number. Here's one way. some function f(x,y,z) gives the linear index of coordinate(x,y,z). It has some constants a,b,c,d which we want to derive so we can write a useful conversion