pouët.net

Go to bottom

Fractal Playground by Reservoir Gods [web]

                              *+*+*+*+*+*+*+*+*+*
                              FRACTAL  PLAYGROUND
                              *+*+*+*+*+*+*+*+*+*

                             Programmed by Mr Pink

                            [c] 1998 Reservoir Gods

[o] INTRODUCTION

Being a student at Liverpool's  John  Moore's  University  gives me lots of free
time to create exciting new programmes  for the Falcon. However, occassionally I
am required to do some work towards  the  degree.  Instead of doing this work on
the PC I again utilise my Falcon.

For the module 'Chaos And Fractals' we  were  asked to code a fractal routine. I
decided to program a whole suite of fractals. Another nail into the coffin of PC
only coursework and another release for the Falcon.


[o] FRACTAL PLAYGROUND

Imagine a theme park centred around fractal equations. Enjoy a roller coaster of
Mandlebrots and Julia sets. Ride the big dipper of the may equation. Take a spin
in the Rossler Attractor. All the fun of the fractal fair.

Fractal Playground has its own mouse-based  GUI.  When  you move your mouse over
buttons they will be  highlighted.  Click  on  them  to  enter sub-menus or draw
fractals. There are also number boxes.  Click  on  these  and  you can type in a
floating point or integer number to control the current fractal.

Fractal Playground features amazing(!) true colour graphics, innovative fractal
music, screenshots and zooming fractals. What more could a collector of chaos 
want?

[o] SCREENSHOTS

Fractal Playground has the ability to grab screenshots so you can save your
favourite fractal moments. Why not make a whole album of 'fractal highlights'
with screenshots from the program, and give a talk about them to a collection
of your bored neighbours?

Screenshots can be saved when a fractal is stopped.
Fractals are either stopped when drawing is complete or when you press
a mouse button.
Use the Function Keys to save a screenshot in the current directory.
Screens are saved in GodPaint Format.

You have 10 available slots in the current directory:

 F1  : FRACTAL1.GOD
 F2  : FRACTAL2.GOD
 F3  : FRACTAL3.GOD
 F4  : FRACTAL4.GOD
 F5  : FRACTAL5.GOD
 F6  : FRACTAL6.GOD
 F7  : FRACTAL7.GOD
 F8  : FRACTAL8.GOD
 F9  : FRACTAL9.GOD
 F10 : FRACTAL0.GOD


[o] FRACTAL MUSIC

Fractal Playground introduces a whole new concept of music - Fractal Music!
MSG composed some small pieces of melody and beat structures which are
sequenced together by the program in a chaotic manner. The tune is never
the same! Listen with your ears!


[o] MANDLEBROT

When people hear the phrase "fractal graphics" the effect they most associate 
with this term is the Mandlebrot. This was the first Fractal to break away from
the underworld of academics and penetrate the public consciousness. There was
a time when the Mandlebrot was everywhere, on posters, on T-Shirts and on every
dodgy computer generated acid house video.

Like all fractals, the mandlebrot is based on a simple equation but produces
a highly inticrate pattern. This is due to the nature of fractals, evolving
out from feedback into a series of equations.
 
The Mandlebrot equation is totally configurable.

 A START : Left edge of Mandlebrot
 A END   : Right edge of Mandlebrot
 B START : Top edge of Mandlebrot
 B END   : Bottom edge of Mandlebrot

These values can range between -2 and +2.
Smaller values indicate a higher zoom into the mandlebrot itself.

You can actually zoom into the fractal with your hands!
When the fractal has been drawn, a mouse pointer appears. 
You can now draw a box over an area of the fractal and this will be
zoomed to fill the screen. 
To draw a box click with the left mouse button to start the box.
Now move to the opposite corner and click the left mouse button again.
To clear the box press the right mouse butto.

[o] JULIA

The Julia equation is really just a slight variation on the Mandlebrot. 
However it can produce a much wider variety of graphical displays.

The A and B variables work in exactly the same way as the mandlebrot
mapping the screen to co-ordinates on the fractal.

The new values in the mandlebrot are P and Q. Changing these can radically
alter the Julia's appearance.

You can zoom into the Julia in the same way you can zoom into the Mandlebrot.


[o] SIERPINSKI

The Sierpinski triangle is based around the most simple of all fractal
algorithms, but does ably demonstrate some key features of fractals.
The first is that a simple set of rules can produce an intricate result.
The second is self similarity. If a small segment of the Sierpinski
is zoomed to fill the whole screen it will have exactly the same
appearance as the full fractal.

There was proabably some bloke called Sierpinski who developed this whole
process. Unfortunately I know nothing about him, but he does sound quite
Polish. To find out more, try looking in an encyclopedia.


[o] THE MAY EQUATION

Cast your mind back to 1845. That's quite a long time ago. Before 
"Republic" was started even. It was during this momentous year that
the brilliant and versatile Verhulst developed the theory of the
May equation. This was then extensively studied by the 'mathematical
biologist' Robert May who had the privelege of having the whole thing
named after him.

The May equation was extensively used in the study of population
dynamics. It has been used to model the spread of a virus through
a group of people.

If want to write a simple equation to calculate the number of people
infected by a virus during a week we could use the variables:

 Pnew : number of people affected at end of current week
 p    : number of people affected at end of previous week
 n    : number of people affected during week

So the equation is:

 Pnew = p + n

That is The number of people affected is the number of people already
affected plus the number of people who caught the virus during the
week.

As more people get infected the the probability for infection increases
as the likelyhood of uninfected people coming into contact with infected
people increases. This means n is proportional to p. As only people
without the virus can catch it, n is also proportional to 1-p.

So the equation becomes:

 Pnew = p + p * (1-p)

