NAME
Math::PlanePath::MathImageSierpinskiCurve -- Sierpinski octant curve
SYNOPSIS
use Math::PlanePath::MathImageSierpinskiCurve;
my $path = Math::PlanePath::MathImageSierpinskiCurve->new;
my ($x, $y) = $path->n_to_xy (123);
DESCRIPTION
This path is an integer version of the self-similar curve by Sierpinski going along the X axis and making triangular excursions.
63-64 14
| |
62 65 13
/ \
60-61 66-67 12
| |
59-58 69-68 11
\ /
51-52 57 70 10
| | | |
50 53 56 71 ... 9
/ \ / \ /
48-49 54-55 72-73 8
|
47-46 41-40 7
\ / \
15-16 45 42 39 6
| | | | |
14 17 44-43 38 5
/ \ /
12-13 18-19 36-37 4
| | |
11-10 21-20 35-34 3
\ / \
3--4 9 22 27-28 33 2
| | | | | | |
2 5 8 23 26 29 32 1
/ \ / \ / \ /
0--1 6--7 24-25 30-31 Y=0
^
X=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...
FUNCTIONS
$path = Math::PlanePath::MathImageSierpinskiCurve->new ()
-
Create and return a new path object.
($x,$y) = $path->n_to_xy ($n)
-
Return the X,Y coordinates of point number
$n
on the path. Points begin at 0 and if$n < 0
then the return is an empty list.Fractional positions give an X,Y position along a straight line between the integer positions.
$n = $path->n_start()
-
Return 0, the first N in the path.