Download PC Graphics - Bitsavers.org
Transcript
technique takes advantage of symmetry.
The Mandelbrot set is symmetric about
the real axis. So, as long as the real axis
is in the center of the screen, we only
have to go through the iterative process
for either the top or bottom of the
screen. As each half column is
generated, we draw its reflection on the
opposite half of the screen.
This cuts the generation time in half
but doesn't work when you zoom in on
an area which doesn't contain the real
axis. No more symmetry there.
The Julia set has a different symmetry. Instead of symmetry about an
axis as in the Mandelbrot set, we have
symmetry about a point-the origin. Examine only the points in the top of the
screen. When a point (row, col) has been
colored, fill in its companion at
(max_row - row, max_col - col). Again,
this technique won't work unless the
origin is at the center of the screen (or,
at least, on the screen).
Or you can reduce max_iterations to
some value below 1000. The lower the
value, the less time it takes to draw the
set. But the resolution suffers. This
method allows coarse exploration to
take place without as much of a time
commitment. When you find an interesting region, go back to the fun 1000 iterations for higher resolution.
Earl came up with an algorithm
which deals with large portions of the
screen rather than points. Split the
screen into sections. Now look at the
center point of each section. How does it
behave when put through the iterative
process? Color the entire section according to the behavior of the center point.
Now split each section into more sections and repeat the process. You can
see that we're starting at a very low
resolution and improving that resolution with each new subdivision of sections. The advantage of this method is
that you don't have to calculate every
point on the screen. After only a few
rounds, you can get an idea what the
fractal will look like and decide whether
it's worth continuing.
What's Next?
A year ago I finished the first fractal
article by promising further exploration,
including a dip into fractal music. I lied.
I got sidetracked by Dr. Mandelbrot and
a multitude of other projects. This time
I'm not lying. Along with music, I'll be
looking into applications of fractal
mathematics in the real world. Till then.
Figure 3 - Julia Set Generator
void julia (float xmax, float xmin, float Ymax, float Ymin, float P, float Q)
{
int color, row, col;
float modulus, deltaX, deltaY,
Xcur, Xlast, Ycur, Ylast;
deltaX = (xmax - xmin)/(maxcol - 1);
/* determine real axis increment */
deltaY = (Ymax - Ymin)/(maxrow - 1); /* determine imaginary axis increment */
for (col = 0; col <= maxcol; col++)
/* look at each point on screen */
for (row = 0; row <= maxrow: row++)
{
modulus = 0.0:
color = 0;
/* find coordinates of Z [0]
Xlast
xmin + col * deltaX;
Ylast
Ymin + row * deltaY;
while «modulus < max size) && (color < max iterations»
{
/* go around until function blows-up or until max iterations
Xcur = sqr (Xlast) - sqr (Ylast) + P;
/* find components of next Z
Ycur
2 * Xlast * Ylast + Q;
color++;
/* update last Z
Xlast = Xcur;
Ylast
Ycur;
modulus
sqr (Xcur) + sqr (Ycur);
/* find size of Z
=
=
=
=
=
draw-point (col, row,
*/
*/
*/
*/
*/
(color % max_colors»;
/* julia */
k'vJtl)]I11fIItl)]~IEill
l])®~ ~®WJ~
You can develop DOS multiuser applications D..QlY with Pecan's
new Poly Power System. On any
XT, AT, PS/2 or compatible.
Under any version of DOS 2.0
or later.
All you need is Pecan's Poly
Power System, one or more of
our compilers: UCSD Pascal,
Modula-2, FOKfRAN-77, BASIC,
Assembler (C is coming soon),
and inexpensive dumb terminals on serial ports.
You can even have multiple programmers develop on a
single machine.
Poly Power System, $399.95. Compilers, $79.95 each.
Call us for full details and to place your order.
fPLo~c:""\
Cl C1
C7i:1c:::1
~o
C
.Cl
~
Tho UCSD PDDcal Company
1-800-63-P ECAN
Pecan Software Systems, Inc.
1410 39th Street
Brooklyn, NY 11218
718·851·3100
Pecan Software Europe, Ltd.
MGM House, Oakfield Grove
Clifton, Bristol, BS8 2BN, England
0272 733633
Reader Service Number 29
•••
MICRO CORNUCOPIA, #39, Jan-Feb 1988
9