2

I understand the mapping,

$H:[0,1] \rightarrow [0,1] \times [0,1]$,

through a Hilbert curve $H$ is not one-one and therefore $H$ in general may not be invertible. However, here is a nice illustration of Hilbert curve mapping in both directions and the author has in fact provided an animation in which we have at least one point in $[0,1]$ mapped if we click on a coordinate $(x,y)$ in the Hilbert curve animation.

From the authors code I am able to generate the $(x,y)$ coordinate for a given point in $[0,1]$ by converting into a quadit. However, given a $(x,y)$ how do I recover at least one point in $[0,1]$ that maps to that coordinate, just like how the author has done in the animation?

Thanks!

1 Answers1

1

As you said, the Hilbert curve is not "one to one"

That means you CANNOT find the number in $[0,1]$ such that the image of this number is your point.

However, given $(x,y) \in [0,1]^2$, you can find $t \in [0,1]$ such that the distance between $(x,y)$ and $H(t)$ is as small as you want, but still non null.

For this approximation, you can look at the wiki page: https://en.wikipedia.org/wiki/Hilbert_curve#Applications_and_mapping_algorithms

You can use the function ˋxy2dˋ with arbitrary precision and then remap the range $[0, 2^{2n}-1]$ to $[0,1]$

EDIT

I was totally wrong !

It is true that a space filling curve cannot be one to one (see here)

But as said in the wiki page, the Hilbert curve is surjective.

That means that for a point in the square, you will find at least one antecedent, and possibly many.

If you create an algorithm, it will compute one such antecedent

As an exemple, $H(1/12)=H(11/12)$ if I'm not mistaken

rambi
  • 215