Function file: x, y peano_curve (n)

Creates an iteration of the Peano space-filling curve with n points. The argument n must be of the form 3^M, where m is an integer greater than 0.

n = 9;
[x, y] = peano_curve (n);
line (x, y, "linewidth", 4, "color", "red");

Demonstration 1

The following code

 clf
 n = 9;
 [x, y] = peano_curve (n);
 line (x, y, "linewidth", 4, "color", "red");
 % --------------------------------------------------------------------
 % the figure window shows an iteration of the Peano space-fillig curve 
 % with 9 points on each axis.

Produces the following figure

Figure 1

Demonstration 2

The following code

 clf
 n = 81;
 [x, y] = peano_curve (n);
 line (x, y, "linewidth", 2, "color", "red");
 % --------------------------------------------------------------------
 % the figure window shows an iteration of the Peano space-fillig curve 
 % with 81 points on each axis.

Produces the following figure

Figure 1

Package: miscellaneous