NAME

Math::PlanePath::MathImageOctzagRings -- Koch snowflakes as concentric rings

SYNOPSIS

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

DESCRIPTION

This is concentric Octzag curves making the sides of a square.

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

The initial figure is the square N=1,2,3,4 then for the next level each straight side expands to 4x longer and a zigzag like N=4 through N=12,

                          *---*
                          |   |
*---*     becomes     *---*   *   *---*
                              |   |
                              *---*

Level Ranges

Counting the innermost square as level 0, each ring is

Nstart = 8^level
length = 4*(8^level)   many points

For example the outer ring shown above is level 2 starting N=8^2=16 and having length=3*4^2=48 points (through to N=63 inclusive).

The X range at a given level is ...

Xlo = -(4^level) - ...
Xhi = +(4^level) + ...

FUNCTIONS

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

Create and return a new path object.

SEE ALSO

Math::PlanePath, Math::PlanePath::GosperIslands, Math::PlanePath::KochSnowflakes