Journal of Electrical Engineering 4 (2016) 150-155 doi: 10.17265/2328-2223/2016.03.005 D DAVID PUBLISHING
Real-Time Tool for Affine Transformations of Two Dimensional IFS Fractal
Elena Hadzieva and Marija Shuminoska University of Information Science and Technology “St. Paul the Apostle”, Ohrid 6000, Macedonia
Abstract: This work introduces a novel tool for interactive, real-time affine transformations of two dimensional IFS fractals. The tool uses some of the nice properties of the barycentric coordinates that are assigned to the points that constitute the image of a fractal, and thus enables any affine transformation of the affine basis, done by click-and-drag, to be immediately followed by the same affine transformation of the fractal. The barycentric coordinates can be relative to an arbitrary affine basis of , but in order to have a better control over the fractal, a kind of minimal simplex that contains the fractal attractor is used.
Key words: IFS, fractal, affine transformation, barycentric coordinates, real-time tool.
1. Introduction can be shown that if the hyperbolic IFS ; , ,…, with the contractivity factor is One of the simplest ways of creating fractals is by given, then the transformation defined on , means of IFSs (iterated function systems). Generally, by the IFS can be defined on any complete metric space, but for the purposes of this paper we will restrict our , discussion to the two-dimensional real space . In is a contraction mapping with the contractivity factor . this section we will go through the basic definitions, According to the fixed-point theorem, there exists a given in Refs. [1, 2]. The transformation defined on unique fixed point of , , called the of the form attractor of the IFS, that obeys · lim , for any . (Note that there where is 2 × 2 real matrix and is a ∞ are weaker conditions under which the attractor of an two-dimensional real vector, is called a IFS can be obtained—the IFS need not to be (two-dimensional) affine transformation. The finite set contractive, see Ref. [3]) of affine contractive transformations, , ,…, Two algorithms are used for the visualization of an with respective contractivity factors , 1,2, … , IFS attractor, deterministic and random (the last is also together with the Euclidean space , is called called chaos game algorithm). In this paper we (hyperbolyc) IFS (iterated function system). Its construct the images of the attractors with the second, notation is ; , ,…, and its contractivity which is known for its fast generation of fractals [1, 4]. factor is , 1,2, … , . Since , Our primary target in this paper will be fractal is a complete metric space, such is , , attractors, since, to the best of our knowledge, there is where , is the space of nonempty no interactive, real-time tool for their modeling. compact subsets of , with the Hausdorff metric The rest of the paper is organized in four sections: derived from the Euclidean metric 1 . It Related Work, Theoretical Grounds of the Tool, The
Corresponding author: Elena Hadzieva, Ph.D., associate Tool and its Application, Conclusions and Future professor, research fields: dynamical systems, fractals, applied Work. mathematics in engineering. Real-Time Tool for Affine Transformations of Two Dimensional IFS Fractal 151
2. Related Work area that contains the attractor and whose catheti are parallel to the and axes). In Ref. [12] the authors Barnsley et al. [4, 5] define the fractal prove a theorem for existence and uniqueness of such transformation as mapping from one attractor to minimal canonical simplex. It is the limit of the Cauchy another, using the “top” addresses of the points of both sequence of the minimal simplexes of the -th attractors and illustrate the application in digital preattractor when approaches to infinity, in the imaging. Although not user-friendly, not real-time and complete metric space , . The -th not continuous (they are continuous under certain preattractor in this paper is defined as the set obtained conditions), these transformations, have a lot of after iterations of the chaos game algorithm. potential for diverse applications. In Ref. [6] the coordinates of the points that compose the fractal 3. Theoretical Grounds of the Tool image are determined from the IFS code and then the Barycentric coordinates of points (and vectors) IFS code is modified to obtain translated, rotated, promote global geometrical form and position rather scaled or sheared fractal attractor, or attractor than exact coordinates in relation to the origin/axes. transformed by any affine transformation as the Thus, the geometric design done by the use of composition of aforementioned transformations. To barycentric coordinates can be called coordinate-free make a new transformation, another IFS code has to be geometric design. constructed. In Ref. [7], Darmanto et al. show a method The set of the three points , , is said to be for making weaving effects on tree-like fractals. They affine basis of the affine space of points if the set make a local control of the “branches” of the tree, by , is a vector base of , observed as a vector changing a part of the IFS code. The control over the space [13, 14]. We say that the point has change of the attractor depends on the experience of the barycentric coordinates , , relative to the basis user for predicting how the modification of the , , , where 1, and we write coefficients in the IFS code will change the tree-like (1) fractal. Compared to the methods for transforming if and only if one of the following three equivalent fractals in the cited papers, our tool is user-friendly and conditions holds: the transformations of fractals are visible in real time. It enables a continuous affine transformation of an arbitrary IFS attractor. The idea for modeling fractals, i.e. their predictive, We will give the relations between the barycentric continuous transformation, where barycentric coordinates relative to the given basis , , and coordinates are involved, is exposed in Refs. [8-10], by the rectangular coordinates of an arbitrary point from means of, so-called AIFS (Affine Invariant Iterated . Suppose that the arbitrary point and the three Function Systems). The IFS code is transformed into basis points , and have rectangular coordinates AIFS code which involves barycentric coordinates. , , , , , and , , respectively. The method that we propose is also based on Then the relation Eq. (1) can be rewritten in the barycentric coordinates, but no transformation of the following form IFS code is needed. , (2) Also, Kocic et al. in Ref. [11] propose the use of, so called minimal canonical simplex, for better control of or, in matrix form the attractor (for 2D case, minimal canonical simplex is . the isosceles right-angled triangle with the minimal
152 Real-Time Tool for Affine Transformations of Two Dimensional IFS Fractal
By rearranging the last matrix equation, we obtain coordinates to affinly transform the IFS fractal. more suitable form for further manipulations: 4. The Tool and Its Application . (3) Our real time, user-friendly tool is written in C# 1 111 The relation (3) defines the conversion of the programming language using the Visual Studio 2013. It barycentric coordinates relative to the affine basis allows both on-click definition of the triangle (affine , , into the rectangular coordinates. Let us basis) and definition by specifying the triangle’s denote the 3 x 3 matrix by T to indicate “triangle”. The vertices directly in the code, with their rectangular inverse conversion can be easily gotten, by simple coordinates. Once the affine base is defined, the image multiplication of Eq. (3) by the inverse of T (which of the fractal is created (relative to the triangle) and exists, since , , is an affine basis). That is, the ready for transformation. conversion of the rectangular coordinates into the Triangle’s vertices are moved by drag and drop barycentric coordinates relative to the basis , , option of the cursor. When the cursor is placed over the is defined by the relation vertices, it has a “hand” shape, otherwise its shape is “cross”. The affine transformations of the triangle, · , (4) immediately followed by the same affine 1 which after calculating the inverse of T, can be transformation of the fractal image, are visible in real expressed in its explicit form, time, in the coordinate system of the window. We will show the superiority of our tool on two examples of fractal attractors, the so called “flower” and “maple”. In order to get clearer image of the · , (5) attractor, we neglect the first 14 points and start to plot 1 from the 15-th and end with 20,000-th point. where det Note that, by default, the origin of the coordinate