Iterated Function Systems fractals 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.
$ sudo apt install ocaml opam
$ opam init
$ opam install graphics
$ opam install ocamlfind
$ eval $(opam env)
$ ocaml
OCaml version 4.11.1
#
# #use "ifs_fractals.ml";;
# draw barnsley 200000;;
This work was carried out during a functional programming course.
Some information about Iterated Function Systems (with the Barnsley Fern):