Orbital Fractals 1.1 by Jesse Jones ABOUT THIS FILE This file describes what I call "orbital" fractals. This includes both dynamical systems and IFS fractals. In both cases an initial seed point is chosen. This seed is then fed into a formula which returns a new point. The new point is plotted and then it is fed into the formula. This process can continue indefinitely or for a user specified number of points. Color can be added using the number of times a point has been "hit", by the modulus of the number of points, by the distance from the last point, etc. All these fractals have been implemented in a Mac program called Mandella. DRAWING ORBITAL FRACTALS An example of a procedure that could be used to draw a dynamical system is given below. Note that the formula is iterated ten times before any points are plotted. This allows the points to reach the systems attractor. VAR Bounds: Rect; (* Window dimensions in pixels *) MinPt : Complex; (* minimum values for pt.r and pt.i *) MaxPt : Complex; (* maximum values for pt.r and pt.i *) Counts: ARRAY; (* 2D array holding number of times pt was hit *) a, b : REAL; (* user specified constants *) c, d : REAL; (* more constants *) PROCEDURE DoHenon (x, y: REAL): Complex; VAR new: Complex; BEGIN new.i := x*b + (y - x*x)*a new.r := x*a - (y - x*x)*b RETURN new; END DoHenon; PROCEDURE DrawOrbits (seed: Complex; noPoints: LONGINT); VAR pt : Complex; delta : Complex; h, v : INTEGER; counter: LONGINT; BEGIN pt := seed; delta.r := (MaxPt.r - MinPt.r)/FLOAT(Bounds.right - Bounds.left); delta.i := (MaxPt.i - MinPt.i)/FLOAT(Bounds.bottom - Bounds.top); FOR counter := 1 TO noPoints+10 DO pt := DoHenon(pt.r, pt.i); IF counter > 10 THEN IF GoodReal(MinPt.r, pt.r, MaxPt.r) THEN IF GoodReal(MinPt.i, pt.i, MaxPt.i) THEN h := ROUND((pt.r - MinPt.r)/delta.r); v := ROUND((MaxPt.i - pt.i)/delta.i); INC(Counts[h, v]); MoveTo(h, v); Plot(h, v, Counts[h, v]); (* color using number of hits *) END; END; END; END; END DrawOrbits; Many of the fractals listed below look better if multiple orbits are plotted. For example Henon looks best with say fifteen orbits. Popcorn is usually drawn with every point in the window used as a seed. Mandella provides three ways to control how orbital fractals are drawn: Point: the user either types in a seed point or selects a point in the window using the mouse. The number of points to be plotted can also be entered. Line: the user either types in the first and last seeds or he draws a line in the window using the mouse. The user can also enter the number of seeds to use and the number of points per orbit. Grid: a grid of points within the window are used as seeds. The user specifies the grid width in pixels and the number of points per orbit. FORMULAS Hopalong IF x < 0 THEN newX := y + Sqrt(ABS(b*x - c)) ELSE newX := y - Sqrt(ABS(b*x - c)) END; newY := a - x Hopalong2 newX := y - Sin(x) newY := a - x Hopalong3 newX := y - Sin(a*x) newY := x - Cos(b*y) Henon newY := x*b + (y - x^2)*a newX := x*a - (y - x^2)*b Henon2 newX := 1 + y - a*x^2 newY := b*x Pickover newX := x - a*f(y) newY := y + a*f(x) where f(x) = sin(x + sin(3*x)) Pickover2 newX := x - a*f(y) newY := y + a*f(x) Sin(x) ABS(x) <= PI where f(x) = Sin(x + (Sin(3*x))^2) ABS(x) >= 2*PI Sin(x*x + Sin(3*x)) otherwise Popcorn newX := x - a*f(y) newY := y - a*f(x) where f(x) = Sin(x + Tan(3*x)) Gingerman newX := 1 - y + a*ABS(x) newY := x Ikeda temp := a - c/(1 + x^2 + y^2) newX := d + b*(x*Cos(temp) - y*Sin(temp)) newY := b*(x*Sin(temp) + y*Cos(temp)) IFS FRACTALS Iterated Fractal Systems are an interesting and powerful method for generating fractals. Much of Barnsley's book [1] is devoted to them. IFS fractals can often reproduce real world objects. In fact Barsnley is working on an image compression scheme where IFS fractals represent different parts of the image. In an IFS fractal we start with a point and randomly select one of several formulas that move the point. When these points are plotted we find that they converge onto an attractor. This attractor is the fractal itself. The formulas used are of the form: newX := a[k]*x + b[k]*y + e[k] newY := c[k]*x + d[k]*y + f[k] where k indicates the specific formula. The fractal can be represented in tabular format if we let w be the formula number and p the probability that that formula will be used. Some examples follow: Sierpinski Triangle w a b c d e f p 1 0.5 0 0 0.5 1 1 0.33 2 0.5 0 0 0.5 1 50 0.33 3 0.5 0 0 0.5 50 50 0.34 Fern w a b c d e f p 1 0 0 0 0.16 0 0 0.01 2 0.85 0.04 -0.04 0.85 0 1.6 0.85 3 0.2 -0.26 0.23 0.22 0 1.6 0.07 4 -0.15 0.28 0.26 0.24 0 0.44 0.07 Tree w a b c d e f p 1 0 0 0 0.5 0 0 0.05 2 0.42 -0.42 0.42 0.42 0 0.2 0.4 3 0.42 0.42 -0.42 0.42 0 0.2 0.4 4 0.1 0 0 0.1 0 0.2 0.15 CHANGES 1.1 1) Added Hopalong3 formula. 1.0 1) First version uploaded. REFERENCES [1] Barnsley, Michael. Fractals Everywhere Academic Press Inc. ISBN 0-12-079062-9. This is an excellent text book on fractals. This is probably the best book for learning about the math underpinning fractals. He also spends a lot of time on IFS fractals. [2] Dewdney, A.K. The Armchair Universe. New York: W.H. FreeMan and Company. ISBN 0-7167-1928-X. This book is a collection of Dewdney's Scientific American articles. It includes the original Mandelbrot article [2] and an article and the "wallpaper" article describing a dynamical system called "Hopalong". [3] Mandelbrot, Benoit. The Fractal Geometry of Nature. New York: W.H. FreeMan and Company. ISBN 0-7167-1186-9. In this book Mandelbrot attempts to show that reality is fractal-like. He also has pictures of many different fractals. [4] Peitgen, H.O. and Richter, P.H. The Beauty of Fractals New York: Springer-Verlag Inc. ISBN 0-387-15851-0. Lots of neat pictures. There is also an appendix giving the coordinates and constants for the color plates and many of the other pictures. [5] Edited by Peitgen, Heinz-Otto and Saupe, Deitmar. The Science of Fractal Images New York: Springer-Verlag. This book was reviewed in the December 1988 Byte. It is based on a short course presented at SIGGRAPH '87. It contains many color and black and white photographs, high level math, and algorithms for things like continuous potential and 3D transforms. [6] Pickover, Clifford. Computers, Pattern, Chaos and Beauty. New York: St. Martins Press. ISBN 0-312-04123-3. This is a great book with a wide variety of fun things to do with computer graphics. It includes biomorphs, composite formula fractals, Halley fractals, and dynamical systems. [7] Stevens, Roger. Fractal Programming in C M&T Publishing. ISBN 1-55851-038-9 This is a good book for a beginner who wants to write a fractal program. Half the book is on fractal curves like the Hilbert curve and the von Koch snow flake. The other half covers the Mandelbrot, Julia, Newton, and IFS fractals. Unfortunately Stevens has virtually nothing on advanced features. ADDRESS Jesse Jones Usenet: jesjones@milton.u.washington.edu CServe: 73627,152 ¨¨^¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶ÛOrbital FractalsaTEXTMPS TEXTMPS ÿÿÿÿ£N ×!Cm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Ûm¶Û