Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

TeeJay (2309)

  (email not shown publicly)

Working in Truro
Graduate with BSc (Hons) in Computer Systems and Networks
pm :,,
lug : Devon & Cornwall LUG
irc : TeeJay
skype : hashbangperl
livejournal : hashbangperl []
flickr :hashbangperl []

Journal of TeeJay (2309)

Wednesday May 21, 2003
07:26 PM

Math::Curve::Hilbert - a Hilberts Curve perl module!

[ #12362 ]
I just spent the whole evening drawing sketches and tables and algorithms for Hilberts curve!

The result being a CPAN ready module that I am uploading right this minute.

Once I got my head around it, it was very easy to implement in pure perl, even if I made it a little verbose so that I can still understand it next week.

Anyway Math::Curve::Hilbert version 0.01 is now available on CPAN and allows you to get a list of coordinates in the order of hilberts curve depending on the shape and direction of the curve you want to follow as well as the level of recurssion.

update Oopsie! there is a mistake in the pod - the starting X and Y should be references to numbers rather than numbers.

so you would use it like :

use Math::Curve::Hilbert qw(:all);
my ($startx,$starty) = (1,8);
my $coords = up ( clockwise=>1, level=>0, max=>2, X=>\$startx, Y=>$starty);

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.