In spite of fylfotphobia, I couldn't resist: In[231]:= Clear[Peano]; Peano[t_, a1_: 1, a0_: 0] := Peano[t, b1_: 1, b0_: 0] = (Peano[t, s1_: 1, s0_: 0] = ((a0 - s0)/(s1 - a1)); Module[{t9 = 9*t, n}, n = Floor[t9]; t9 -= n; Switch[n, 0, Peano[t9, a1/3, a0]/3, 1, (1 + I - I*Peano[t9, -I*a1/3, a0 + a1*(1 + I)/3])/3, 2, (2 + Peano[t9, a1/3, a0 + a1*2/3])/3, 3, 1 + I*(1 + Peano[t9, I*a1/3, a0 + (1 + I/3)*a1])/3, 4, (2 + 2*I - Peano[t9, -a1/3, a0 + (2 + 2*I)*a1/3])/3, 5, (1 + I + I*Peano[t9, I*a1/3, a0 + (1 + I)*a1/3])/3, 6, (2*I + Peano[t9, a1/3, a0 + 2*I*a1/3])/3, 7, (1 + 3*I - I*Peano[t9, -I*a1/3, a0 + a1*(1/3 + I)])/3, 8, (2 + 2*I + Peano[t9, a1/3, a0 + a1*(2 + 2*I)/3])/3, 9, 1 + I]]) In[232]:= Peano[1/2] Out[232]= 1/2 + I/2 In[233]:= Peano /@ {1/9, 5/9} Out[233]= {1/3 + I/3, 1/3 + I/3} Pix: http://gosper.org/peanos.png Suggestion: Frame the second one, hang it on the wall, and tilt it so it looks straight. --rwg Wikipedia: Peano's curve is dense in the unit square<https://en.wikipedia.org/wiki/Unit_square>, and was used by Peano to construct a continuous function<https://en.wikipedia.org/wiki/Continuous_function>from the unit interval <https://en.wikipedia.org/wiki/Unit_interval> to the unit square, motivated by an earlier result of Georg Cantor<https://en.wikipedia.org/wiki/Georg_Cantor>that these two sets have the same cardinality <https://en.wikipedia.org/wiki/Cardinality>. Because of this example, some authors use the phrase "Peano curve" to refer more generally to any space-filling curve.[2]<https://en.wikipedia.org/wiki/Peano_curve#cite_note-2> Dense, hell. It COVERS the unit square. Not "to the unit square". ONTO the unit square. I was a victim of "some authors", for years misattributing Hilbert's spacefill to Peano. "The Peano curve itself is the limit<https://en.wikipedia.org/wiki/Limit_%28mathematics%29>of the curves through the sequences of square centers, as *i* goes to infinity." I.e., the unit square? How doe one take this limit? Total bull. "In 1890, Peano <http://en.wikipedia.org/wiki/Peano> discovered a densely self-intersecting curve, now called the Peano curve<http://en.wikipedia.org/wiki/Peano_curve> ,..." If this statement means anything, ALL spacefilling "curves" "densely self-intersect". The sane phraseology is: All spacefilling functions revisit a dense set (whose closure is the whole image) three times. --rwg On Thu, May 23, 2013 at 6:13 AM, Bill Gosper <billgosper@gmail.com> wrote:
The usual discrete-sampled Peano curve self contacts, so you can't follow the path. The standard fix is to average consecutive vertices to form the median curve. Ever seen Peano's? Here's why not: http://gosper.org/fylfy-mind.png . A really pleasing design, if you're young enough. --rwg