The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Math::PlanePath::MathImageStaircaseAlternatingContinuous -- integer points in stair-step diagonal stripes

SYNOPSIS

 use Math::PlanePath::MathImageStaircaseAlternatingContinuous;
 my $path = Math::PlanePath::MathImageStaircaseAlternatingContinuous->new;
 my ($x, $y) = $path->n_to_xy (123);

DESCRIPTION

This path makes a staircase pattern up from the X axis to the Y axis and back again,

     7      26--27
             |   |
     6      25  28--29
             |       |
     5      24--23  30--31
                 |       |
     4       .  22--21  32--33
                     |       |
     3       6-- 7  20--19  34--35   ..-47
             |   |       |       |       |
     2       5   8-- 9  18--17  36--37  46--45
             |       |       |       |       |
     1       4-- 3  10--11  16--15  38--39  44--43
                 |       |       |       |       |
    y=0 ->   1-- 2   .  12--13--14   .  40--41--42

             ^  
            x=0  1   2   3   4   5   6   7   8   9

FUNCTIONS

See "FUNCTIONS" in Math::PlanePath for the behaviour common to all path classes.

$path = Math::PlanePath::MathImageStaircaseAlternatingContinuous->new ()

Create and return a new staircase path object.

($x,$y) = $path->n_to_xy ($n)

Return the X,Y coordinates of point number $n on the path.

SEE ALSO

Math::PlanePath, Math::PlanePath::Staircase, Math::PlanePath::DiagonalsAlternating