Tels >
Math-Fractal-Mandelbrot-0.04 >
Math::Fractal::Mandelbrot

Module Version: 0.04
Math::Fractal::Mandelbrot - Calculate points in the mandelbrot fractal

Calculates points, horizontal/vertical stripes or rectangular areas of the famous Mandelbrot fractal.

This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

Math::Fractal::Mandelbrot->set_max_iter($max_iter);

Set the maximum number of iterations. 600 is the default and quite suitable for the start image. When zooming in, this value should be increased to not loose details.

Math::Fractal::Mandelbrot->set_limit($limit);

The default value is 5 and should only be changed if you know why.

Math::Fractal::Mandelbrot->set_epsilon($e);

The default value is 0.001. When the change between two iterations is less than this number, the point is considered to be on the inside.

Math::Fractal::Mandelbrot->set_bounds($x1,$y1,$x2,$y2,$w,$h);

Set the coordinates from x1, y1 to x2, y2 and the width of the computed image to w and h.

The default values are:

Math::Fractal::Mandelbrot->set_bounds(-2,-1.1, 1,1.1, 640,480);

my $iter = Math::Fractal::Mandelbrot->point($x,$y);

Calculates the value at the point `$x`

and `$y`

. The return value 0 means the point is inside the fractal (typical the black area), any value >0 means the number of iterations it took to find out that the point is on the outside.

$x and $y should be between 0 and `w`

and 0 and `h`

, respectively (see set_bounds()).

my $points = Math::Fractal::Mandelbrot->hor_line($x1,$y1,$l);

Calculates the values at a horizontal line and returns them all as a ref to am array.

The array will contain one extra value, which is the count of values in the array beeing equal to the first value. Example:

values count explanation ============================================================== 1,1,1,1,3, 4 # 4 are equal 1,1,3,1,3, 2 # only 2, not 3 since it stops after 2

See point() for details.

my @points = Math::Fractal::Mandelbrot->ver_line($x1,$y1,$l);

Calculates the values at a vertical line and returns them all as array. The array will contain one extra value, which is the count of values in the array beeing equal to the first value. See hor_line for an explanation of this last value.

See point() for further details.

Tels <http://bloodgate.com/> in 2003, 2005, 2006.

Math::Fractal::DLA by Wolfgang Gruber.

syntax highlighting: