1Math::PlanePath::WunderUlsiecrhMCeoanntdreirb(u3t)ed PerMlatDho:c:uPmleannteaPtaitohn::WunderlichMeander(3)
2
3
4
6 Math::PlanePath::WunderlichMeander -- 3x3 self-similar "R" shape
7
9 use Math::PlanePath::WunderlichMeander;
10 my $path = Math::PlanePath::WunderlichMeander->new;
11 my ($x, $y) = $path->n_to_xy (123);
12
14 This is an integer version of the 3x3 self-similar meander from
15
16 Walter Wunderlich, "Uber Peano-Kurven", Elemente der Mathematik,
17 volume 28, number 1, 1973, pages 1-10.
18 <http://sodwana.uni-ak.ac.at/geom/mitarbeiter/wallner/wunderlich/>,
19 <http://sodwana.uni-ak.ac.at/geom/mitarbeiter/wallner/wunderlich/pdf/125.pdf>
20
21 8 20--21--22 29--30--31 38--39--40
22 | | | | | |
23 7 19 24--23 28 33--32 37 42--41
24 | | | | | |
25 6 18 25--26--27 34--35--36 43--44
26 | |
27 5 17 14--13 56--55--54--53--52 45
28 | | | | | |
29 4 16--15 12 57 60--61 50--51 46
30 | | | | | |
31 3 9--10--11 58--59 62 49--48--47
32 | |
33 2 8 5-- 4 65--64--63 74--75--76
34 | | | | | |
35 1 7-- 6 3 66 69--70 73 78--77
36 | | | | | |
37 Y=0-> 0-- 1-- 2 67--68 71--72 79--80-...
38
39 X=0 1 2 3 4 5 6 7 8
40
41 The base pattern is the N=0 to N=8 section. It works as a traversal of
42 a 3x3 square starting in one corner and going along one side. The base
43 figure goes upwards and it's then used rotated by 180 degrees and/or
44 transposed to go in other directions,
45
46 +----------------+----------------+---------------+
47 | ^ | * | ^ |
48 | | | rotate 180 | | | base |
49 | | 8 | 5 | | | 4 |
50 | | base | | | | |
51 | * | v | * |
52 +----------------+----------------+---------------+
53 | <------------* | <------------* | ^ |
54 | | | | |
55 | 7 | 6 | | 3 |
56 | rotate 180 | rotate 180 | | base |
57 | + transpose | + transpose | * |
58 +----------------+----------------+---------------+
59 | | | ^ |
60 | | | | |
61 | 0 | 1 | | 2 |
62 | transpose | transpose | | base |
63 | *-----------> | *------------> | * |
64 +----------------+----------------+---------------+
65
66 The base 0 to 8 goes upwards, so the across sub-parts are an X,Y
67 transpose. The transpose in the 0 part means the higher levels go
68 alternately up or across. So N=0 to N=8 goes up, then the next level
69 N=0,9,18,.,72 goes right, then N=81,162,..,648 up again, etc.
70
71 Wunderlich's conception is successive lower levels of detail as a
72 space-filling curve. The transposing in that case applies to ever
73 smaller parts. But for the integer version here, the start direction
74 is held fixed and the successively higher levels alternate. The first
75 move N=0 to N=1 is rightwards per the "Schema" shown in Wunderlich's
76 paper (and like various other "PlanePath" curves).
77
79 See "FUNCTIONS" in Math::PlanePath for behaviour common to all path
80 classes.
81
82 "$path = Math::PlanePath::WunderlichMeander->new ()"
83 Create and return a new path object.
84
85 "($x,$y) = $path->n_to_xy ($n)"
86 Return the X,Y coordinates of point number $n on the path. Points
87 begin at 0 and if "$n < 0" then the return is an empty list.
88
89 "($n_lo, $n_hi) = $path->rect_to_n_range ($x1,$y1, $x2,$y2)"
90 The returned range is exact, meaning $n_lo and $n_hi are the
91 smallest and biggest in the rectangle.
92
93 Level Methods
94 "($n_lo, $n_hi) = $path->level_to_n_range($level)"
95 Return "(0, 9**$level - 1)".
96
98 Math::PlanePath, Math::PlanePath::PeanoCurve
99
101 <http://user42.tuxfamily.org/math-planepath/index.html>
102
104 Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020
105 Kevin Ryde
106
107 This file is part of Math-PlanePath.
108
109 Math-PlanePath is free software; you can redistribute it and/or modify
110 it under the terms of the GNU General Public License as published by
111 the Free Software Foundation; either version 3, or (at your option) any
112 later version.
113
114 Math-PlanePath is distributed in the hope that it will be useful, but
115 WITHOUT ANY WARRANTY; without even the implied warranty of
116 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
117 General Public License for more details.
118
119 You should have received a copy of the GNU General Public License along
120 with Math-PlanePath. If not, see <http://www.gnu.org/licenses/>.
121
122
123
124perl v5.38.0 2023-07-M2a0th::PlanePath::WunderlichMeander(3)