# Which formulas are used to calculate a space-filling curve for a given shape?

i am trying to compute a space-filling curve for a given shape (an isosceles right triangle in this case) like following figure (call it figure_1)

wikipedia gives a formula

H(x,y) = (h(x), h(y))


i don't know how to use this formula.

is there a doable mathematical or programmatic way to do this?

• The information given in your Figure 1 is not enough to specify a space filling curve. What you are missing is a careful description of the inductive step: you must describe a single method which when applied to Figure 1 produces a new Figure 2, and that when applied to Figure 2 produces a new Figure 3, and so on with an infinite sequence of Figures 1,2,3,4,5,6,... – Lee Mosher May 27 '19 at 14:39
• Furthermore, your figure $1$ must be given by an explicit function $f_1$ from $[0,1]$ to your triangle, and your inductive step must produce an infinite sequence of continuous functions $f_1,f_2,f_3,f_4,f_5,f_6,...$ from $[0,1]$ to your triangle. Without that, your question does not make much sense. – Lee Mosher May 27 '19 at 14:39

Instead, what you could do is just take one of the standard curves that fill the unit square, and compose it with something like $$\langle x,y\rangle \mapsto \langle (1-y)x,y\rangle$$ that maps the unit square continuously onto your desired shape.