Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 1.54 KB

README.md

File metadata and controls

56 lines (37 loc) · 1.54 KB

Iterated Function Systems with OCaml

Fractals are images of infinite complexity, characterized by being "similar" to themselves in some sense at all scales of magnification.

Iterated function systems are a method of generating fractals using self-similarity. An IFS image is defined as being the sum of geometric transforms of itself. It turns out that simply specifying the transforms along with a weight for each transform is enough to determine the image.

How to use this code

In your shell

$ sudo apt install ocaml opam
$ opam init
$ opam install graphics
$ opam install ocamlfind
$ eval $(opam env)
$ ocaml
        OCaml version 4.11.1

# 

In your OCaml interpreter

# #use "ifs_fractals.ml";;
# draw barnsley 200000;;

Result

Barnsley Fern

Resources

This work was carried out during a functional programming course.

Some information about Iterated Function Systems (with the Barnsley Fern):

Alternatives