Make sure to install dependencies (node-gd
) first with npm install
. Then,
run node run.js FILE_NAME
in terminal, where FILE_NAME
is the name of the
file containing the iterated function system.
IFS
stands for "Iterated function sequence." It is a finite set of
contraction mappings.
A contraction mapping is a function f of metric spaces
f: X -> X
with the property that there is a 0 ≤ k < 1
such that
d(f(x),f(y)) ≤ k*d(x,y)
for all x
and y
in X
. d
refers to the distance
(metric) function. The idea here is that each time f
is applied to the metric
space X
, the image of f
is "smaller" than it was previously, i.e. it has
contracted.
Contraction maps are the basis for storing fractal representations. An IFS
contains a finite set of contraction mapping, often represented in the form
a b c d e f p
where a
through f
are coefficients of a linear map and p
is the probability that this particular map in the IFS will be applied next. If
p
is omitted, the distribution is assumed to be uniform.
Given a function f
in our IFS, it sends a point (x,y)
to the point
(ax + by + e, cx + dy + f)
. This point is then run through the IFS again.
This process is repeated a given number of times and produces a fractal.
- Iterated Function System:
- Contraction Mapping:
- Inspiration:
- Examples: