1Math::PlanePath::FilledURsienrgsC(o3n)tributed Perl DocuMmaetnht:a:tPiloannePath::FilledRings(3)
2
3
4

NAME

6       Math::PlanePath::FilledRings -- concentric filled lattice rings
7

SYNOPSIS

9        use Math::PlanePath::FilledRings;
10        my $path = Math::PlanePath::FilledRings->new;
11        my ($x, $y) = $path->n_to_xy (123);
12

DESCRIPTION

14       This path puts points on integer X,Y pixels of filled rings with radius
15       1 unit each ring.
16
17                           110-109-108-107-106                        6
18                          /                   \
19                   112-111  79--78--77--76--75 105-104                5
20                     |    /                   \      |
21               114-113  80  48--47--46--45--44  74 103-102            4
22                 |    /      |               |    \      |
23               115  81  50--49  27--26--25  43--42  73 101            3
24              /   /      |    /           \      |    \   \
25           116  82  52--51  28  14--13--12  24  41--40  72 100        2
26             |   |   |    /   /           \   \      |   |   |
27           117  83  53  29  15   5-- 4-- 3  11  23  39  71  99        1
28             |   |   |   |   |   |       |   |   |   |   |   |
29           118  84  54  30  16   6   1-- 2  10  22  38  70  98   <- Y=0
30             |   |   |   |   |   |        /   /   /   /   /   /
31           119  85  55  31  17   7-- 8-- 9  21  37  69  97 137       -1
32             |   |   |    \   \           /   /      |   |   |
33           120  86  56--57  32  18--19--20  36  67--68  96 136       -2
34              \   \      |    \           /      |    /   /
35               121  87  58--59  33--34--35  65--66  95 135           -3
36                 |    \      |               |    /      |
37               122-123  88  60--61--62--63--64  94 133-134           -4
38                     |    \                   /      |
39                   124-125  89--90--91--92--93 131-132               -5
40                          \                   /
41                           126-127-128-129-130
42
43                                     ^
44            -6  -5  -4  -3  -2  -1  X=0  1   2   3   4   5   6
45
46       For example the ring N=22 to N=37 is all the points
47
48           2.5 < hypot(X,Y) < 3.5
49           where hypot(X,Y) = sqrt(X^2+Y^2)
50
51   N Start
52       The default is to number points starting N=1 as shown above.  An
53       optional "n_start" can give a different start with the same shape.  For
54       example to start at 0,
55
56                 26-25-24          n_start => 0
57                /        \
58              27 13-12-11 23
59             /  /        \  \
60           28 14  4--3--2 10 22
61            |  |  |     |  |  |
62           29 15  5  0--1  9 21
63            |  |  |      /  /  /
64           30 16  6--7--8 20 36
65             \  \        /  /
66              31 17-18-19 35
67                \        /
68               8 32-33-34
69
70       The only effect is to push the N values by a constant amount but can
71       help match N on the axes to counts of X,Y points < R or similar.
72

FUNCTIONS

74       See "FUNCTIONS" in Math::PlanePath for the behaviour common to all path
75       classes.
76
77       "$path = Math::PlanePath::FilledRings->new ()"
78       "$path = Math::PlanePath::FilledRings->new (n_start => $n)"
79           Create and return a new path object.
80

OEIS

82       Entries in Sloane's Online Encyclopedia of Integer Sequences related to
83       this path include,
84
85           <http://oeis.org/A036704> (etc)
86
87           A036705  first diffs of N on X axis,
88                      being count of X,Y points n-1/2 < norm <= n+1/2
89           A036706  1/4 of those diffs
90
91           n_start=1 (the default)
92             A036707  N/2+X-1 along X axis,
93                        being count norm <= n+1/2 in half plane
94             A036708  (N(X,0)-N(X-1,0))/2+1,
95                        first diffs of the half plane count
96
97           n_start=0
98             A036704  N on X axis, from X=1 onwards
99                        count of X,Y points norm <= n+1/2
100

SEE ALSO

102       Math::PlanePath, Math::PlanePath::PixelRings, Math::PlanePath::Hypot,
103       Math::PlanePath::MultipleRings
104

HOME PAGE

106       <http://user42.tuxfamily.org/math-planepath/index.html>
107

LICENSE

109       Copyright 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Kevin
110       Ryde
111
112       This file is part of Math-PlanePath.
113
114       Math-PlanePath is free software; you can redistribute it and/or modify
115       it under the terms of the GNU General Public License as published by
116       the Free Software Foundation; either version 3, or (at your option) any
117       later version.
118
119       Math-PlanePath is distributed in the hope that it will be useful, but
120       WITHOUT ANY WARRANTY; without even the implied warranty of
121       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
122       General Public License for more details.
123
124       You should have received a copy of the GNU General Public License along
125       with Math-PlanePath.  If not, see <http://www.gnu.org/licenses/>.
126
127
128
129perl v5.32.1                      2021-01-27   Math::PlanePath::FilledRings(3)
Impressum