Hilbert Curves

Hilbert curves are space filling curves that establish a mapping between real numbers and 2D space.


Description

Hilbert curves are space filling curves that establish a mapping between real numbers and 2D space. Based on how densely it fills the space, Hilbert curves have an 'order' parameter. The \( n^{th} \) order Hilbert curve can be drawn using the \( (n-1)^{th} \) Hilbert curve. The 2D space is completely filled only as the limit of order approaches infinity. Hilbert curves are widely used in rendering software and games.




Note:
  1. Although most implementation recursivly draw the curve, the above implementation uses an iterative method.
  2. Hilbert curves of upto 10th order can be comfortably drawn on lower-end devices too.


Developed by ChanRT | Fork me at GitHub