Categorized | News

PEAR::Math_Complex and fractals

Posted on 24 October 2004 by Demian Turner

Thanks to Mario from PHPkitchen’s Spanish sister site for this article.

While studying the bibliography from an old article in Scientific American on fractals, I came across an interesting explanation detailing how to develop biomorphs through simple scripting.

The formulae used were based on the study of spatial relationships using complex numbers and it was here that the version – still beta at the time – of the Pear::Math_Complex class demonstrated its effectiveness, and its ability to manage via a relatively simple interface complex numbers and computations thereof.

The computations involved iterative processes that demanded a lot of CPU resource, so I wouldn’t recommend using similar algorithms for web projects, there are other languages better suited to the task.

But for an experimental exercise the results were interesting.  I developed a small script using two functions  (Z3 + C y sen(z) + Z2 + C).  Using the function Z3 + C I generated the following biomorph:

This example serves to illustrate the use of Math_Complex, and should be a good starting point for those interested in learning the basics.  For more info on the subject check out this article from phpPatterns.

Bookmark and Share

Leave a Reply



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up