NAME

Math::PlanePath::MathImageWunderlichSerpentine -- 3x3 self-similar quadrant traversal

SYNOPSIS

use Math::PlanePath::MathImageWunderlichSerpentine;
my $path = Math::PlanePath::MathImageWunderlichSerpentine->new (serpentine_bits => 0b111000111;
my ($x, $y) = $path->n_to_xy (123);

# or another radix digits ...
my $path5 = Math::PlanePath::MathImageWunderlichSerpentine->new (radix => 5);

DESCRIPTION

In progress.

This is an integer version of Walter Wunderlich's variations on the PeanoCurve. A "serpentine type" controls which combination of the nine sub-parts are transposed. For example "010 101 010" gives

 8    60--61--62--63  68--69  78--79--80--81 
       |           |   |   |   |           | 
 7    59--58--57  64  67  70  77--76--75  ...
               |   |   |   |           |  
 6    54--55--56  65--66  71--72--73--74  
       |                                  
 5    53  48--47  38--37--36--35  30--29  
       |   |   |   |           |   |   | 
 4    52  49  46  39--40--41  34  31  28 
       |   |   |           |   |   |   | 
 3    51--50  45--44--43--42  33--32  27 
                                       | 
 2     6-- 7-- 8-- 9  14--15  24--25--26 
       |           |   |   |   |         
 1     5-- 4-- 3  10  13  16  23--22--21 
               |   |   |   |           | 
Y=0    0-- 1-- 2  11--12  17--18--19--20 

     X=0   1   2   3   4   5   6   7   8

Coil Order

serpentine_bits => -1 transposes all parts, giving what is sometimes called a "coil order",

 8      24--25--26--27--28--29  78--79--80--81--...
         |                   |   |          
 7      23--22--21  32--31--30  77--76--75  
                 |   |                   |  
 6      18--19--20  33--34--35  72--73--74  
         |                   |   |          
 5      17--16--15  38--37--36  71--70--69  
                 |   |                   |  
 4      12--13--14  39--40--41  66--67--68  
         |                   |   |          
 3      11--10-- 9  44--43--42  65--64--63  
                 |   |                   |  
 2       6-- 7-- 8  45--46--47  60--61--62  
         |                   |   |          
 1       5-- 4-- 3  50--49--48  59--58--57 
                 |   |                   |  
Y=0      0-- 1-- 2  51--52--53--54--55--56 

       X=0   1   2   3   4   5   6   7   8

FUNCTIONS

See "FUNCTIONS" in Math::PlanePath for the behaviour common to all path classes.

$path = Math::PlanePath::MathImageWunderlichSerpentine->new ()
$path = Math::PlanePath::MathImageWunderlichSerpentine->new (radix => $r)

Create and return a new path object.

The optional radix parameter gives the base for digit splitting. The default is ternary, radix 3. The radix should be an odd number, 3, 5, 7, 9 etc.

SEE ALSO

Math::PlanePath, Math::PlanePath::PeanoSerpentine

Walter Wunderlich "Uber Peano-Kurven", Elemente der Mathematik, 28(1):1-10, 1973.

http://sodwana.uni-ak.ac.at/geom/mitarbeiter/wallner/wunderlich/
http://sodwana.uni-ak.ac.at/geom/mitarbeiter/wallner/wunderlich/pdf/125.pdf