Back to Discover
Curiosity

The Hilbert Curve: How a Line Can Fill a Plane

The Hilbert curve is a recursively constructed fractal path whose successive approximations fold back on themselves with growing density, converging in the limit to a continuous image of the unit interval that passes arbitrarily close to every point of the unit square.

Before you enter

A complete interactive classroom, not just a preview.

Start when you are ready to enter this Stage's 9 scenes and explore, respond, and learn as you go.

9
Scenes
18 min
Estimated
Content language: en-US
Start this Stage
Sign-in may be required to play
What happens inside
  1. 01Can a Line Fill a Square?slide
    Question

    Open with the geometric paradox: a line is 1D, a square is 2D, and dimension says one cannot equal the other. Pose the driving question and preview the recursive U-shape that will resolve it.

    • A line has length but zero area; a square has area
    • We are asking whether a single continuous path can pass through every point of a square
    • The Hilbert curve is the canonical visual answer to this paradox
  2. 02Your First Guessquiz
    Prediction

    Ask the learner to commit to one intuition about the Hilbert curve before seeing any construction.

    • Make an explicit prediction about what the curve looks like
    • Test whether the learner assumes it is a spiral, a grid walk, or a true limit object
  3. 03Build the Hilbert Curve Step by Stepinteractive
    Evidence

    Let the learner choose the recursion order n and watch the Hilbert polyline unfold inside the unit square, with the path traced in real time and the grid cells visited highlighted.

    • Each order divides the square into a 2^n by 2^n grid
    • The path visits exactly one cell per step, traversing all 4^n cells without crossing itself
    • Higher n visibly crowds more of the square interior
  4. 04Compare Orders Side by Sideinteractive
    Evidence

    Display iterations n=1, 2, 3, and 4 next to each other so the learner can directly see how density grows while path length doubles each time.

    • Order 1 is a simple U of three segments
    • Each step turns every segment into four rotated copies
    • Path length doubles (2^n) while bounding region stays fixed
  5. 05The Recursive Recipeslide
    Explanation

    Explain the substitution rule: take any Hilbert polyline, replace each of its 4^k segments with four quarter-sized U-copies rotated and flipped into the four quadrants, then rescale. This is the same rule at every scale, which is why the curve is a fractal.

    • Self-similarity: the whole curve looks like four rotated copies of itself
    • Continuity is preserved at every join by construction
    • The limit curve is continuous because each iteration is continuous and they converge uniformly
  6. 06How Close Does It Get?interactive
    Explanation

    Show that as n grows, the maximum distance from any point in the square to the nearest point on the curve shrinks toward zero, illustrating that the limit is genuinely space-filling.

    • Pick any point in the square by clicking
    • See the nearest segment of the Hilbert polyline light up
    • Watch the distance drop sharply as n increases
  7. 07What the Limit Is — and Is Notslide
    Boundary

    Clarify common misconceptions: the limit is a curve, not a filled region; it is continuous but nowhere differentiable; it has a well-defined point for every t in [0,1], but it is not an injective map.

    • The limit has the cardinality and topology of an interval, not of an area
    • Multiple values of t can map to the same square point
    • Space-filling here means the image covers the square, not that the curve has thickness
  8. 08From Map to Image: Hilbert in the Wildinteractive
    Transfer

    Transfer the idea: ask the learner to map a 16x16 grayscale image to a 1D Hilbert index and then 'unfold' it back, comparing locality preservation against a naive row-major scan.

    • Hilbert order keeps spatially nearby pixels nearby in 1D
    • Row-major order scatters neighbors far apart
    • This is why Hilbert curves are used in spatial databases and image compression
  9. 09Answering the Driving Questionslide
    Resolution

    Close the loop: restate the question, summarize that the Hilbert curve is a recursive fractal path whose limit is a continuous surjection from [0,1] onto the unit square, and note its real-world role in preserving locality.

    • The Hilbert curve is a specific space-filling curve defined by a U-substitution rule
    • Each iteration is a 1D path; the limit fills the 2D square
    • It is a theoretical object with practical uses in mapping, indexing, and rendering
Discussion

Discussion threads for a Stage aren't available yet.

Where this leads
Explore more

More in Math & Logic

See all