1Math::PlanePath::CincoCUusrevre(C3o)ntributed Perl DocumMeanttha:t:iPolnanePath::CincoCurve(3)
2
3
4
6 Math::PlanePath::CincoCurve -- 5x5 self-similar curve
7
9 use Math::PlanePath::CincoCurve;
10 my $path = Math::PlanePath::CincoCurve->new;
11 my ($x, $y) = $path->n_to_xy (123);
12
14 This is the 5x5 self-similar Cinco curve
15
16 John Dennis, "Inverse Space-Filling Curve Partitioning of a Global
17 Ocean Model", and source code from COSIM
18
19 <http://www.cecs.uci.edu/~papers/ipdps07/pdfs/IPDPS-1569010963-paper-2.pdf>
20
21 <http://oceans11.lanl.gov/trac/POP/browser/trunk/pop/source/spacecurve_mod.F90>,
22 <http://oceans11.lanl.gov/svn/POP/trunk/pop/source/spacecurve_mod.F90>
23
24 It makes a 5x5 self-similar traversal of the first quadrant X>0,Y>0.
25
26 |
27 4 | 10--11 14--15--16 35--36 39--40--41 74 71--70 67--66
28 | | | | | | | | | | | | | |
29 3 | 9 12--13 18--17 34 37--38 43--42 73--72 69--68 65
30 | | | | | |
31 2 | 8 5-- 4 19--20 33 30--29 44--45 52--53--54 63--64
32 | | | | | | | | | | | |
33 1 | 7-- 6 3 22--21 32--31 28 47--46 51 56--55 62--61
34 | | | | | | | |
35 Y=0 | 0-- 1-- 2 23--24--25--26--27 48--49--50 57--58--59--60
36 |
37 +--------------------------------------------------------------
38 X=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
39
40 The base pattern is the N=0 to N=24 part. It repeats transposed and
41 rotated to make the ends join. N=25 to N=49 is a repeat of the base,
42 then N=50 to N=74 is a transpose to go upwards. The sub-part
43 arrangements are as follows.
44
45 +------+------+------+------+------+
46 | 10 | 11 | 14 | 15 | 16 |
47 | | | | | |
48 |----->|----->|----->|----->|----->|
49 +------+------+------+------+------+
50 |^ 9 | 12 ||^ 13 | 18 ||<-----|
51 || T | T ||| T | T || 17 |
52 || | v|| | v| |
53 +------+------+------+------+------+
54 |^ 8 | 5 ||^ 4 | 19 || 20 |
55 || T | T ||| T | T || |
56 || | v|| | v|----->|
57 +------+------+------+------+------+
58 |<-----|<---- |^ 3 | 22 ||<-----|
59 | 7 | 6 || T | T || 21 |
60 | | || | v| |
61 +------+------+------+------+------+
62 | 0 | 1 |^ 2 | 23 || 24 |
63 | | || T | T || |
64 |----->|----->|| | v|----->|
65 +------+------+------+------+------+
66
67 Parts such as 6 going left are the base rotated 180 degrees. The
68 verticals like 2 are a transpose of the base, ie. swap X,Y, and
69 downward vertical like 23 is transpose plus rotate 180 (which is
70 equivalent to a mirror across the anti-diagonal). Notice the base
71 shape fills its sub-part to the left side and the transpose instead
72 fills on the right.
73
74 The N values along the X axis are increasing, as are the values along
75 the Y axis. This occurs because the values along the sub-parts of the
76 base are increasing along the X and Y axes, and the other two sides are
77 increasing too when rotated or transposed for sub-parts such as 2 and
78 23, or 7, 8 and 9.
79
80 Dennis conceives this for use in combination with 2x2 Hilbert and 3x3
81 meander shapes so that sizes which are products of 2, 3 and 5 can be
82 used for partitioning. Such mixed patterns can't be done with the code
83 here, mainly since a mixture depends on having a top-level target size
84 rather than the unlimited first quadrant here.
85
87 See "FUNCTIONS" in Math::PlanePath for behaviour common to all path
88 classes.
89
90 "$path = Math::PlanePath::CincoCurve->new ()"
91 Create and return a new path object.
92
93 "($x,$y) = $path->n_to_xy ($n)"
94 Return the X,Y coordinates of point number $n on the path. Points
95 begin at 0 and if "$n < 0" then the return is an empty list.
96
97 Level Methods
98 "($n_lo, $n_hi) = $path->level_to_n_range($level)"
99 Return "(0, 25**$level - 1)".
100
102 Math::PlanePath, Math::PlanePath::PeanoCurve,
103 Math::PlanePath::DekkingCentres
104
106 <http://user42.tuxfamily.org/math-planepath/index.html>
107
109 Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020
110 Kevin Ryde
111
112 Math-PlanePath is free software; you can redistribute it and/or modify
113 it under the terms of the GNU General Public License as published by
114 the Free Software Foundation; either version 3, or (at your option) any
115 later version.
116
117 Math-PlanePath is distributed in the hope that it will be useful, but
118 WITHOUT ANY WARRANTY; without even the implied warranty of
119 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
120 General Public License for more details.
121
122 You should have received a copy of the GNU General Public License along
123 with Math-PlanePath. If not, see <http://www.gnu.org/licenses/>.
124
125
126
127perl v5.38.0 2023-07-20 Math::PlanePath::CincoCurve(3)