NAME

Math::PlanePath::CCurve -- Levy C curve

SYNOPSIS

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

DESCRIPTION

This is ...

                        11-----10-----9/7-----6------5               3
                         |             |             |                
                 13-----12             8             4------3        2
                  |                                         |         
          19---14/18----17                                  2        1
           |      |      |                                  |         
   21-----20     15-----16                           0------1   <- Y=0
    |                                                                 
   22                                                               -1
    |                                                                 
  25/23---24                                                        -2
    |                                                                 
   26     35-----34-----33                                          -3
    |      |             |                                            
  27/37--28/36          32                                          -4
    |      |             |                                            
   38     29-----30-----31                                          -5
    |                                                                 
39/41-----40                                                        -6
    |                                                                 
   42                                              ...              -7
    |                                                |                
   43-----44     49-----48                          64-----63       -8
           |      |      |                                  |         
          45---46/50----47                                 62       -9
                  |                                         |         
                 51-----52            56            60-----61      -10
                         |             |             |                
                        53-----54----55/57---58-----59             -11

                                                     ^
   -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::CCurve->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->xy_to_n ($x,$y)

Return the point number for coordinates $x,$y. If there's nothing at $x,$y then return undef.

$n = $path->n_start()

Return 0, the first N in the path.

SEE ALSO

Math::PlanePath, Math::PlanePath::DragonCurve, Math::PlanePath::ComplexMinus

HOME PAGE

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

LICENSE

Copyright 2011, 2012 Kevin Ryde

This file is part of Math-PlanePath.

Math-PlanePath 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-PlanePath 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-PlanePath. If not, see <http://www.gnu.org/licenses/>.