home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Falcon 030 Power 2
/
F030_POWER2.iso
/
ST_STE
/
MAGS
/
ICTARI01.ARJ
/
ictari.01
/
ASSEMBLY
/
MANDEL
/
MANDINF.DOC
< prev
Wrap
Text File
|
1992-03-04
|
3KB
|
64 lines
The following is some info. about the Mandelbrot set, for those of you
who know very little or nothing about it. I'm not a mathematician
(thank god) so easy on the flames. This is info. that I gleaned myself
while writing the program.
=================================================================
The formula used to calculate the set is simply:
Z=Z^2+C Where Z and C are complex numbers
Imagine a square, on the complex plane, stretching from (-2,-2i) to
(2,2i). The Mandelbrot set resides in this square. Suppose we pick an
arbitrary point in that set, say (1,0.5i). We set Z to 0 and C to be
equal to the coords of the point i.e.
Z=0+0i C=1+0.5i
We now perform the previously mentioned formula, i.e.
Z=Z^2+C
Z=(0+0i)^2+1+0.5i
Z=1+0.5i
We can continuously iterate this formula, until the value of Z (i.e.
it's modulus) zooms off towards infinity. i.e.
Z=Z^2+C
Z=(1+0.5i)^2+1+0.5i
Z=1+0.25i^2+1i+1+0.5i
Z=1-0.25+i+1+0.5i
Z=1.75+1.5i
Mandelbrot observed that if the modulus of Z is ever greater than or
equal to 4, then the formula will move towards infinity. i.e. in the
above example
Z=1.75+1.5i
|Z|=1.75^2+1.5^2
=3.0625+2.25
=5.3125
Therefore, after 2 iterations of the simple formula we can see that
this particular example will zoom towards infinity.
What we do to create the "pretty" picture of the set is to count how
many iterations of the formula can be performed to make the modulus of Z
greater than or equal to 4. This value is then mapped to a colour and
then displayed on screen, to create a surprisingly interesting picture
(you can now see why the action only happens in the square of side 4
centred around the origin [actually the circle of radius 2 centred
around the origin].) Of course with certain values of C, the
formula requires many iterations before it reaches the above infinity
criteria. So, we have a limiting number of iterations to prevent
the program calculating for too long. Initially the program is set to
stop iterating for a particular point at 100 iterations. This value
can be altered though. If the number of iterations at a point does
actually reach this limiting factor then it is coloured black, to
make it stand out from the other points. The other pixels are simply
coloured mod 14. i.e. a pixel that took 7 iterations will have
colour 7, a pixel that took 39 iterations will have colour 11 etc.