Suppose that I have a space filling curve over a rectangle of width W and height H. For example, for the rectangle:W = 4H = 4I have the following curve:Now, given the following coordinate:X = 1Y = 2We can say that its position on the space-filling curve is 7, as it takes 7 steps walking over the curve to reach that tile. Using that logic, we can build a mapping width  height  x  y  index, such as:spaceFillingIndex(4,4,1,2) = 7As well as its inverse, width  height  index  (x,y).spaceFillingCoordinate(4,4,7) = (1,2)My question is: what is an algorithm that implements spaceFillingIndex, and what is an algorithm that implements spaceFillingCoodinate?
What is an algorithm that maps back and forth from (x,y) coordinates to the index of that point in a space filling curve over a rectangle?
algorithms;search algorithms