.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Math::PlanePath::LTiling 3pm" .TH Math::PlanePath::LTiling 3pm "2021-01-23" "perl v5.32.0" "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::LTiling \-\- 2x2 self\-similar of four pattern parts .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Math::PlanePath::LTiling; \& my $path = Math::PlanePath::LTiling\->new; \& my ($x, $y) = $path\->n_to_xy (123); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a self-similar tiling by \*(L"L\*(R" shapes. A base \*(L"L\*(R" is replicated four times with end parts turned +90 and \-90 degrees to make a larger L, .PP .Vb 10 \& +\-\-\-\-\-+\-\-\-\-\-+ \& |12 | 15| \& | +\-\-+\-\-+ | \& | |14 | | \& +\-\-+ +\-\-+\-\-+ \& | | |11 | \& | +\-\-+ +\-\-+ \& |13 | | | \& +\-\-\-\-\-+ +\-\-\-\-\-+\-\-+ +\-\-+\-\-+\-\-\-\-\-+ \& | 3 | | 3 | |10 | | 5| \& | +\-\-+ \-\-> | +\-\-+ +\-\-+\-\-+ +\-\-+ | \& | | | | | | 8 | 9 | | | \& +\-\-+ +\-\-+ +\-\-+\-\-+ +\-\-+ +\-\-+\-\-+\-\-+\-\-+ +\-\-+ \& | | \-\-> | | 2 | | | | 2 | | | 6 | | \& | +\-\-+ | +\-\-+\-\-+ | | +\-\-+\-\-+ | +\-\-+\-\-+ | \& | 0 | | 0 | 1 | | 0 | 1 | 7 | 4 | \& +\-\-\-\-\-+ +\-\-\-\-\-+\-\-\-\-\-+ +\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+\-\-\-\-\-+ .Ve .PP The parts are numbered to the left then middle then upper. This relative numbering is maintained when rotated at the next replication level, as for example N=4 to N=7. .PP The result is to visit 1 of every 3 points in the first quadrant with a subtle layout of points and spaces making diagonal lines and little 2x2 blocks. .PP .Vb 10 \& 15 | 48 51 61 60 140 143 163 \& 14 | 50 62 142 168 \& 13 | 56 59 139 162 \& 12 | 49 58 63 141 160 \& 11 | 55 44 47 131 138 \& 10 | 57 46 136 137 \& 9 | 54 43 130 134 \& 8 | 52 53 45 128 129 135 \& 7 | 12 15 35 42 37 21 \& 6 | 14 40 41 22 \& 5 | 11 34 38 25 \& 4 | 13 32 33 39 36 \& 3 | 3 10 5 31 26 \& 2 | 8 9 27 24 \& 1 | 2 6 30 18 \& Y=0 | 0 1 7 4 28 29 19 \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& X=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 .Ve .PP On the X=Y leading diagonal N=0,2,8,10,32,etc is the integers made from only digits 0 and 2 in base 4. Or equivalently integers which have zero bits at all even numbered positions, binary c0d0e0f0. .SS "Left or Upper" .IX Subsection "Left or Upper" Option \f(CW\*(C`L_fill => "left"\*(C'\fR or \f(CW\*(C`L_fill => "upper"\*(C'\fR numbers the tiles instead at their left end or upper end respectively. .PP .Vb 11 \& L_fill => \*(Aqleft\*(Aq 8 | 52 45 43 \& 7 | 15 42 \& +\-\-\-\-\-+ 6 | 12 35 40 \& | | 5 | 14 34 33 \& | +\-\-+ 4 | 13 11 32 \& | 3| | 3 | 10 9 5 \& +\-\-+ +\-\-+\-\-+ 2 | 3 8 6 31 \& | | 2| 1| 1 | 2 1 4 \& | +\-\-+\-\-+ | Y=0 | 0 7 \& | 0| | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& +\-\-\-\-\-+\-\-\-\-\-+ X=0 1 2 3 4 5 6 7 8 \& \& \& L_fill => \*(Aqupper\*(Aq 8 | 53 42 \& 7 | 12 35 40 \& +\-\-\-\-\-+ 6 | 14 15 34 41 \& | 3| 5 | 13 11 32 39 \& | +\-\-+ 4 | 10 33 \& | | 2| 3 | 3 8 \& +\-\-+ +\-\-+\-\-+ 2 | 2 9 5 \& | 0| | | 1 | 0 7 6 28 \& | +\-\-+\-\-+ | Y=0 | 1 4 \& | | 1 | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& +\-\-\-\-\-+\-\-\-\-\-+ X=0 1 2 3 4 5 6 7 8 .Ve .PP The effect is to disrupt the pattern a bit though the overall structure of the replications is unchanged. .PP \&\*(L"left\*(R" is as viewed looking towards the L from above. It may have been better to call it \*(L"right\*(R", but won't change that now. .SS "Ends" .IX Subsection "Ends" Option \f(CW\*(C`L_fill => "ends"\*(C'\fR numbers the two endpoints within each \*(L"L\*(R", first the left then upper. This is the inverse of the default middle shown above, ie. it visits all the points which the middle option doesn't, and so 2 of every 3 points in the first quadrant. .PP .Vb 9 \& +\-\-\-\-\-+ \& | 7| \& | +\-\-+ \& | 6| 5| \& +\-\-+ +\-\-+\-\-+ \& | 1| 4| 2| \& | +\-\-+\-\-+ | \& | 0| 3 | \& +\-\-\-\-\-+\-\-\-\-\-+ \& \& 15 | 97 102 123 120 281 286 327 337 \& 14 | 96 101 103 122 124 121 280 285 287 326 325 \& 13 | 99 100 113 118 125 126 283 284 279 321 324 \& 12 | 98 112 117 119 127 282 278 277 320 323 \& 11 | 111 115 116 89 94 263 273 276 274 266 \& 10 | 110 109 114 88 93 95 262 261 272 275 268 \& 9 | 105 108 106 91 92 87 257 260 258 271 269 \& 8 | 104 107 90 86 85 256 259 270 265 \& 7 | 25 30 71 81 84 82 74 43 40 \& 6 | 24 29 31 70 69 80 83 76 75 42 44 \& 5 | 27 28 23 65 68 66 79 77 72 50 45 \& 4 | 26 22 21 64 67 78 73 52 51 47 \& 3 | 7 17 20 18 10 63 55 53 48 34 \& 2 | 6 5 16 19 12 11 62 61 54 49 36 \& 1 | 1 4 2 15 13 8 57 60 58 39 37 \& Y=0 | 0 3 14 9 56 59 38 33 \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& X=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 .Ve .SS "All" .IX Subsection "All" Option \f(CW\*(C`L_fill => "all"\*(C'\fR numbers all three points of each \*(L"L\*(R", as middle, left then right. With this the path visits all points of the first quadrant. .PP .Vb 10 \& 7 | 36 38 46 45 105 107 122 126 \& +\-\-\-\-\-+ 6 | 37 42 44 47 106 104 120 121 \& | 9 11| 5 | 41 43 33 35 98 102 103 100 \& | +\-\-+ 4 | 39 40 34 32 96 97 101 99 \& |10| 8| 3 | 9 11 26 30 31 28 16 15 \& +\-\-+ +\-\-+\-\-+ 2 | 10 8 24 25 29 27 19 17 \& | 2| 6 7| 4| 1 | 2 6 7 4 23 20 18 13 \& | +\-\-+\-\-+ | Y=0 | 0 1 5 3 21 22 14 12 \& | 0 1| 5 3| +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& +\-\-\-\-\-+\-\-\-\-\-+ X=0 1 2 3 4 5 6 7 .Ve .PP Along the X=Y leading diagonal N=0,6,24,30,96,etc are triples of the values from the single-point case, so 3* numbers using digits 0 and 2 in base 4, which is the same as 2* numbers using 0 and 3 in base 4. .SS "Level Ranges" .IX Subsection "Level Ranges" For the \*(L"middles\*(R", \*(L"left\*(R" or \*(L"upper\*(R" cases with one N per tile, and taking the initial N=0 tile as level 0, a replication level is .PP .Vb 3 \& Nstart = 0 \& to \& Nlevel = 4^level \- 1 inclusive \& \& Xmax = Ymax = 2 * 2^level \- 1 .Ve .PP For example level 2 which is the large tiling shown in the introduction is N=0 to N=4^2\-1=15 and extends to Xmax=Ymax=2*2^2\-1=7. .PP For the \*(L"ends\*(R" variation there's two points per tile, or for \*(L"all\*(R" there's three, in which case the Nlevel increases to .PP .Vb 2 \& Nlevel_ends = 2 * 4^level \- 1 \& Nlevel_all = 3 * 4^level \- 1 .Ve .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::LTiling\->new ()""" 4 .el .IP "\f(CW$path = Math::PlanePath::LTiling\->new ()\fR" 4 .IX Item "$path = Math::PlanePath::LTiling->new ()" .PD 0 .ie n .IP """$path = Math::PlanePath::LTiling\->new (L_fill => $str)""" 4 .el .IP "\f(CW$path = Math::PlanePath::LTiling\->new (L_fill => $str)\fR" 4 .IX Item "$path = Math::PlanePath::LTiling->new (L_fill => $str)" .PD Create and return a new path object. The \f(CW\*(C`L_fill\*(C'\fR choices are .Sp .Vb 5 \& "middle" the default \& "left" \& "upper" \& "ends" \& "all" .Ve .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 .Sp .Vb 3 \& 0, 4**$level \- 1 middle, left, upper \& 0, 2*4**$level \- 1 ends \& 0, 3*4**$level \- 1 all .Ve .Sp There are 4^level L shapes in a level, each containing 1, 2 or 3 points, numbered starting from 0. .SH "OEIS" .IX Header "OEIS" Entries in Sloane's Online Encyclopedia of Integer Sequences related to this path include .Sp .RS 4 (etc) .RE .PP .Vb 5 \& L_fill=middle \& A062880 N on X=Y diagonal, base 4 digits 0,2 only \& A048647 permutation N at transpose Y,X \& base4 digits 1<\->3 and 0,2 unchanged \& A112539 X+Y+1 mod 2, parity inverted \& \& L_fill=left or upper \& A112539 X+Y mod 2, parity .Ve .PP A112539 is a parity of bits at even positions in N, ie. count 1\-bits at even bit positions (least significant is bit position 0), then add 1 and take mod 2. This works because in the pattern sub-blocks 0 and 2 are unchanged and 1 and 3 are turned so as to be on opposite X,Y odd/even parity, so a flip for every even position 1\-bit. L_fill=middle starts on a 0 even parity, and L_fill=left and upper start on 1 odd parity. The latter is the form in A112539 and L_fill=middle is the bitwise 0<\->1 inverse. .SH "SEE ALSO" .IX Header "SEE ALSO" Math::PlanePath, Math::PlanePath::CornerReplicate, Math::PlanePath::SquareReplicate, Math::PlanePath::QuintetReplicate, Math::PlanePath::GosperReplicate .SH "HOME PAGE" .IX Header "HOME PAGE" .SH "LICENSE" .IX Header "LICENSE" Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 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 .