.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Math::PlanePath::KochelCurve 3pm" .TH Math::PlanePath::KochelCurve 3pm "2018-03-18" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Math::PlanePath::KochelCurve \-\- 3x3 self\-similar R and F .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Math::PlanePath::KochelCurve; \& my $path = Math::PlanePath::KochelCurve\->new; \& my ($x, $y) = $path\->n_to_xy (123); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is an integer version of the Kochel curve by Herman Haverkort. It fills the first quadrant in a 3x3 self-similar pattern made from two base shapes. .IX Xref "Haverkort, Herman" .PP .Vb 10 \& | \& 8 80\-\-79 72\-\-71\-\-70\-\-69 60\-\-59\-\-58 \& | | | | | \& 7 77\-\-78 73 66\-\-67\-\-68 61 56\-\-57 \& | | | | | \& 6 76\-\-75\-\-74 65\-\-64\-\-63\-\-62 55\-\-54 \& | \& 5 11\-\-12 17\-\-18\-\-19\-\-20 47\-\-48 53 \& | | | | | | | \& 4 10 13 16 25\-\-24 21 46 49 52 \& | | | | | | | | | \& 3 9 14\-\-15 26 23\-\-22 45 50\-\-51 \& | | | \& 2 8\-\- 7\-\- 6 27\-\-28\-\-29 44\-\-43\-\-42 \& | | | \& 1 1\-\- 2 5 32\-\-31\-\-30 37\-\-38 41 \& | | | | | | | \& Y=0\-> 0 3\-\- 4 33\-\-34\-\-35\-\-36 39\-\-40 \& \& X=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 .Ve .PP The base shapes are an \*(L"R\*(R" and an \*(L"F\*(R". The R goes along an edge, the F goes diagonally across. .PP .Vb 10 \& R pattern F pattern ^ \& +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-|+ \& |2 | |3\e |4 | |2 | |3\e |8 || \& | R | | F | R | | R | | F | R || \& | | | \e |\-\-\-\-\-| | | | \e | || \& +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ \& |1 / |6 |5 / | |1 / |4 / |7 / | \& | F | Rrev| F | | F | F | F | \& | / |\-\-\-\-\-| / | | / | / | / | \& +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ \& |0| |7\e |8 | |0| |5\e ||6 | \& | |Rrev| F | R | | |Rrev| F ||Rrev| \& | o | \e |\-\-\-\-\-\-> | o | \e || | \& +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ .Ve .PP \&\*(L"Rrev\*(R" means the R pattern followed in reverse, which is .PP .Vb 10 \& +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ \& |8<\-\-\-\-|7\e |6 | Rrev pattern \& | R | F | Rrev| \& | | \e |\-\-\-\-\-| turned \-90 degrees \& +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ so as to start at \& |1 / ||2 |5 / | bottom left \& | F || R | F | \& | / || | / | \& +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ \& |0| |3\e ||4 | \& | |Rrev| F ||Rrev| \& | o | \e || | \& +\-\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ .Ve .PP The F pattern is symmetric, the same forward or reverse, including its sub-parts taken in reverse, so there's no separate \*(L"Frev\*(R" pattern. .PP The initial N=0 to N=8 is the Rrev turned \-90, then N=9 to N=17 is the F shape. The next higher level N=0,N=9,N=18 to N=72 is the Rrev too, as is any N=9^k to N=8*9^k. .SS "Fractal" .IX Subsection "Fractal" The curve is conceived by Haverkort for filling a unit square by descending into ever-smaller replacements, like other space-filling curves. For that the top-level can be any of the patterns. To descend any of the shapes can be used for the start, but for the outward expanding version here the starting pattern must occur at the start of its next higher level, which means Rrev is the only choice as it's the only start in any of the three patterns. .PP But all the patterns can be found in the path at any desired size. For example the \*(L"1\*(R" part of Rrev is an F, which means F to a desired level can be found at .PP .Vb 5 \& NFstart = 1 * 9^level \& NFlast = NFstart + 9^level \- 1 \& = 2 * 9^level \- 1 \& XFstart = 3^level \& YFstart = 0 .Ve .PP level=3 for N=729 to N=1457 is a 27x27 which is the level-three F shown in Haverkort's paper, starting at XFstart=27,YFstart=0. .SH "FUNCTIONS" .IX Header "FUNCTIONS" See \*(L"\s-1FUNCTIONS\*(R"\s0 in Math::PlanePath for behaviour common to all path classes. .ie n .IP """$path = Math::PlanePath::KochelCurve\->new ()""" 4 .el .IP "\f(CW$path = Math::PlanePath::KochelCurve\->new ()\fR" 4 .IX Item "$path = Math::PlanePath::KochelCurve->new ()" Create and return a new path object. .ie n .IP """($x,$y) = $path\->n_to_xy ($n)""" 4 .el .IP "\f(CW($x,$y) = $path\->n_to_xy ($n)\fR" 4 .IX Item "($x,$y) = $path->n_to_xy ($n)" Return the X,Y coordinates of point number \f(CW$n\fR on the path. Points begin at 0 and if \f(CW\*(C`$n < 0\*(C'\fR then the return is an empty list. .SS "Level Methods" .IX Subsection "Level Methods" .ie n .IP """($n_lo, $n_hi) = $path\->level_to_n_range($level)""" 4 .el .IP "\f(CW($n_lo, $n_hi) = $path\->level_to_n_range($level)\fR" 4 .IX Item "($n_lo, $n_hi) = $path->level_to_n_range($level)" Return \f(CW\*(C`(0, 9**$level \- 1)\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" Math::PlanePath, Math::PlanePath::PeanoCurve, Math::PlanePath::WunderlichMeander .PP Herman Haverkort, \*(L"Recursive Tilings and Space-Filling Curves with Little Fragmentation\*(R", Journal of Computational Geometry, 2(1), 92\-127, 2011. .Sp .RS 4 .Sp (slides) (short form) .RE .SH "HOME PAGE" .IX Header "HOME PAGE" .SH "LICENSE" .IX Header "LICENSE" Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 Kevin Ryde .PP This file is part of Math-PlanePath. .PP Math-PlanePath is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. .PP Math-PlanePath is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with Math-PlanePath. If not, see .