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

NAME

Math::PlanePath::MathImageQuintetSide -- one side of the quintet tiling

SYNOPSIS

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

DESCRIPTION

In progress.

This path is ...

                      ...
                       |
                26----27
                 |
          24----25
           |
          23----22
                 |
          20----21
           |
    18----19
     |
    17----16
           |
          15----14
                 |
                13----12                  6
                       |
                      11----10            5
                             |
                       8---- 9            4
                       |
                 6---- 7                  3
                 |
                 5---- 4                  2
                       |
                 2---- 3                  1
                 |
           0---- 1                    <- Y=0

           ^    
          X=0    1     2     3

It slowly spirals around counter clockwise, with a lot of wiggling in between. The N=3^level point is at

   N = 3^level
   angle = level * atan(1/2)
         = level * 26.56 degrees
   radius = sqrt(5) ^ level

A full revolution for example takes roughly level=14 which is about N=4,780,000.

Both ends of such levels are in fact sub-spirals, like an "S" shape.

FUNCTIONS

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

$path = Math::PlanePath::MathImageQuintetSide->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 $n gives a point on the straight line between surrounding integer N.

SEE ALSO

Math::PlanePath, Math::PlanePath::KochCurve

Math::Fractal::Curve

HOME PAGE

http://user42.tuxfamily.org/math-image/index.html

LICENSE

Copyright 2011, 2012 Kevin Ryde

Math-Image is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Math-Image is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Math-Image. If not, see <http://www.gnu.org/licenses/>.