The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Math::PlanePath::MathImageGosperIslandsTree -- self-similar hexagons

SYNOPSIS

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

DESCRIPTION

In progress.

This path traverses a self-similar hexagonal tiling of the plane, at each level giving a Gosper island shape.

     x=-4 -3 -2 -1  0  1  2  3  4  5  6  7  8  9 10 11

The points are spread out on every second X coordinate to make little triangles but staying in integer coordinates. It should be equilateral triangles, but on a square grid this comes out a little flatter.

The basic pattern is ...

FUNCTIONS

$path = Math::PlanePath::MathImageGosperIslandsTree->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.

SEE ALSO

Math::PlanePath, Math::PlanePath::Flowsnake, Math::PlanePath::FlowsnakeCentres, Math::PlanePath::GosperIslands