Computes a kiwaku position from a linear index and a shape.
Behavior is undefined if idx is out of the index space defined by shp.