Linux-Svgalib
view release on metacpan or search on metacpan
examples/mand2.pl view on Meta::CPAN
#!/usr/bin/perl -w
use strict;
use Linux::Svgalib;
use vars qw($P @Q $col $row @colours );
my (
$max_iterations,
$max_size ) = (512,4);
my $screen = Linux::Svgalib->new();
$screen->init();
$screen->setmode(8);
my ($XMax,$XMin,$YMax,$YMin) = (1.2,-2.0,1.2,-1.2);
my $maxcol = $screen->getxdim();
examples/mand2.pl view on Meta::CPAN
$P = $XMin;
for $col ( 0 .. $maxcol -1 )
{
for $row ( 0 .. $maxrow - 1)
{
my ($X,$Y,$XSquare,$YSquare) = (0,0,0,0);
my $colour = 1;
while (( $colour < $max_iterations ) &&
(($XSquare + $YSquare ) < $max_size ))
{
$XSquare = $X * $X;
$YSquare = $Y * $Y;
$Y *= $X;
$Y += $Y + $Q[$row];
$X = $XSquare - $YSquare + $P;
$colour++;
}
( run in 0.746 second using v1.01-cache-2.11-cpan-71847e10f99 )