Professional Documents
Culture Documents
Delphine Pricilla.S M.SC (Information Technology) Stella Maris College
Delphine Pricilla.S M.SC (Information Technology) Stella Maris College
Fractals
DELPHINE PRICILLA.S
M.sc(Information Technology)
STELLA MARIS COLLEGE
ABSTRACT:
Its impressing how easy it is to draw fractals with
Python. Using the ubercool Python Imaging Library and
native complex number support in Python you can code an
elaborate and easy to understand fractals in python. Fractals
are awesome, they are built with very complex pattern and
they allow you to zoom in forever! we will see how easily it
is to plot several kinds of fractals using a tool called L-
Systems and the Python Turtle module for the step to step
plotting. I'm not going to dive into too many technical details
but instead I'll present a little introduction, a lot of animated
examples and at the end, the code to generate your own.
Additionally, there will be some resources for both code and
math background if you want to explore at the end.
INTRODUCTION:
Lets give a "non-strict" definition of
what a fractal is, it is basically a geometric figure which
shows the same characteristics no matter how much you
zoom in.It isn't quite correct but for those who wanted to
know the exact definition here it is (A fractal is an object or
quantity that displays self-similarity, in a somewhat technical
sense, on all scales. The object need not exhibit exactly the
same structure at all scales, but the same "type" of
structures must appear on all scales. A plot of the quantity
on a log-log graph versus scale then gives a straight line,
whose slope is said to be the fractal dimension) Fractals are
typically hard to draw, because there is a concept which is
deeply tight in them, recursion. When we talk about graphics
and plotting we usually talk about pixels or vectors, but there
is always a limit, fractals by definition are infinitely recursive.
So when we want to plot one we should stop at some point,
that's why we talk about "iterations". At each iteration the
fractal becomes more and more complex, but at some point
it is impossible to distinguish between to successive
iterations (this happens when changes occur at individual
pixel levels), so it is quite reasonable to stop there,
sometimes it is quite clear what the shape is and we can
stop even earlier.
Sierpinski triangle
Julia fractals
KOCH SNOWFLAKES:
The Koch Snowflake is a type of fractal.
drawn with increasing levels of complexity. The level of The
Koch fractal, also called the Koch snowflake, can be
complexity is called the order of the Koch fractal. A fractal is
pattern that produces a picture which contains an infinite
amount of copies of itself. It can be viewed as a drawing with
a self-similar structure that is defined in terms of itself.
SIERPINSKI TRIANGLE:
Another famous fractal called the
Sierpinski Triangle named after Polish mathematician
Waclaw Sierpinski. He seemed to have played around with it
the most. To state it simple, you start with an equilateral
triangle and then form smaller triangles by connecting the
midpoints of each of the sides. Some folks shade alternate
triangles to pretty up the pattern. We are using the canvas of
the Python Image Library (PIL) to draw the triangle and save
the final image to a file.Python has a module called turtle that
allows us to draw cool shapes very easily. A fun application
of recursion is in generating fractals. Fractals are shapes or
images that are generated by repeated application of an
equation or a set of rules on said shape or image. The
fascinating thing about fractals is their abundance in nature
and the wide variety of remarkable images and patterns one
could generate with only a simple set of rules. In this
assignment, you will be drawing two-dimensional fractals.
3.JULIA FRACTRALS:
Julia sets are closely related to the Mandelbrot Set, which
we explored last issue with some basic Python. All of these
are produced by the code we’ll develop here from the same
simple iterated function z2+c as the Mandelbrot fractals. You
can see that they are different to the Mandelbrot set, and yet
there’s something about them that is similar. You can also
see that some Julia sets are a single object like the
Mandelbrot, but some are many pieces, with some even
becoming so fragmented they are almost like dust. It might
not be obvious, but while there is only one Mandelbrot, there
are infinitely many Julia sets. The recipe, or algorithm, for
creating Julia sets is the same as that for the Mandelbrot set
except for one key difference.
CONCLUSION:
Fractals are all around us.
Mathematicians have developed and are continuing to
develop equations to generate these fractals. This project
detailed the Lindenmayer grammar system and discussed
how it is used to produce a certain type of fractal. Several
examples were given, and further mathematical properties
of some of them were explored, including the idea of
fractal dimension. There are many other types of fractals
that are produced using different methods, the most
notable being the Mandelbrot Set, the Julia Set and Koch
snowflakes fractals. Lindenmayer set out to model the
growth pattern of algae. His Lindenmayer systems are the
height of simplicity.
REFERENCE:
Cameron, J. S., "Artificial Life - Aristid
Lindenmayer". http://www.alesdar.org/oldSite/IS/chap4-
1.html.
Clayton, K., "Fractals & the Fractal
Dimension". http://www.vanderbilt.edu/AnS/psychology/c
ogsci/chaos/workshop/Fractals.html.
Devaney, R. L., "Chaos in the Classroom - Fractal
Dimension". http://math.bu.edu/DYSYS/chaos-
game/node6.html.
Frame, M. and Mandelbrot, B., "Box-Counting
Dimension of the Cantor Set". http://classes.yale.edu/99-
00/math190a/CantorBoxDim.html.
Lewis-Bowen, J., "Lindenmayer
Systems". http://www.lewisbowen.uklinux.net/program/ls
ystem.
Ochoa, G., "An Introduction to Lindenmayer
Systems". http://www.biologie.uni-hamburg.de/b-
online/e28_3/lsys.html
Riddle, L., "Sierpinski
Gasket". http://ecademy.agnesscott.edu/~lriddle/ifs/siertr
i/siertri.htm.
Schnier, T., "Lindenmayer Systems - Basics: Nature
Inspired
Design". http://www.cs.bham.ac.uk/~xin/courses/design/
11-l-systems-1-4up.pdf.
Weisstein, E. W., "Koch Snowflake -- from
Mathworld". http://mathworld.wolfram.com/KochSnowflak
e.html.
Weisstein, E. W., "Sierpinski Sieve -- from
Mathworld". http://mathworld.wolfram.com/SierpinskiSiev
e.html.