ISSN 0964-5640

FRACTAL REPORT 23



Editorial and Announcements 2

Using Complex Variables in QuickBasic for Fractals Cecil J. Freeman 4

Noises, noises and noises Dr Gabriel Landini 6

Symmetries in Patterns from Mira Paul Gailiunas 8

The F.A.S.T. Method to Speed-Up the Creation of Fractal Sets Dr Jules Verschuren 10

Fractals by the Hundred Professor John Greening 16

Recursion and Turtle Graphics Paul Gailiunas 18



Fractal Report is published by Reeves Telecommunications Laboratories Ltd.,

West Towan House, Porthtowan, Truro, Cornwall TR4 8AX, United Kingdom.

Volume 4 no 23 First published October 1992. ISSN 0964-5640.

Editorial

This time more than the usual number of good articles have had to be held over, but I would still be grateful for some contributions for the next issue, preferably before the end of October.

Because of the popularity of Fractint, many readers would benefit from a regular column of articles on using Fractint, especially the Formula function. This subject is not Yvan Bozzonetti's sole domain, so other Fractint authors are invited to submit material, and comments about other sections would also be welcome.



I would also be interested in material concerning the use of the Roland LAPC-1 PC sound card to generate fractal music, preferably using a compiled BASIC. I have obtained a music toolkit, but although extensive in function, it did not appear to provide what I am looking for. The sort of thing that is needed for fractal work is something that adds this sort of command to high level languages:

MIDIPLAY

[instrument],[frequency],[duration],[channel],[attack],[volume],[decay],[position]



instrument a number 0 to 255 representing the instrument to sound

frequency a number 0 to 65535 representing the frequency (note) to be played

duration a number 0 to 65535 representing the duration of the note

channel a number 0 to 7 representing which channel is to sound

attack a number 0 to 255 representing the attack rate of the note

volume a number 0 to 255 representing the volume of the sound

decay a number 0 to 255 representing the decay of the note

position a number 0 to 255 representing the position of the instrument on the stereo sound stage.



Once again I would urge all readers to try and persuade friends to take out subscriptions to Fractal Report. The standing order proposal in the last issue has met with some success in that I have found that some banks charge only 12p/inwards standing order.



More on Copyright



An article in Mac User dated 24 July 1992 by a legal journalist pointed out that image scanners are illegal when use for their main purpose of copying pictures from magazines etc. This was sent by Dr Ian Entwistle following my comment about fractals being something that exists and therefore being not available for copyright. The article said that anyone wanting to copy an image had to embark on a very time consuming task of finding the owners of the work, starting with the publication in which it appears.



The thought occurs to me that it would be better to have an organisation like the Performing Rights Society for music which enables music to be played in pubs etc without the landlord becoming "lawyer fodder". The proposed organisation would confer legality on publications using scanned images. The problem with this idea is that most publications (Fractal Report included), unlike pubs, make very little or no money for their owners, let alone fees for organisations which exist only to placate lawyers.



Status of Science and Engineering



There has been a lot of debate recently as to the poor status of science and engineering professionals, and the lack of genuine wealth creation. The thought occurs to me that governments could incorporate the RISC system into governing countries. At the moment, we have a complex system of laws which cost a fortune to administer and which causes the most talented people to move into law - a profession that earns a lot of money without creating anything useful. With a "reduced instruction set" of laws, merely covering the basis of obvious crime, rules of the road etc, administration would be cheaper, more accessible, and talent would be released into genuine wealth creation. If you agree, tell your MP and write to national and local papers! (I know 30% of MPs are lawyers, and this is not a good representation of the people, but not all lawyers are bad people as individuals and in any case 70% of MPs are of other prefessions!)

Announcements



Archimedes Fractint



Mr Ian G. Nicholls is working on a program for the Archimedes !Chaos, which has been influenced by the PC program Fractint. It will run in single or multitasking modes, plots in 16 and 256 colours, and has other features similar to Fractint. It has 40 separate fractal functions in it. Watch this space for more news.



Fractals in Investment



The Financial Times of 19 July included a "Summer Quarterly review of Personal Finance." This included an article about Mrs Bernice Cohen, whom it alleged uses chaos theory to plan her investments. The article says that she looks for recurring patterns in price movements "'fractals' in the jargon." Although the headline and initial words of the article made much of the words "Chaos Theory" in practise it said little of how she used it.





Fractal Products



Mr John Bibby, trading as QED, supplies a range of fractal badges, books, mugs, magnets, mirrors, keyfobs, posters, jigsaws etc. More details can be obtained from him at 1, Straylands Grove York YO3 0EB. (Tel 0904-424381)



He included samples of the coasters (mats for drinks) with a 3D Mandelbrot and a "warped" mini-Mandelbrot. I do not know what he charges for these, but they looked as though they would make good talking points at dinner parties. It would seem a shame to put anything on them, although the surface did look to be reasonably hard wearing.



Amygdala 26 and the "Fastest" Mandelbrot Algorithm.



Amygdala 26 started with another piece of maths fiction, looking suspiciously like a parody on the American Food and Drug Administration. (The FDA is getting a lot of bad press recently for denying dying people life saving medication that is experimental. I and most people think that if you're dying anything is worth trying as you have nothing to lose.)



Steven Stoft has the main article on what is claimed to be the fastest Mandelbrot algorithm, called synchronous orbits. Very roughly, it takes points in groups of four as corners of a square and iterates them for as long as the results remain as a square. Then the square is divided into smaller squares and the process repeated.



The situation then becomes confused (or perhaps it is just me). This method is incorporated into a program called Fractal Witchcraft. Another article compares this with Fractint, and mentions that the former is available for a shade under $30 from Supernatural Graphics, PO Box 9185, Berkeley, CA94709, USA. Yet an advertisement on the back from that company offers the same program for a shade under $15. The reviews conclude that Fractint is best for exploring an area you have found using Fractal Witchcraft.



But wait - also in this issue is a letter from a reader who says that he has had problems with Fractal Witchcraft, commenting on its poor documentation and questioning its speed. It may well be that the synchronous orbit algorithm works best only in certain situations.



Perhaps a reader of Fractal Report who has both programs can sort this out in a future article.



The issue also reviews some books and software, including a program costing nearly $200 for the Amiga.



Amygdala is available from Box 219, San Christobal, NM87564, USA. At 17 June 1992 they had 571 subscribers, 209 of which also have the supplemental colour slides.



Correction:



In Gumowski and Mira Attractor on page 14 of issue 22, the equation 2 is incorrectly printed. The subscripts should be superscripts, ie it is X2 not X2. This does not affect the program listing beneath, so I trust that all interested readers spotted the mistake and were not inconvenienced by it.



Pickover in Theta.



Theta is a journal of mathematics aimed at the education market, and is published twice a year. The Spring 1992 issue contained an article by Dr Clifford Pickover on Intricate Patterns from logical Operators. Illustrations showed the Sierpinski Gasket and a more complicated pattern from a slightly longer formula. This article will interest machine code programmers!



Also in the same issue were reviews of two books, both of which are well known to Fractal Report readers - Dr Pickover's Computers and the Imagination, and Computers Pattern Chaos and Beauty.



Theta costs �6/year (two issues) and the issue I was sent contains 42 pages of A5 plus a glossy cover. The other articles were on mathematics generally, not especially computer use in mind, but these days it is hard to separate the two anyway! It may be obtained from the Mathematics Department Crewe + Alsager College of High Education Crewe Cheshire CW1 1DU. The publication has financial support from the college and other educational establishments.



Ushiki's Phoenix.



A brief and cryptic note from Strange Attractions (the Chaos Shop at 204, Kensington Park, London W11 1NR), together with a greetings card showing a detail of Ushiki's Phoenix, suggested that this fractal is just as full of surprises at the Mandelbrot set. This is contrary to the statement made by Joyce Haslam in Fractal Report 16.





Chaos Theory Used

in Novel Fusion Reactor Design



A Dutch company, Convectron NV, has been researching the possibility that the natural phenomenum of ball lightening contains small nuclear fusion reactions. It claims that this effect can be exploited to produce a nuclear fusion energy system that will solve many of the world's energy shortages. This is nothing to do with the "cold fusion" idea that captured the world's imagination some years back.



Circle Fractal for Growth in Convectron Fireball

generator first stage second stage



The generator stretches the circle on AB over 19 smaller, similarly shaped sections. Each following stage prolongs the fractal span with growth factor of 2.94. The intricate rotations of stage eight speeds up light (as opposed to heavy) particles above the fusion threshold.



Dr Ir D.C. Dijkhuis has been working on the concept for many years, and a few years ago raised some money from stockholders for a series of experiments to prove his theories. In a report to stockholders dated January 1991 he says that Convectron NV has been able to create ball lightening and record nuclear reactions therein.



However they are now short of money to carry out further experiments, having used valuable resources patenting their work so far. They took the peculiar step of asking shareholders for "donations" for further research, but have backed this up with a more conventional share offer, details of which are available from Postbox 382 5680 AJ Best Holland. The issue price is 50 guilders per share.



The company claims that the process is controllable and the raw material and waste products are free of radiation. The project can be now considered as leading to a short term result compared to large scale nuclear fission equipment. If the money can be found, they hope to have a working system available on the market in four years. The first two years will be spent doing experiment to verify that the concept is really viable, and this will require 5 million guilders.





Proposed Convectron Reactor

with Tesla High Voltage

Copies of translated version of the full report are available upon request and SAE. Acknowledgements to Ellen van der Mey for translating into English for Fractal Report.





Using Complex Variables in QuickBasic for Fractals



by Cecil J. Freeman



46 Ave. La Croix, Sea Point, Cape Town 8001, South Africa



The well-known fractals, the Mandelbrot set and the Julia sets, are generated by the iteration of z = z^2 + c, where z and c are complex variables. The sets are represented graphically by setting z = x + iy and plotting x,y as co-ordinates (suitably scaled) on the computer screen.



The algebra involved is simple, since if z^2 = u + iv we readily find that u = x*x - y*y and v = 2*x*y. But if we seek to iterate z = f(z), where f(z) is now a complicated expression in z, the algebra becomes horrendous. An example of this can be seen in John Topham's program for Halley's method for the function z^3-1 on p.6 of Fractal Report No. 19.



BASIC and QuickBasic, unlike Fortran and C, do not support operations on complex variable types. The writer has however developed a method of operating on complex variables in QuickBasic, as explained below and illustrated in the accompanying programs.



The writer's method depends on the fact that the formation of any rational function of the form P(z)/Q(z), where P(z) and Q(z) are polynomials in z, can be broken down into the elementary operations of adding, multiplying and dividing. Using this fact a set of QuickBasic subprocedures can be written for carrying out these operations.



The method is illustrated in the attached program. This is in three parts - a main module containing the actual program, a supporting module containing the various subprocedures and an include file listing the various procedure declarations. The latter two modules are loaded together with the main program and can be used without change in any other program.



The functions reMult and imMult, for example, give the real and imaginary components of the product of the complex variables u and v, represented by two-dimensional arrays u() and v(). The elements of u() are u(1) and u(2), the components of the complex variable u = u(1) + iu(2).



The program chosen here to illustrate the method is that for finding the roots of z*(z^6-1) = 0, using Halley's method, as explained by C. A. Pickover in his book Computers, Pattern, Chaos and Beauty (St. Martin's Press, New York, 1990); see also the paper by John Topham mentioned above.



