NAME
Math::PlanePath::MathImageKochQuadflakes -- four-sided Koch snowflakes
SYNOPSIS
use Math::PlanePath::MathImageKochQuadflakes;
my $path = Math::PlanePath::MathImageKochQuadflakes->new;
my ($x, $y) = $path->n_to_xy (123);
DESCRIPTION
In progress.
This is the pattern of the Koch curve arranged as four sided concentric snowflakes.
... 15 3
/ / \
75--74 17--16 14--13 2
| | |
76 18 12 1
/ / 4 -- 3 \
77 19 | 11 <- Y=0
\ \ 1 -- 2 /
78 20 10 -1
| |
79--80 5-- 6 8-- 9 -2
\ \ /
81 7 -3
|
82 -4
/
83 -5
\
84 -6
21--22 24--25 33--... -7
\ / \ /
23 26 32 -8
| |
27--28 30--31 -9
\ /
29 -10
^
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 X=0 1 2 3
The innermost square of points N=1 to N=4 are on X=+/-0.5,Y=+/-0.5 fractions, the further points are integer X,Y on a square grid.
Inward
The inout
option can direct the sides inward instead of outward. The side lengths etc are the same.
69--68 66--65 57--56 54--53 7
| \ / \ / \ / |
70 67 64 58 55 52 6
\ | | /
71 63--62 60--59 51 5
/ \ / \
72 61 50 4
| |
73 49 3
\ /
74--75 17--16 14--13 47--48 2
| | \ / | |
76 18 15 12 46 1
\ \ 4--3 / /
77 19 | 11 45 <- Y=0
/ / 1--2 \ \
78 20 7 10 44 -1
| / \ | |
80--79 5-- 6 8-- 9 43--42 -2
/ \
81 41 -3
| |
82 29 40 -4
\ / \ /
83 27--28 30--31 39 -5
/ | | \
84 23 26 32 35 38 -6
/ \ / \ / \ |
21--22 24--25 33--34 36--37 -7
^
-7 -6 -5 -4 -3 -2 -1 X=0 1 2 3 4 5 6 7
FUNCTIONS
$path = Math::PlanePath::MathImageKochQuadflakes->new ()
$path = Math::PlanePath::MathImageKochQuadflakes->new (inout => $enum)
-
Create and return a new path object.