.\" 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::ImaginaryHalf 3pm" .TH Math::PlanePath::ImaginaryHalf 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::ImaginaryHalf \-\- half\-plane replications in three directions .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Math::PlanePath::ImaginaryBase; \& my $path = Math::PlanePath::ImaginaryBase\->new (radix => 4); \& my ($x, $y) = $path\->n_to_xy (123); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a half-plane variation on the \f(CW\*(C`ImaginaryBase\*(C'\fR path. .PP .Vb 3 \& 54\-55 50\-51 62\-63 58\-59 22\-23 18\-19 30\-31 26\-27 3 \& \e \e \e \e \e \e \e \e \& 52\-53 48\-49 60\-61 56\-57 20\-21 16\-17 28\-29 24\-25 2 \& \& 38\-39 34\-35 46\-47 42\-43 6\-\-7 2\-\-3 14\-15 10\-11 1 \& \e \e \e \e \e \e \e \e \& 36\-37 32\-33 44\-45 40\-41 4\-\-5 0\-\-1 12\-13 8\-\-9 <\- Y=0 \& \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& \-10 \-9 \-8 \-7 \-6 \-5 \-4 \-3 \-2 \-1 X=0 1 2 3 4 5 .Ve .PP The pattern can be seen by dividing into blocks, .PP .Vb 11 \& +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& | 22 23 18 19 30 31 26 27 | \& | | \& | 20 21 16 17 28 29 24 25 | \& +\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& | 6 7 | 2 3 | 14 15 10 11 | \& | +\-\-\-+\-\-\-+ | \& | 4 5 | 0 | 1 | 12 13 8 9 | <\- Y=0 \& +\-\-\-\-\-\-\-\-+\-\-\-+\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ \& ^ \& X=0 .Ve .PP N=0 is at the origin, then N=1 replicates it to the right. Those two repeat above as N=2 and N=3. Then that 2x2 repeats to the left as N=4 to N=7, then 4x2 repeats to the right as N=8 to N=15, and 8x2 above as N=16 to N=31, etc. The replications are successively to the right, above, left. The relative layout within a replication is unchanged. .PP This is similar to the \f(CW\*(C`ImaginaryBase\*(C'\fR, but where it repeats in 4 directions there's just 3 directions here. The \f(CW\*(C`ZOrderCurve\*(C'\fR is a 2 direction replication. .SS "Radix" .IX Subsection "Radix" The \f(CW\*(C`radix\*(C'\fR parameter controls the radix used to break N into X,Y. For example \f(CW\*(C`radix => 4\*(C'\fR gives 4x4 blocks, with radix\-1 replications of the preceding level at each stage. .PP .Vb 1 \& radix => 4 \& \& 60 61 62 63 44 45 46 47 28 29 30 31 12 13 14 15 3 \& 56 57 58 59 40 41 42 43 24 25 26 27 8 9 10 11 2 \& 52 53 54 55 36 37 38 39 20 21 22 23 4 5 6 7 1 \& 48 49 50 51 32 33 34 35 16 17 18 19 0 1 2 3 <\- Y=0 \& \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-^\-\-\-\-\-\-\-\-\-\-\- \& \-12\-11\-10 \-9 \-8 \-7 \-6 \-5 \-4 \-3 \-2 \-1 X=0 1 2 3 .Ve .PP Notice for X negative the parts replicate successively towards \-infinity, so the block N=16 to N=31 is first at X=\-4, then N=32 at X=\-8, N=48 at X=\-12, and N=64 at X=\-16 (not shown). .SS "Digit Order" .IX Subsection "Digit Order" The \f(CW\*(C`digit_order\*(C'\fR parameter controls the order digits from N are applied to X and Y. The default above is \*(L"\s-1XYX\*(R"\s0 so the replications go X then Y then negative X. .PP \&\*(L"\s-1XXY\*(R"\s0 goes to negative X before Y, so N=2,N=3 goes to negative X before repeating N=4 to N=7 in the Y direction. .PP .Vb 1 \& digit_order => "XXY" \& \& 38 39 36 37 46 47 44 45 \& 34 35 32 33 42 43 40 41 \& 6 7 4 5 14 15 12 13 \& 2 3 0 1 10 11 8 9 \& \-\-\-\-\-\-\-\-\-^\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& \-2 \-1 X=0 1 2 3 4 5 .Ve .PP The further options are as follows, for six permutations of each 3 digits from N. .PP .Vb 5 \& digit_order => "YXX" digit_order => "XnYX" \& 38 39 36 37 46 47 44 45 19 23 18 22 51 55 50 54 \& 34 35 32 33 42 43 40 41 17 21 16 20 49 53 48 52 \& 6 7 4 5 14 15 12 13 3 7 2 6 35 39 34 38 \& 2 3 0 1 10 11 8 9 1 5 0 4 33 37 32 36 \& \& digit_order => "XnXY" digit_order => "YXnX" \& 37 39 36 38 53 55 52 54 11 15 9 13 43 47 41 45 \& 33 35 32 34 49 51 48 50 10 14 8 12 42 46 40 44 \& 5 7 4 6 21 23 20 22 3 7 1 5 35 39 33 37 \& 1 3 0 2 17 19 16 18 2 6 0 4 34 38 32 36 .Ve .PP \&\*(L"Xn\*(R" means the X negative direction. It's still spaced 2 apart (or whatever radix), so the result is not simply a \-X,Y. .SS "Axis Values" .IX Subsection "Axis Values" N=0,1,4,5,8,9,etc on the X axis (positive and negative) are those integers with a 0 at every third bit starting from the second least significant bit. This is simply demanding that the bits going to the Y coordinate must be 0. .PP .Vb 2 \& X axis Ns = binary ..._\|_0_\|_0_\|_0_ with _ either 0 or 1 \& in octal, digits 0,1,4,5 only .Ve .PP N=0,1,8,9,etc on the X positive axis have the highest 1\-bit in the first slot of a 3\-bit group. Or N=0,4,5,etc on the X negative axis have the high 1 bit in the third slot, .PP .Vb 4 \& X pos Ns = binary 1_0_\|_0_\|_0...0_\|_0_\|_0_ \& X neg Ns = binary 10_\|_0_\|_0_\|_0...0_\|_0_\|_0_ \& ^^^ \& three bit group \& \& X pos Ns in octal have high octal digit 1 \& X neg Ns in octal high octal digit 4 or 5 .Ve .PP N=0,2,16,18,etc on the Y axis are conversely those integers with a 0 in two of each three bits, demanding the bits going to the X coordinate must be 0. .PP .Vb 2 \& Y axis Ns = binary ..._00_00_00_0 with _ either 0 or 1 \& in octal has digits 0,2 only .Ve .PP For a radix other than binary the pattern is the same. Each \*(L"_\*(R" is any digit of the given radix, and each 0 must be 0. The high 1 bit for X positive and negative become a high non-zero digit. .SS "Level Ranges" .IX Subsection "Level Ranges" Because the X direction replicates twice for each once in the Y direction the width grows at twice the rate, so after each 3 replications .PP .Vb 1 \& width = height*height .Ve .PP For this reason N values for a given Y grow quite rapidly. .SS "Proth Numbers" .IX Subsection "Proth Numbers" The Proth numbers, k*2^n+1 for k<2^n, fall in columns on the path. .PP .Vb 1 \& * * * \& \& \& \& * * * \& \& \& \& * * * \& \& \& \& * * * * * \& \& \& \& * * * * * \& \& * * * * \& \& * * * * * * * * * \& \& * * * * * * \& * \& * * * * * * * * * * * * \& \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& \-31 \-23 \-15 \-7 \-3\-1 0 3 5 9 17 25 33 .Ve .PP The height of the column is from the zeros in X ending binary ...1000..0001 since this limits the \*(L"k\*(R" part of the Proth numbers which can have N ending suitably. Or for X negative ending ...10111...11. .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::ImaginaryBase\->new ()""" 4 .el .IP "\f(CW$path = Math::PlanePath::ImaginaryBase\->new ()\fR" 4 .IX Item "$path = Math::PlanePath::ImaginaryBase->new ()" .PD 0 .ie n .IP """$path = Math::PlanePath::ImaginaryBase\->new (radix => $r, digit_order => $str)""" 4 .el .IP "\f(CW$path = Math::PlanePath::ImaginaryBase\->new (radix => $r, digit_order => $str)\fR" 4 .IX Item "$path = Math::PlanePath::ImaginaryBase->new (radix => $r, digit_order => $str)" .PD Create and return a new path object. The choices for \f(CW\*(C`digit_order\*(C'\fR are .Sp .Vb 6 \& "XYX" \& "XXY" \& "YXX" \& "XnYX" \& "XnXY" \& "YXnX" .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. .ie n .IP """($n_lo, $n_hi) = $path\->rect_to_n_range ($x1,$y1, $x2,$y2)""" 4 .el .IP "\f(CW($n_lo, $n_hi) = $path\->rect_to_n_range ($x1,$y1, $x2,$y2)\fR" 4 .IX Item "($n_lo, $n_hi) = $path->rect_to_n_range ($x1,$y1, $x2,$y2)" The returned range is exact, meaning \f(CW$n_lo\fR and \f(CW$n_hi\fR are the smallest and biggest in the rectangle. .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, $radix**$level \- 1)\*(C'\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" Math::PlanePath, Math::PlanePath::ImaginaryBase, Math::PlanePath::ZOrderCurve .SH "HOME PAGE" .IX Header "HOME PAGE" .SH "LICENSE" .IX Header "LICENSE" Copyright 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 .