package ifs-fractals
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
IFS fractals (the Barnsley fern and friends) drawn with the chaos game
Install
dune-project
Dependency
Authors
Maintainers
Sources
v1.2.0.tar.gz
md5=d40602261f2f6e005278ca546e37b640
sha512=adf4d4a25a86a8d0041d6677dd26a21f4f97d7523f00b4b6037c8e73981e259fa763c682e8fedb5597ce3908a8c400ab2f872c745ef6274c413161d1dfc3d7d5
doc/index.html
ifs-fractals
Fractals defined by iterated function systems, drawn with the chaos game — in a graphics window, or into a PNG file with no display needed.
An iterated function system is a handful of affine maps, each contracting. Applied over and over to a point, in an order drawn at random, they trace out a single figure — the attractor of the system — no matter where one starts. A whole fern is four such maps:
let barnsley =
{ po = {x= -2.25; y= -0.50};
sz = {x= 5.00; y= 11.00};
lt = [{pb= 0.84; kf= [| 0.85; 0.04; 0.00; -0.04; 0.85; 1.60|] };
{pb= 0.91; kf= [|-0.15; 0.28; 0.00; 0.26; 0.24; 0.44|] };
{pb= 0.98; kf= [| 0.20; -0.26; 0.00; 0.23; 0.22; 1.60|] };
{pb= 1.00; kf= [| 0.00; 0.00; 0.00; 0.00; 0.16; 0.00|] }] }The library
Everything is in a single module, Ifs_fractals.
utop # open Ifs_fractals;;
utop # show barnsley 200_000;; (* draw it, wait for a key *)
utop # save_png ~color:true lace 300_000 "lace.png";;Sixteen systems are predefined, listed in Ifs_fractals.all, and more can be read from Fractint .ifs files with Ifs_fractals.load_fractint, including the three-dimensional ones, which are projected from a direction of your choosing.
The command
The same from a shell:
$ ifs-fractals --list
$ ifs-fractals barnsley
$ ifs-fractals -o lace.png -s 800x800 -c lace
$ ifs-fractals -f classics.ifs -v 30,20 3dfernSee also
- The source repository, whose README has pictures.
- Michael Barnsley, Fractals Everywhere, Academic Press, 1988 — where the fern and the theory behind it come from.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page