The method involves the iteration of



F(z)

z = z -

F'(z) - (F"(z).F(z)/2F'(z))



Setting F(z) = z*(z^6-1), calculating the derivatives F'(z) and F"(z) and substituting in the above equation we finally get



3*z^7*(7*z^6+5)

z = .

7*z^6*(4*z^6+1)+1



To break this down into the elementary operations referred to above necessitates the introduction of a number of intermediate variables w1, w2 etc. as shown in the program; the rest of the program is self-explanatory. The use of a flag having the values 0 and 1 is borrowed from Topham's program for Newton's method in Fractal Report No. 7, p.9.



Output can be greatly speeded up by converting the .BAS file to an .EXE file. The subprocedure module can also be saved as a Quick Library file for easier use in other programs.



Conclusion

Although a little cumbersome when applied to complicated functions such as the above example, the method is quite straightforward, and is certainly far simpler than the type of approach used by Topham in the article in Fractal Report No. 19 referred to above.'$INCLUDE: 'complex.bi'



' Program to find roots of z*(z^6-1)=0 using Halley's method

'(see Pickover, p. 276).



SCREEN 9: DEFINT F, K, N



eps = .000001

c1(1) = 1: c1(2) = 0 'c1=1

c5(1) = 5: c5(2) = 0 'c5=5



' INITIALISATION AND SCALING



INPUT "x-limits xmin, xmax"; XMIN, XMAX

INPUT "y-limits ymin, ymax"; YMIN, YMAX

WX = XMAX - XMIN: WY = YMAX - YMIN

PRINT "limits on scale factors:"; INT((640 - 20) / WX); ","; INT((350 - 70) / WY)

INPUT "scale factors fx,fy"; fx, fy

PRINT "limits on graphic resolution (axb):"; WX * fx; ","; WY * fy

INPUT "graphic resolution (a x b points) a,b"; AA, BB

INPUT "no. of iterations kk"; KK

CLS

PRINT "xmin,xmax,ymin,ymax,kk: "; XMIN; XMAX; YMIN; YMAX; KK



' SCANNING THE IMAGE



dx = (XMAX - XMIN) / (AA - 1)

dy = (YMAX - YMIN) / (BB - 1)

FOR nx = 0 TO AA - 1: FOR ny = 0 TO BB - 1

z(1) = XMIN + nx * dx: z(2) = YMIN + ny * dy



' ITERATION OF 3z^7*(7z^6+5)/(7z^6*(4z^6+1)+1)



'intermediate variables as follows:

'w1 =z^2

'w2 =z*w1 =z^3

'w3 =w2*w2 =z^6

'w4 =z*w3 =z^7

'w5 =7*w3 =7*z^6

'w6 =4*w3 =4*z^6

'w7 =3*w4 =3*z^7

'w8 =w5+5 =7*z^6+5

'w9 =w7*w8 =3*z^7*(7*z^6+5) (numerator)

'w10=w6+1 =4*z^6+1

'w11=w5*w10=7*z^6*(4*z^6+1)

'w12=w11+1 =7*z^6*(4*z^6+1)+1 (denominator)

'w13=1/w12 =1/(7*z^6*(4*z^6+1)+1)

'tz =w9*w13=3*z^7*(7*z^6+5)/(7*z^6*(4*z^6+1)+1)



FOR k = 1 TO KK



w1(1) = reMult(z(), z()): w1(2) = imMult(z(), z()) 'z^2

w2(1) = reMult(z(), w1()): w2(2) = imMult(z(), w1()) 'z^3

w3(1) = reMult(w2(), w2()): w3(2) = imMult(w2(), w2()) 'z^6

w4(1) = reMult(z(), w3()): w4(2) = imMult(z(), w3()) 'z^7

w5(1) = 7 * w3(1): w5(2) = 7 * w3(2) '7*z^6

w6(1) = 4 * w3(1): w6(2) = 4 * w3(2) '4*z^6

w7(1) = 3 * w4(1): w7(2) = 3 * w4(2) '3*z^7

w8(1) = reAdd(w5(), c5()): w8(2) = imAdd(w5(), c5()): '7*z^6+5