There are also another factor to virus dispersal. Some people may be immune
and some may be total hermits who never come into contact with other living
beings (i.e. they live in Wales) so have no chance of contracting the virus.
To compensate for this, we add a fudge constant called 'c' to represent
these difficulties.

The final equation is:

 Pnew = p + c + p * (1-p)

As you can see this equation relies on feedback. At the end of each week
Pnew is calculated. For the next week, this value of Pnew is assigned to p.

The May Equation is plotted with a time series graph with the X axis
representing time and the y axis representing the percentage of infection.
A point is plotted for each iteration and lines drawn between them.
Will the excitement ever begin?

You can specify the intial value of p and the value for the contamination
constant c.

Values for c should range between 0-3 to get the best results.


[o] FEIGENBAUM

Mitchell Feigenbaum. Crazy Name. Crazy Guy.
Feigenbaum got rather excited about the May equation (it's easy to see why).
and spent years studying it in minute detail. 
He represented the equation graphically using the infamous 'Feigenbaum
Diagram', possibly the ugliest and most banal fractal known to mankind.
And yes, it is included in Fractal playground.
And its very slow to calculate.

At first it may look like a straight line, but have a little patience my
friend for soon the screen will explode with excitement of a strictly
fractal nature.

Don't worry about specifying values for the equations. Just click the 
button, put your feet up and relax. Make a cup of tea. Read the paper.
You will have plenty of time on your hands before the Feigenbaum is
completed!


[o] THE LORENZ EQUATION

The Lorenz equation was developed by Edward Lorenz, a research programmer
at MIT, and not by ITV soccer pundit Matthe Lorenzo as some have mistakenly
stated.

Lorenz was both a mathematician and a meteorologist and he was keen to
develop programs to predict the weather. Lorenz began by simplifying the
weather down to a fluid dynamics system and chose 12 relevant equations
to represent each different element.

Because the computers he were using were old and slow (imagine no DSP,
no FPU, probably no real graphical display!) he simplified his model
down two three differential equations:

 dx/dt = a * (y - x)
 dy/dt = b * x - y - x * 2
 dz/dt = x * y - c * z

Where x,y and z are variables represent different aspects of the weather
a,b and c are constabts.
t represets time.

Again, this model it totally reliant on feedback. What it does show
excellently is the fact that tiny variations in the intial values can
lead to massive changed in values after a number of iterations. This
is the so called "butterfly effect" - a butterfly flapping its wings
in Abermule can cause a hurricane in New Zealand. Bad news for John E Cash.


[o] THE LORENZ ATTRACTOR

If use the Lorenz equation but plot the variables x against y against z 
on three dimensional axis we get the Lorenz attractor. The pattern that
this creates is actually an infinitely long complex spiral which never
intersects itself. However, due to the finite nature of the Falcon's
screen resolution it does appear to intersect.


[o] THE ROSSLER ATTRACTOR

The Rossler Attractor follows the principles of the Lorenz attractor
but uses a different set of equations, these being:

 dx/dt = -(y + z)
 dy/dt = x + y * a
 dz/dt = b + z * ( x - c )


[o] THE MARTIN EQUATION

Barry Martin from Birmingham Aston (Villa) University developed a method
of drawing images that resemble cell culture. The Martin Equation is
similar to the Lorenz attractor in that a pair of variables are repeatedly
transformed by two non linear equations.

The equations to plot this fractal are:

 x = y - SGN(x) * SQR(ABS(b*x-c))
 y = a - x

The Martin Equation in Fractal Playground uses the FPU to perform the
square root. Before beginning the display, Fractal Playground will check
to see if your machine has an FPU and inform you if none was found.
If you have an FPU and it doesn't locate you can just click 'CONTINUE'
in the presented dialogue box and the Martin will be drawn.
If you don't have an FPU don't click 'CONTINUE' when warned as your
machine will crash!


[o] THE RAINDROP TEST

PI is an irrational number. That means it is similar to the price of a
contemporary PC. We all know that PI begins with 3.14 but who can remember
the figures after this? It would be quite difficult to remember all them
as PI has an infinite number of decimal places. That is quite a lot.

Wouldn't it be great if we could estimate PI using a simple set of 
equations. Well we can! Great eh?

Pi is actually the ratio between the area of a circle and the square
enveloping it. We can form an approximation of PI using the Monte Carlo
method.

Imagine it is raining. This is quite easy if you live in the greater 
Manchester region. You probably won't have to do any imagining at all.
You draw a square on the ground, and a circle inside the square.
Then count the number of raindrops that land inside the circle - call
these hits - and those that land outside. The ratio of of hits to misses
gives you PI - the magic number.

In 'Fractal Playground' you don't just see the values totting up, you
get to see virtual rain falling! 

Unfortunately as my random routine isn't exactly fantastic, the value
of PI approximated isn't particularly accurate. You will be lucky if
it even reaches 3.14


[o] CREDITS

 Code          : MrPink
 Fractal Music : MSG
 Graphics      : sh3

 Much information was discovered in the excellent
 "Computers and Chaos - Atari ST Edition" by Conrad Bessant


[o] CONTACT

 mrpink_rg@hotmail.com
    msg_rg@hotmail.com
 ripley_rg@hotmail.com
       sh3@zetnet.co.uk

 http://www.acs.bolton.ac.uk/~msg1css/maison.htm
 http://www.users.zetnet.co.uk/zmoe3/three.htm

 Leon O'Reilly . Cwm Isaf . Abermule . Welshpool . Powys . SY15 6JL

 Released at OrlandoJam, May 31 1998
 Winner of "Best Fractal Utility"

==============================================================================
                                                    [c] 1998 Reservoir Gods
==============================================================================
Go to top