NAME
Math::PlanePath::CincoCurve  5x5 selfsimilar curve
SYNOPSIS
use Math::PlanePath::CincoCurve;
my $path = Math::PlanePath::CincoCurve>new;
my ($x, $y) = $path>n_to_xy (123);
DESCRIPTION
This is the 5x5 selfsimilar Cinco curve
John Dennis, "Inverse SpaceFilling Curve Partitioning of a Global Ocean Model", and source code from COSIM
http://www.cecs.uci.edu/~papers/ipdps07/pdfs/IPDPS1569010963paper2.pdf
http://oceans11.lanl.gov/trac/POP/browser/trunk/pop/source/spacecurve_mod.F90 http://oceans11.lanl.gov/svn/POP/trunk/pop/source/spacecurve_mod.F90
It makes a 5x5 selfsimilar traversal of the first quadrant X>0,Y>0.

4  1011 141516 3536 394041 74 7170 6766
             
3  9 1213 1817 34 3738 4342 7372 6968 65
     
2  8 5 4 1920 33 3029 4445 525354 6364
           
1  7 6 3 2221 3231 28 4746 51 5655 6261
       
Y=0  0 1 2 2324252627 484950 57585960

+
X=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
The base pattern is the N=0 to N=24 part. It repeats transposed and rotated to make the ends join. N=25 to N=49 is a repeat of the base, then N=50 to N=74 is a transpose to go upwards. The subpart arrangements are as follows.
++++++
 10  11  14  15  16 
     
>>>>>
++++++
^ 9  12 ^ 13  18 <
 T  T  T  T  17 
  v  v 
++++++
^ 8  5 ^ 4  19  20 
 T  T  T  T  
  v  v>
++++++
<< ^ 3  22 <
 7  6  T  T  21 
    v 
++++++
 0  1 ^ 2  23  24 
   T  T  
>>  v>
++++++
Parts such as 6 going left are the base rotated 180 degrees. The verticals like 2 are a transpose of the base, ie. swap X,Y, and downward vertical like 23 is transpose plus rotate 180 (which is equivalent to a mirror across the antidiagonal). Notice the base shape fills its subpart to the left side and the transpose instead fills on the right.
The N values along the X axis are increasing, as are the values along the Y axis. This occurs because the values along the subparts of the base are increasing along the X and Y axes, and the other two sides are increasing too when rotated or transposed for subparts such as 2 and 23, or 7, 8 and 9.
Dennis conceives this for use in combination with 2x2 Hilbert and 3x3 meander shapes so that sizes which are products of 2, 3 and 5 can be used for partitioning. Such mixed patterns can't be done with the code here, mainly since a mixture depends on having a toplevel target size rather than the unlimited first quadrant here.
FUNCTIONS
See "FUNCTIONS" in Math::PlanePath for behaviour common to all path classes.
$path = Math::PlanePath::CincoCurve>new ()

Create and return a new path object.
($x,$y) = $path>n_to_xy ($n)

Return the X,Y coordinates of point number
$n
on the path. Points begin at 0 and if$n < 0
then the return is an empty list.
Level Methods
SEE ALSO
Math::PlanePath, Math::PlanePath::PeanoCurve, Math::PlanePath::DekkingCentres
HOME PAGE
http://user42.tuxfamily.org/mathplanepath/index.html
LICENSE
Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Kevin Ryde
MathPlanePath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
MathPlanePath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with MathPlanePath. If not, see <http://www.gnu.org/licenses/>.