Random walk meets digits of pi, meets neat visualization
Take the digits of pi, use them as walking instructions, turn by a fixed angle after each digit. As one can consider pi to behave normal, the walk will stay reasonably close to the starting point.
Don't get me wrong, pi does wander off considerably, but in relation to how far away it could go, it's not much.
Like I said, pi is an untamed beast that likes to wander both the unexplored paths of the canvas and the well-known neighborhood of it's own tail. Here's how it would look like without the transformation:
(10k digits with the noisiest angle, but without fisheye projection)
As you can see, the image is large, it's too far zoomed out, and part
of the trail is missing (it should go to blue as in (0, 0, 255)
).
Thus the idea of using transformed coordinates: the further away from the center, the more crunched/compressed the image is. This allows a very large region to be covered, while still showing the "pattern" at a comfortable size.
(10k digits with the noisiest angle, but with fisheye projection)
I don't know why you're interested, but it's a very simple idea:
- If the distance (to the starting point
(0, 0)
, which will be at the center of the image) is less-or-equal 1, then keep it. - If the distance is bigger, use
1 + ln d
instead.
Here's what a Hilbert Walk (which is great to visualize how a square gets distorted) looks like using this projection:
Thanks for asking.
This composite function has the wonderful property of being
continuously differentiable,
which means that the transition between "keep it" and "use 1 + ln d
"
is smooth.
Also, it means that the covered walk-space grows exponentially with image size, which means that we can always keep the walk "in sight". Don't let pi escape!
These do form a box, but they're distorted by the fisheye projection.
- dark grey: rectangle from
(-2,-1)
to(2,1)
- medium grey: rectangle from
(-20,-10)
to(20,10)
- light grey: rectangle from
(-200,-100)
to(200,100)
Thanks for asking! I want to show you even more images:
For more samples, look at the samples
folder. Or, hey, why don't you
clone it and experiment yourself? Feel free to share awesome images by
making a PR :D