Mad Teddy's web-pages
If you've visited my
Fractals #1: the Cantor and Mandelbrot Sets
page, you'll know how, in August 1985, an article in Scientific American's
"Computer Recreations" column by A. K. Dewdney presented the Mandelbrot set
to a large public audience for the first time.
That article was followed by several more on the subject of fractals over
the next few years. The M-set (as Arthur C. Clarke calls it
One in particular which caught my eye was presented in the July 1989
edition. Called "biomorphs", because of their similarity to certain types of
living creatures, they are the discovery of Clifford A. Pickover (click
here
to visit his homepage; also have a look at
this page).
According to the article, Dr. Pickover ran across these strangely
biological-looking images by accident - they were the result of a bug (pun
intended) in a program he was using to investigate something else! (Now
there's a mathematician / scientist for you - take what ideas come your way,
by whatever means, and check out their possibilities. You never know what
you may find.)
Here's a creature of the type he found:
As you can see, it's like nothing you'll find in the Mandelbrot set! (You
can click on it to see a 639×479 version.)
Clifford Pickover calls a biomorph of this type, with spikes radiating from
an essentially circular centre with a symmetrical pattern inside, a
radiolarian, because of its similarity to an aquatic creature by that
name. Such patterns are generated by iterating a power of a complex number
z, which is equal to x+yi (where i2 =
-1).
The example above is generated by the cube of x+yi, which expands as
follows:
z3 =
(x+yi)3 =
(x3 -
3xy2) +
(3x2y -
y3)i
Here's the DOS BASIC program I used to generate the above image:
REM ***** RADIOLARIAN - BLACK & WHITE *****
constreal = .5
screenheight = 321
aspectratio = screenwidth / screenheight: REM approx. 4/3
black = 0
SCREEN 12: CLS : REM graphics screen, 640x480 pixels, 16 colours
ymax = 2.5
ilimit = screenheight - 1
FOR i = 0 TO ilimit
a$ = ""
You can right-click
here
to download this BASIC program, bio_bw.bas, to your hard disc.
You may have noticed four lines, in two pairs, in the above program
highlighted in blue.
The blue lines in the second pair:
xx = x * (x * x - 3 * y * y) + constreal: REM this line and the next give the cube
determine the complex function which determines the overall shape of the
image.
The blue lines in the first pair:
constreal = .5
refer to the real and imaginary components of a constant complex number
which is added at each iteration. Changing either or both of these makes a
difference to the resulting image. Try it!
You may also have noticed two magenta lines near the top of the program:
screenheight = 321
These determine the actual size of the image. You can put whatever values
you like in here; I've chosen them in my examples to give an aspect ratio of
approximately 4:3, but you don't have to.
Also, notice that they're both odd numbers. Making them odd allows the axes
(or part thereof) to appear (if they "want to"). If you make them even, the
axes won't appear (whether they "want to" or not
Sometimes it may be desirable to have the axes visible; sometimes it may
not. You can decide this for a particular image. Note, however, that if you
make one or both of these values even, so that the axis doesn't show, you'll
find instead that whatever small part of the axis does appear anyway is two
pixels wide and perhaps looks even worse than an unwanted single-thickness
axis.
Personally, I find that an axis - even if not particularly welcome - is
preferable to the double-thickness effects which may result instead. For
this reason, the examples on this page are all 429×321 pixels (odd numbers);
clicking on each will reveal a 639×479 pixel version (also odd numbers).
Also note, in this connection, that the figures given for the x-range in the
examples to follow are all based on a 429×321 layout. (This differs slightly
from the 639×479 case.)
The following image is produced by the above program, with the following
alterations:
xx = x * x - y * y + constreal: REM this line and the next give the square
and:
constreal = .4
(Again, you can click on it to see a 639×479 version.)
I'll present some more examples - some with quite different shapes -
shortly; but first, a bit more background on the topic, and then I'll
present what I believe may be my own original "variation on the theme".
Having hunted around on the internet, I'm surprised to find scant reference
to Pickover's biomorphs. There are a few oblique comments, and a bit of
history - but I haven't been able to find any actual examples! So perhaps
I'm performing a public service by presenting some of my own here. (Since
having written this, I have found something - see below, toward the
end of this page.)
As with the Mandelbrot set, these biomorphs inhabit the plane of complex
numbers (the Argand plane). Also in common with the M-set, there is an
iterative loop which processes points represented by screen pixels
according to the overall shape (set by the function equations). The fine
detail is set by the value of the complex constant.
Quite unlike the M-set, once the process exits the loop, the way a point is
represented (black or white) is determined by the size of the real and
imaginary parts of the value at exit.
The iterative loop is set to operate a set maximum number of times for each
pixel. I set this to 100 iterations (maximum) in my version, although
Dewdney's version only went to a maximum of 10 iterations. If the number is
too small, you lose detail. 10 is probably OK, but I'm playing safe.
(With the M-set, it's usual to go to 1,000 or more iterations. I suspect
that this is quite unnecessary with biomorphs.)
The condition for exiting the loop before the maximum is reached is that the
modulus of the iterated number is greater than 10, or that the magnitude of
either the real or imaginary part is greater than 10. Then, if the magnitude
of either the real or imaginary part is less than 10, the pixel is coloured
black - otherwise, it's coloured white.
This brings me to my own "variation on the theme", mentioned above.
The condition for setting the colour of each plotted pixel in the program
is contained in the lines shown in orange:
IF ABS(x) < 10 OR ABS(y) < 10 THEN
Now, that condition is actually two conditions in one. This led me to
think that there are actually four possibilities, which means that we
can have four colours in the resulting image.
So I decided to use red, green, yellow, and black as follows:
If ABS(x) < 10 and ABS(y) < 10, plot yellow;
Right-click
here
to download the modified BASIC program, bio_colr.bas, to your hard disc. (You
can use this as a basis for all the other biomorphs in this page, as well as
for any further investigations you may like to undertake yourself.)
This is the result of this program with the new colour algorithm, when
applied to the first B&W example given above:
Function: z3
Additive constant
A few comments about the documentation accompanying this and later graphics:
The x and y ranges are given to five significant figures.
The additive constant consists of two parts: the real part (0.5 in this
case), and the imaginary part (0 in this case). As already mentioned, these
appear in the program as constreal
and constimag respectively.
The "Application" of the constant may be either Type 1 or Type 2. All three
examples given so far are of Type 1. This means that the constant is added
to the function directly. With Type 2, the constant is not
added directly, but is added in the next step, so as to affect the
updated values of x and y for the next iteration without affecting the
function's current value.
Thus in the last example above (Type 1), the program contains the following four
lines:
xx = x * (x * x - 3 * y * y) + constreal
- whereas if it were decided to run a Type 2 process instead, those four
lines would read:
xx = x * (x * x - 3 * y * y)
The difference is somewhat akin to the difference (in programming terms)
between passing by reference and passing by value. It may be
subtle; but the effect on the resulting image may be profound.
I discovered this trick by experiment. Sometimes, if a Type 1 program's
output looked a bit boring, I found I could spice it up by adding the
constant in a different position - i.e. making it into a Type 2 program.
(The sketch version given originally by Dewdney can be interpreted either
way, but was probably intended to be of Type 1.) You may like to experiment
with this yourself.
Of course, if the constant is zero (i.e. 0+0i), it doesn't make any
difference. In the following examples, in such cases, I've put the
application in brackets to indicate which I think might be the better type
to use if you want to change the constant; but that's just my opinion, and I
encourage you to experiment with both types.
Having now presented a reasonably in-depth discussion of how these biomorphs
are created, I invite you to have a look at some further examples, starting
with more radiolaria and then moving on to consider functions of other
types. They all use four colours as described, and I'm keeping my
black/red/green/yellow colour scheme. (Feel free to use other colours in
your own experiments if you don't like mine!)
Function: z4
Additive constant
You get the idea: positive integer powers of z, i.e.
zn =
(x+yi)n,
give radiolaria with n-fold rotational symmetry.
The next one is based on
z5 =
(x+yi)5 =
x5 -
10x3y2 +
5xy4 +
(5x4y -
10x2y3 +
y5) i .
(This is one of my personal favourites.)
Function: z5
Additive constant
The next two are also fifth powers - this time, of the conjugate of z, i.e.
(x-yi)5 =
x5 -
10x3y2 +
5xy4 -
(5x4y -
10x2y3 +
y5) i :
Function: [conj(z)]5
Additive constant
Function: [conj(z)]5
Additive constant
The two following radiolaria (the last two in this page) are based on the
seventh power of z, i.e. z7 =
(x+yi)7
= x7 -
21x5y2 +
35x3y4 -
7xy6 +
(7x6y -
35x4y3 +
21x2y5 -
y7) i :
Function: z7
Additive constant
Function: z7
Additive constant
As mentioned, radiolaria are generated by applying a certain iterative
process to positive integer powers of complex numbers. It occurred to me to
wonder what would happen if the process were applied to powers other than
positive integers.
For a start, let's change the positive to negative. What simpler way to do
so than to investigate what happens with a power of -1, i.e. to consider
the reciprocal of a complex number?
If z = x+yi, then 1/z =
(x-yi)/(x
Fractals #2: Biomorphs
) was again featured on some of these occasions; but
other fractal types also made their appearance.
constimag = 0
screenwidth = 429
white = 15
ymin = -ymax
xmax = ymax * aspectratio
xmin = -xmax
jlimit = screenwidth - 1
FOR j = 0 TO jlimit
x0 = xmin + (xmax - xmin) * j / jlimit
y0 = -ymin - (ymax - ymin) * i / ilimit
x = x0
y = y0
FOR n = 1 TO 100
xx = x * (x * x - 3 * y * y) + constreal: REM this line and the next give the cube
yy = y * (3 * x * x - y * y) + constimag: REM of the number, plus a constant
x = xx
y = yy
IF ABS(x) > 10 OR ABS(y) > 10 OR x * x + y + y > 10 ^ 2 THEN
n = 100
END IF
NEXT n
IF ABS(x) < 10 OR ABS(y) < 10 THEN
PSET (j, i), black
ELSE
PSET (j, i), white
END IF
NEXT j
NEXT i
DO
a$ = INKEY$
LOOP UNTIL a$ = CHR$(27): REM wait until Esc is pressed to end the program
yy = y * (3 * x * x - y * y) + constimag: REM of the number, plus a constant
constimag = 0
screenwidth = 429
) -
although short lengths of axis may still appear after all.
yy = 2 * x * y + constimag: REM of the number, plus a constant
constimag = .7
PSET (j, i), black
ELSE
PSET (j, i), white
END IF
If ABS(x) >= 10 and ABS(y) < 10, plot red;
If ABS(x) < 10 and ABS(y) >= 10, plot green; and
If ABS(x) >= 10 and ABS(y) >= 10, plot black.
x: -2.5125 to 2.5125
y: -1.88 to 1.88
= (x3 -
3xy2)
+ (3x2y -
y3) i
= 0.5 + 0 i
Application:
Type 1
yy = y * (3 * x * x - y * y) + constimag
x = xx
y = yy
yy = y * (3 * x * x - y * y)
x = xx + constreal
y = yy + comstimag
x: -2.6729 to 2.6729
y: -2 to 2
= (x4 -
6x2y2
+ y4)
+ 4xy(x2 -
y2) i
= 0.5 + 0 i
Application:
Type 2
x: -2.6729 to 2.6729
y: -2 to 2
= 0.75669 (1 + i)
(Very carefully
chosen to give
exactly the effect I
wanted)
Application:
Type 2
x: -3.0070 to 3.0070
y: -2.25 to 2.25
= 1 + i
Application:
Type 2
x: -3.0070 to 3.0070
y: -2.25 to 2.25
= -15888 + 0i
Application:
Type 2
x: -2.6729 to 2.6729
y: -2 to 2
= 0.60595(1 + i)
Application:
Type 2
x: -2.6729 to 2.6729
y: -2 to 2
= 0.7568(1+i)
Application:
Type 2