1Math::PlanePath::GosperUSsiedre(C3o)ntributed Perl DocumMeanttha:t:iPolnanePath::GosperSide(3)
2
3
4

NAME

6       Math::PlanePath::GosperSide -- one side of the Gosper island
7

SYNOPSIS

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

DESCRIPTION

14       This path is a single side of the Gosper island, in integers
15       ("Triangular Lattice" in Math::PlanePath).
16
17                                               20-...        14
18                                              /
19                                      18----19               13
20                                     /
21                                   17                        12
22                                     \
23                                      16                     11
24                                     /
25                                   15                        10
26                                     \
27                                      14----13                9
28                                              \
29                                               12             8
30                                              /
31                                            11                7
32                                              \
33                                               10             6
34                                              /
35                                       8---- 9                5
36                                     /
37                              6---- 7                         4
38                            /
39                           5                                  3
40                            \
41                              4                               2
42                            /
43                     2---- 3                                  1
44                   /
45            0---- 1                                       <- Y=0
46
47            ^
48           X=0 1  2  3  4  5  6  7  8  9 10 11 12 13 ...
49
50       The path slowly spirals around counter clockwise, with a lot of
51       wiggling in between.  The N=3^level point is at
52
53          N = 3^level
54          angle = level * atan(sqrt(3)/5)
55                = level * 19.106 degrees
56          radius = sqrt(7) ^ level
57
58       A full revolution for example takes roughly level=19 which is about
59       N=1,162,000,000.
60
61       Both ends of such levels are in fact sub-spirals, like an "S" shape.
62
63       The path is both the sides and the radial spokes of the "GosperIslands"
64       path, as described in "Side and Radial Lines" in
65       Math::PlanePath::GosperIslands.  Each N=3^level point is the start of a
66       "GosperIslands" ring.
67
68       The path is the same as the "TerdragonCurve" except the turns here are
69       by 60 degrees each, whereas "TerdragonCurve" is by 120 degrees.  See
70       Math::PlanePath::TerdragonCurve for the turn sequence and total
71       direction formulas etc.
72

FUNCTIONS

74       See "FUNCTIONS" in Math::PlanePath for behaviour common to all path
75       classes.
76
77       "$path = Math::PlanePath::GosperSide->new ()"
78           Create and return a new path object.
79
80       "($x,$y) = $path->n_to_xy ($n)"
81           Return the X,Y coordinates of point number $n on the path.  Points
82           begin at 0 and if "$n < 0" then the return is an empty list.
83
84           Fractional $n gives a point on the straight line between integer N.
85
86   Level Methods
87       "($n_lo, $n_hi) = $path->level_to_n_range($level)"
88           Return "(0, 3**$level)".
89

FORMULAS

91   Level Endpoint
92       The endpoint of each level N=3^k is at
93
94           X + Y*i*sqrt(3) = b^k
95           where b = 2 + w = 5/2 + sqrt(3)/2*i
96                 where w=1/2 + sqrt(3)/2*i sixth root of unity
97
98           X(k) = ( 5*X(k-1) - 3*Y(k-1) )/2        for k>=1
99           Y(k) = (   X(k-1) + 5*Y(k-1) )/2
100                  starting X(0)=2 Y(0)=0
101
102           X(k) = 5*X(k-1) - 7*X(k-2)        for k>=2
103                  starting X(0)=2 X(1)=5
104                = 2, 5, 11, 20, 23, -25, -286, -1255, -4273, -12580, -32989,..
105
106           Y(k) = 5*Y(k-1) - Y*X(k-2)        for k>=2
107                  starting Y(0)=0 Y(1)=1
108                = 0, 1,  5, 18, 55, 149,  360,   757,  1265, 1026, -3725, ...
109                                                                   (A099450)
110
111       The curve base figure is XY(k)=XY(k-1)+rot60(XY(k-1))+XY(k-1) giving
112       XY(k) = (2+w)^k = b^k where w is the sixth root of unity giving the
113       rotation by +60 degrees.
114
115       The mutual recurrences are similar with the rotation done by (X-3Y)/2,
116       (Y+X)/2 per "Triangular Lattice" in Math::PlanePath.  The separate
117       recurrences are found by using the first to get Y(k-1) = -2/3*X(k) +
118       5/3*X(k-1) and substitute into the other to get X(k+1).  Similar the
119       other way around for Y(k+1).
120

OEIS

122       Entries in Sloane's Online Encyclopedia of Integer Sequences related to
123       this path include
124
125           <http://oeis.org/A099450> (etc)
126
127           A229215   direction 1,2,3,-1,-2,-3 (clockwise)
128           A099450   Y at N=3^k (for k>=1)
129
130       Also the turn sequence is the same as the terdragon curve, see "OEIS"
131       in Math::PlanePath::TerdragonCurve for the several turn forms, N
132       positions of turns, etc.
133

SEE ALSO

135       Math::PlanePath, Math::PlanePath::GosperIslands,
136       Math::PlanePath::TerdragonCurve, Math::PlanePath::KochCurve
137
138       Math::Fractal::Curve
139

HOME PAGE

141       <http://user42.tuxfamily.org/math-planepath/index.html>
142

LICENSE

144       Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Kevin Ryde
145
146       Math-PlanePath is free software; you can redistribute it and/or modify
147       it under the terms of the GNU General Public License as published by
148       the Free Software Foundation; either version 3, or (at your option) any
149       later version.
150
151       Math-PlanePath is distributed in the hope that it will be useful, but
152       WITHOUT ANY WARRANTY; without even the implied warranty of
153       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
154       General Public License for more details.
155
156       You should have received a copy of the GNU General Public License along
157       with Math-PlanePath.  If not, see <http://www.gnu.org/licenses/>.
158
159
160
161perl v5.30.1                      2020-01-30    Math::PlanePath::GosperSide(3)
Impressum