Escape-Time Visualization Method for Language-Restricted Iterated
Total Page:16
File Type:pdf, Size:1020Kb
Escap e-time Visualization Metho d for Language-restricted Iterated Function Systems Przemyslaw Prusinkiewicz and Mark Hammel Department of Computer Science University of Calgary Calgary, Alb erta, Canada T2N 1N4 e-mail: [email protected] From Proceeding of Graphics Interface '92, pages 213{223, May 1992 Held in Vancouver, British Columbia, 11{15 May 1992 Escap e-time Visualization Metho d for Language-restricted Iterated Function Systems Przemyslaw Prusinkiewicz Mark S. Hammel Department of Computer Science University of Calgary Calgary, Alb erta, Canada T2N 1N4 Abstract tends it further to language-restricted iterated function systems, intro duced in [16 ]. They generalize the origi- The escap e-time metho d was intro duced to generate im- nal de nition of IFS's by providing means for restrict- ages of Julia and Mandelbrot sets, then applied to visu- ing the sequences of applicable transformations to a par- alize attractors of iterated function systems. This pap er ticular set. The resulting attractors form a larger class extends it further to language-restricted iterated function than those generated using ordinary IFS's. The de ni- systems (LRIFS's). They generalize the original de ni- tion of an LRIFS leaves op en the mechanism for sequenc- tion of IFS's byproviding means for restricting the se- ing transformations, thus LRIFS's incorp orate the ear- quences of applicable transformations. The resulting at- lier generalizations committed to a particular mechanism, tractors include sets that cannot b e generated using or- such as hierarchical IFS's [4 ], so c systems [1 ], recurrent dinary IFS's. The concepts of this pap er are expressed IFS's [3 ], Markov IFS's [21 ], mixed IFS's [5 ], controlled using the terminology of formal languages and nite au- IFS's [17 ], and mutually recursive function systems [7, 8]. tomata. Several other authors considered similar generalizations without giving them a name. Visualization of the attrac- tors of generalized IFS's has b een addressed by Hart [9], Keywords: fractal, iterated function system, escap e- referring to his earlier results with DeFanti [10 ]. time metho d, graphics algorithm, formal language, nite This pap er is organized as follows. Sections 2 and 3 sum- automaton. marize the background material related to formal lan- guages and iterated function systems. Section 4 presents the escap e-time metho d for IFS's in a way suitable 1. Intro duction for further extensions. Section 5 de nes the language- restricted iterated function systems. The escap e-time Although mathematicians have explored the prop erties metho d is extended to LRIFS's in Section 6. A sp ecial of fractals since the turn of century, they could not visu- case of regular languages is considered and illustrated alize the ob jects of their study without the aid of comput- using examples in Section 7. Section 8 summarizes the ers. Computer graphics made it p ossible to recognize the results. b eauty of fractals, and turned them into an art form [13 ]. Peitgen and Richter [14 ] p erfected and p opularized im- ages of Julia and Mandelbrot sets. Manyofthemwere created using the escap e-time metho d. In its original 2. Formal languages setting, it consisted of testing how fast p oints z outside the attractor divergedtoin nity while iterating function An alphabet V is as a nite nonemptysetof symbols or 2 z ! z + c in the complex plane. The resulting values letters. A string or word over alphab et V is a nite se- were interpreted as colors in a two-dimensional image, or quence of zero or more letters of V , whereby the same let- heightvalues in a \fractal landscap e" [15 , Section 2.7]. ter may o ccur several times. The total numb er of letters The escap e-time visualization metho d was extended from in a word w is called its length, and denoted length(w ). Julia sets to iterated function systems [12 ] by Barnsley [2 ] The word of zero length is called the empty word and and Prusinkiewicz and Sandness [18 ]. This pap er ex- denoted . The concatenation of words x = a a :::a 1 2 m In the literature, an IFS is usually de ned as the pair and y = b b :::b is the word formed by extending 1 2 n hX; Fi. We extend this de nition by sp ecifying the al- the sequence of symbols x with the sequence y , thus phab et V and the lab eling function h to facilitate the xy = a a :::a b b :::b . If xy = w then the word x 1 2 m 1 2 n intro duction of language-restricted IFS's in Section 5. is called the pre x of w , denoted x w . The remaining word y is called the sux.We assume that the relation The function h is extended to words and languages over is re exive, that is, w w . The n-fold concatenation of V using the equations: aword w with itself is called its n-th power, and denoted n 0 w . By de nition, w = for any w . If w = a a :::a , h(a a :::a ) = h(a ) h(a ) ::: h(a ); 1 2 n 1 2 n 1 2 n [ R then the word w = a :::a a is called the mirror im- n 2 1 h(L) = h(w ); R R R age of w . It can b e shown that (xy ) = y x for any w 2L words x and y . where the symbol denotes function comp osition, ? The set of all words over V is denoted by V , and the + set of nonemptywords by V . A formal language over x f f f = f ((f (f (x))) ): 1 2 n n 2 1 an alphab et V is a set L of words over V , hence L ? V . The concatenation and mirror image of words are The attractor of an IFS I is the smallest nonemptyset extended to languages as follows: AX , closed with resp ect to all transformations of F , and closed in the set-theoretic sense. Hutchinson showed L L = fxy : x 2 L & y 2 L g; 1 2 1 2 that the attractor of an arbitrary IFS always exists and R R L = fw : w 2 Lg: is unique [12 ]. Consequently, it can b e found by selecting a p oint P 2A, and applying to it all p ossible sequences A language L is pre x extensible if there exists a word + of transformations from F : v 2 V suchthat vL L. In other words, vw 2 L for every word w 2 L. The right derivative of a language ? A =cl(P h(V )); ? ? L V with resp ect to a word v 2 V is the language: where the symbol cl represents the set-theoretic closure of ? L==v = fw 2 V : vw 2 Lg: the argument set. There are several metho ds for nding the initial p oint P 2A. For example, the xed p ointof The set of all pre xes of a language L is called the pre x any transformation F 2F is known to b elong to A [12 ]. closure of L: A legible notation for sp ecifying transformations is ? P (L)=fx 2 V :(9w 2 L) x w g: needed while de ning particular IFS's. In this pap er we express transformations by comp osing op erations of translation, rotation, and scaling in an underlying Carte- 3. Iterated function systems sian co ordinate system. The following symb ols are used: Let hX; di b e a complete metric space with supp ort X t(a; b) is a translation byvector (a; b). and distance function d (in this pap er, we will only con- a( ) is a rotation by (oriented) angle with resp ect sider the plane with the Euclidean distance). A function to the origin of the co ordinate system. The angles F : X ! X is called a contraction in X if there is a are expressed in degrees. constant r<1 suchthat s(r ;r ) is a scaling with resp ect to the origin of x y d(F (P );F(Q)) rd(P; Q) 0 0 the co ordinate system: x = r x and y = r y . If x y for all P; Q 2 X . The parameter r is called the Lipschitz r = r = r ,we write s(r ) instead of s(r;r). x y constant of F . For example, Figure 1 shows the attractor of an IFS An iterated function system (IFS) in X is a quadruplet I = hX; F ;V;hi, where the set F consists of two trans- I = hX; F ;V;h;i, where: formations: ! p X is the underlying metric space, 2 F = s r (45); 1 F is a set of contractions in X , 2 ! p V is an alphab et of contraction lab els, 2 F = s r (135) t(0; 1): 2 2 h : V !F is a labeling function, taking the letters of alphab et V to the contractions from F . Z 2b Z1 ~ ~ h(b) Z2a h(a) Z2 C O R ||Z 3 || ||Z3b || ||Z3a || ~ h(a) Z The dragon curve Figure 1: ~ 3 h(b) Z3a Z3b 4. The escap e-time metho d res (Z ;a)= res(Z ;b) = 0, since Z 62 C , 1 1 1 ~ res (Z ;a) = 0, since Z h (a)= Z 2C, Consider an IFS I = hX; F ;V;hi, where all functions 2 2 2a ~ F 2F are invertible. Let h(a) denote the inverse of the res (Z ;a) > res(Z ;b), since kZ k < kZ k.