Math::PlanePath::LCornerReplicate -- self-similar growth at exposed corners
use Math::PlanePath::LCornerReplicate; my $path = Math::PlanePath::LCornerReplicate->new; my ($x, $y) = $path->n_to_xy (123);
This is a self-similar "L" shaped corners,
7 | 58 57 55 54 46 45 43 42 64 6 | 59 56 52 53 47 44 40 41 ... 5 | 61 60 50 49 35 34 36 39 4 | 62 63 51 48 32 33 37 38 3 | 14 13 11 10 16 19 31 30 2 | 15 12 8 9 17 18 28 29 1 | 3 2 4 7 21 20 24 27 Y=0 | 0 1 5 6 22 23 25 26 +------------------------------------- X=0 1 2 3 4 5 6 7 8
The base pattern is the initial N=0,1,2,3 and then when replicating the 1 and 3 sub-blocks are rotated -90 and +90 degrees,
+----------------+ | 3 | 2 | | ^ | ^ | | \ | / | | \ | / | | +90 | | |-------+--------| | | -90 | | ^ | \ | | / | \ | | / | v | | / 0 | 1 | +----------------+
Groups of 3 points such as N=13,14,15 make little L-shaped blocks, except at the middle single points where a replication begins such as N=4,8,12.
The sub-block layout is like CornerReplicate
(Math::PlanePath::CornerReplicate) but its blocks are not rotated.
See "FUNCTIONS" in Math::PlanePath for behaviour common to all path classes.
$path = Math::PlanePath::LCornerReplicate->new ()
Create and return a new path object.
($n_lo, $n_hi) = $path->level_to_n_range($level)
Return (0, 4**$level - 1)
.
The dir_maximum_dxdy()
seems to occur at
base-4 N = 323333...333 dX = 2121...2121212 (or 2121...12121) dY = -3030...303031 (or 303...30310)
which are
dX = 2*16^k + 6*(16^k -1)/15 dY = - ( 12*(16^k -1)/15 + 1) dY/dX -> -1/3 as k->infinity
The pattern N=3233..333 [base4] probably has a geometric interpretation in the sub-blocks described above, but in any case the angles made by steps dX,dY approach a supremum dX=3,dY=-1.
The last point in each level is N=4^k-1 and is located at
X(k) = binary 00110011001100... take first k many bits = 0, 0, 0, 1, 3, 6, 12, 25, 51, 102, 204, 409, ... (A077854) = binary: empty, 0, 00, 001, 0011, 00110, 001100, 0011001, ... Y(k) = binary 10011001100110... take first k many bits = 0, 1, 2, 4, 9, 19, 38, 76, 153, 307, 614, 1228, ... = binary: empty, 1, 10, 100, 1001, 10011, 100110, 1001100, ...
N=4^k-1 is 333...3 in base-4 and so is part 3 each time. Each part 3 is a transformation (H,L)->(~L,H), where ~ is a ones-complement reversal 0<->1. Applying that transform down each digit of N gives a repeating pattern 1,1,0,0.
Entries in Sloane's Online Encyclopedia of Integer Sequences related to this path include
http://oeis.org/A062880 (etc)
A062880 N values on diagonal X=Y, being base-4 digits 0,2 only A077854 level last X(k), per bit pattern above A048647 permutation N at transpose Y,X, being base-4 digit change 1<->3
Math::PlanePath, Math::PlanePath::LCornerTree, Math::PlanePath::CornerReplicate, Math::PlanePath::ToothpickReplicate
http://user42.tuxfamily.org/math-planepath/index.html
Copyright 2012, 2013, 2014, 2015 Kevin Ryde
This file is part of Math-PlanePath-Toothpick.
Math-PlanePath-Toothpick 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.
Math-PlanePath-Toothpick 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 Math-PlanePath-Toothpick. If not, see <http://www.gnu.org/licenses/>.