title: 1D index to 3D coordinates
body: <p>i flattened a 3D array using the following code
  index = x*size*size + y * size + z</p>
  
  <p>but can't figure out how to build the x,y,z indices from the index</p>
  
  <p>i found another stackoverflow question with this but this doesn't work out for me, the indicis  are always off</p>