Saturday, October 22, 2016

Twitchy Hilbert

A while ago I read this article about the Hilbert Curve and I totally misunderstood it. I thought it was presenting a 1-1 mapping between the number-line and the Hilbert Curve. I was very confused at the time and if I had looked a little more carefully I would have seen I was wrong.

The mapping that was presented was not 1-1 but it was REALLY COOL. And it did map every point in [0,1] to a point in [0,1]X[0,1]. My misunderstanding lead me to use the mapping presented in a Java program that tried to draw the Hilbert curve using the mapping. Essentially I had a parameter t which would go from 0 to 1 in steps of size S. I drew a line between ti and ti+1 for every i. At the end I connected to the starting point and filled it in. I did not make the Hilbert curve, but my creation was very interesting. Below is a GIF of it where I vary S over time.

Some pictures of the shape with various increments: