I have a flattened 3D array in row-major format with an index, $I$, defined as $I = x + y D_x + z D_x D_y$, where $x$, $y$, and $z$ are the indices and $D_x$, $D_y$, and $D_z$ are the dimensions of the 3D array. How can I obtain the original set of coordinates from the index $I$?
(This question has been asked a number of other places on StackExchange with no actual derivation of the solution.)