Fork me on GitHub

octave-fractals by Bruno Girin

Simple scripts to generate Mandelbrot and Julia fractals with Octave.

The Project

I originally created this set of Octave scripts out of curiosity about fractals and in particular the Mandelbrot and Julia sets. I then decided to talk about it and share the code and some sample images on my weblog. The functions and scripts presented here are the ones I used to produce the images. They were designed to be generic enough and you should be able to produce any Mandelbrot or Julia set image, to any size you want (within the limits of your computer's processor and memory of course).

Here are a few examples taken out of the articles:

Installation Instructions

Dependencies

The scripts in the project are designed to be run with octave. You will therefore need to install octave first. Here is how to do it on Unbuntu:

$ sudo apt-get install octave

If you are using a different operating system, please follow the instructions on the octave web site.

It may also be useful to install ImageMagick in order to be able to transform ppm images into another format. Here is how to do it on Ubuntu:

$ sudo apt-get install imagemagick

The octave-fractals scripts

Download the zip or tar archive and extract it in any directory. And that's it! Well, nearly. You can actually run the demo script immediately:

cd octave-fractals
octave fractaldemo.m

This will produce all the images introduced on my weblog.

If you want to include the mandelbrot or julia functions in your own octave code, add the following to your .octaverc file (or create one in your home directory if you don't have one):

addpath("~/octave-fractals")

License

Copyright 2008–2010 Bruno Girin

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Download

You can download this project in either zip or tar formats.

You can also clone the project with Git by running:

$ git clone git://github.com/brunogirin/octave-fractals

References

None of this was created in a vaccum. I used a number of offline and online references so if you are interested in the subject of fractals, you could do a lot worse than checking them out:

And of course, the original articles on my weblog will provide you with the background and thought process that I went through in creating those scripts.