NAME
Math::PlanePath::MathImageTerdragonMidpoint -- dragon curve midpoints
SYNOPSIS
use Math::PlanePath::MathImageTerdragonMidpoint;
my $path = Math::PlanePath::MathImageTerdragonMidpoint->new;
my ($x, $y) = $path->n_to_xy (123);
DESCRIPTION
In progress ...
This is an integer version of the terdragon paper folding curve by Davis and Knuth, following the midpoint of each edge of the curve segments.
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 X=0 1
FUNCTIONS
See "FUNCTIONS" in Math::PlanePath for the behaviour common to all path classes.
$path = Math::PlanePath::MathImageTerdragonMidpoint->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.