w9(1) = reMult(w7(), w8()): w9(2) = imMult(w7(), w8()): '3*z^7*(7*z^6+5)

w10(1) = reAdd(w6(), c1()): w10(2) = imAdd(w6(), c1()): '4*z^6+1

w11(1) = reMult(w5(), w10()): w11(2) = imMult(w5(), w10()): '7*z^6*(4*z^6+1)

w12(1) = reAdd(w11(), c1()): w12(2) = imAdd(w11(), c1()): '7*z^6*(4*z^6+1)+1

w13(1) = reInv(w12()): w13(2) = imInv(w12()): '1/(7*z^6*(4*z^6+1)+1)

tz(1) = reMult(w9(), w13()): tz(2) = imMult(w9(), w13()):



'FIND ROOT



d = ABS((z(1) * z(1) + z(2) * z(2) - (tz(1) * tz(1) + tz(2) * tz(2))))

IF d < eps THEN

PSET (20 + nx * fx * dx, 70 + ny * fy * dy), (k MOD 2) * 15

GOTO 100

END IF

z(1) = tz(1): z(2) = tz(2)

NEXT k

100 NEXT ny: NEXT nx

' ENDING



PRINT "Press a key to end"

resp$ = INPUT$(1)




' include file complex.bi for procedure declarations


DECLARE FUNCTION reAdd (u(), v())

DECLARE FUNCTION reMult (u(), v())

DECLARE FUNCTION imAdd (u(), v())

DECLARE FUNCTION imMult (u(), v())

DECLARE FUNCTION reInv (u())

DECLARE FUNCTION imInv (u())




' Module containing procedures for calculating with complex variables


' The 2-dimensional array u() represents a complex variable u = u(1)+iu(2); likewise for v().



DECLARE FUNCTION reAdd (u(), v())

DECLARE FUNCTION reMult (u(), v())

DECLARE FUNCTION imAdd (u(), v())

DECLARE FUNCTION imMult (u(), v())

DECLARE FUNCTION reInv (u(), v())

DECLARE FUNCTION imInv (u(), v())



FUNCTION imAdd (u(), v())

imAdd=u(2)+v(2)

END FUNCTION

FUNCTION imInv (u())

imInv= -u(2)/(u(1)*u(1)+u(2)*u(2))

END FUNCTION

FUNCTION imMult (u(),v())

imMult=u(1)*v(2)+u(2)*v(1)

END FUNCTION

FUNCTION reAdd (u(),v())

reAdd=u(1)+v(1)

END FUNCTION

FUNCTION reInv ((u())

reInv=u(1)/(u(1)*u(1)+u(2)*u(2))

END FUNCTION

FUNCTION reMult (u(),v())

reMult=u(1)*v(1)-u(2)*v(2)

END FUNCTION



' Module containing procedures for calculating with complex variables



' The 2-dimensional array u() represents a complex variable u = u(1)+iu(2); likewise for v().



DECLARE FUNCTION reAdd (u(), v())

DECLARE FUNCTION reMult (u(), v())

DECLARE FUNCTION imAdd (u(), v())

DECLARE FUNCTION imMult (u(), v())

DECLARE FUNCTION reInv (u(), v())

DECLARE FUNCTION imInv(u(), v())



FUNCTION imAdd (u(), v())

imAdd=u(2)+v(2)

END FUNCTION

FUNCTION imInv (u())

imInv= -u(2)/(u(1)*u(1)+u(2)*u(2))

END FUNCTION

FUNCTION imMult (u(),v())

imMult=u(1)*v(2)+u(2)*v(1)

END FUNCTION

FUNCTION reAdd (u(),v())

reAdd=u(1)+v(1)

END FUNCTION

FUNCTION reInv ((u())

reInv=u(1)/(u(1)*u(1)+u(2)*u(2))

END FUNCTION

FUNCTION reMult(u(),v())

reMult=u(1)*v(1)-u(2)*v(2)

END FUNCTION


This page hosted by Get your own Free Home Page
Hosted by www.Geocities.ws

1