Amplification Matrix Iteration Algorithm to Generate the Hilbert Peano Curve
Total Page:16
File Type:pdf, Size:1020Kb
Transactions on Computer Science and Technology June 2014, Volume 3, Issue 2, PP.41-47 Amplification Matrix Iteration Algorithm to Generate the Hilbert-Peano Curve Zhengwen Peng, Xin Lu# Department of Mathematics and Computer Science, Nanchang Normal University, 330032, China #Corresponding author: [email protected] Abstract The methods to construct the Hilbert-Peano curve are recursive and non-recursive; methods of L-grammar system, different methods have different characteristics. In this document, from the prospective of non-recursive to analyze the characteristics of Hilbert-Peano curve, adopt the amplification curve characteristic matrix iteration algorithm constructs the Hilbert-Peano curve, compares the algorithm with the non-recursive algorithm in time-space-consuming. Prove that this algorithm has more advantages on large scale than L-system of non-recursive algorithm. Keywords: Hilbert-Peano Curve; Fractal; Iteration Matrix 1 INTRODUCTION For Euclidean geometry, consider a one-dimensional only line or line segment, the two-dimensional nature belongs to the plane. In 1890, however, mathematicians G.Peano studying G.Cantor set in an attempt to use the curve to fill on the basis of two-dimensional plane, mathematician Hilbert subsequently proved feasible in 1891, and found the famous two-dimensional Hilbert-Peano plane filling curve [1], as shown in Fig. 1. FIG. 1 THE HILBERT-PEANO CURVE GENERATED ITERATION 3 TIMES In environment at that time, mathematicians realized plane filling curve for just stay on the level of questioning curiosity, thought by the seemingly simple structure of the line can constitute a complex curve, and uninterrupted don't repeat to fill the whole plane, that curve was of no use Euclidean geometry to explain and measure it, more can't imagine after one hundred will be widely used in computer graphics, image processing technology. Such can not use Euclidean space to measure the curve was Mandelbrot particular meaning for fractal geometry [1]. The introduction of fractal theory to solve the proposed many years mathematicians can't use Euclidean geometry to solve the problem. Although there is no unified definition of fractal and its structure characteristics is clear, that is to analyze the structure has the infinite self-similarity, and the Hilbert-Peano plane filling curve, obviously is a kind of typical fractal structure. The nature of the Hilbert-Peano plane filling curve: (1) when the basic line of line length tend to zero, the curve will be covered with flat; (2) the curve have a starting point and end point, curve of disjoint forever; (3) the curve of the number of iterations is not generated at the same time with fine self-similarity structure; (4) curves are connected by a simple line of the same length; - 41 - http://www.ivypub.org/cst In theory, the basic element of the Hilbert-Peano curve length tends to zero when the length is infinitely long, thus complete the Hilbert-Peano curve cannot be mapped out, use the computer to draw the Hilbert-Peano curve, because screen resolution and the limitation of human eye vision, can only draw the curve of the line length is greater than 1 pixel. The article does not discuss the theoretical basis of the curve, mainly on the question from the analysis of characteristics of the Hilbert-Peano form only an amplification curve characteristic matrix iteration algorithm to map the Hilbert-Peano curve. Now generate the Hilbert-Peano curve methods mainly include recursive method, L-grammar system, a recursive method, etc. The recursive algorithm described as follows [2,3]: Step 1: set the recursion depth n. Step 2: determine the scope of the curve, Step 3: to the initial square quarters, and its length is 2 n equal; Step 4: calculate the center of small square as a curve segment load-point coordinates; Step 5: according to the curve feature called recursive algorithm draw curves; Commonly used as L - system generated rules describe the Hilbert-Peano curve generation process [3,4,5]: Variables: L, R Constant: F, +, - The starting point: L Generate rules: L -RF + LFL + FR - R + LF - RFR FL + F: forward painting line - : right turn 90 ° + : left turn 90 ° Through continued iteration L, R to generate the Hilbert curve - Peano curves. On the basis of L - system an improved evolutionary algorithm is proposed[6]. According to the literature data, the algorithm is obviously speed than the recursive algorithm and L - system generation algorithm, In addition, Lin ShenYi from Feng Chia University of Taiwan using tensor product, to draw the Hilbert-Peano curve[7]. 2 Related Work In this paper, through the analysis of the Hilbert-Peano curve characteristics put forward a kind of based on amplification curve characteristic matrix iteration algorithm to generate the Hilbert-Peano curve. 2.1 Split the Hilbert-Peano Curve Observe the Hilbert-Peano curve, found that the curve graphics essentially generated by four basic elements, according to certain rules generated by four basic elements generate corresponding elements connected curve, the subsequent content with a, b, c, d respectively identified that the four basic elements generate graphics, as shown in Fig. 2. FIG. 2 BASIC GENERATED ELEMENTS - 42 - http://www.ivypub.org/cst 2.2 Iterative Matrix Hilbert-Peano curve generating element is simple, but because of its characteristics as the growth of the number of iterations, the number of generated elements with two exponential growth, the number of iterations tends to infinity (segment length tends to 0) curve will traverse the area within the scope of the all points, obviously graphics was too complicated to use a computer simulation. According to the curve of each iteration characteristic, this article uses the amplification of iterative matrix to describe curve generation process. The generator according to the curve characteristics of the four of the first iteration, in turns, as shown in Fig.3. FIG. 3 (a-d) FOUR TYPES OF ITERATION If the (a), (b), (c),(d) four generation element iterative transformation according to the type (a) structure ,and placed in a square which composed of 16 smaller squares, let to the end of each line is located in the center of the corresponding smaller square, we can get the following 2*2 matrices: Same for (b), (c), (d) figure in accordance with the Hilbert-Peano curve, in turn, can get the corresponding matrix. Use of (a) generator matrix iteration rules above the second iteration to get 4*4 matrix, the third iteration will get 8 x 8 matrix, each iteration are get a matrix of more than four times the last time, the n-th iteration might get a 2n*2n matrix. Visible, iterative n times generated is not the Hilbert-Peano curve, but a basic generated by 2 n x 2 n elements ((a), (b), (c), (d)) generated by four basic elements of the curve of the set, and the curve is discrete. The following content is to discuss how to connect to the discrete curve to form the Hilbert-Peano curve. 2.3 The Connection between the Generated Elements According to the characters of the Hilbert-Peano curve, the curve there is only one entrance and only one export, apparently finish or repeated traversal area must demand curve continuous at all points. By the n iteration times of Hilbert-Peano curve after converted to a 2n*2n iterative matrix according to the above iteration rules, each generated element directly mapped and can't get a continuous Hilbert-Peano curve, because the matrix of each generated element is discrete, not continuous. By the curve fractal characters, that is, a fractal structure of unlimited fine, you can see that the continuity of the initial generation elements determines the subsequent iterations of the continuity of each element. It is obvious that generated the n-th (n>1) iteration of the Hilbert-continuity between the Peano curve generated elements generated by n - 1 iteration elements the continuity of the decision. - 43 - http://www.ivypub.org/cst For (a) if the initial generation element, from left to right, depending on the type (a) the characteristics of continuous (graphics opening facing down), the left line, the upper part of the line segment and the right line continuously, therefore, the first iteration of the resulting matrix, where the first row 0, column 0, the first one of the two adjacent elements to generate continuous, and the element of row 1 two generated disconnect. Actually guarantee the continuity of drawing is looking for direction along the curve plotting on the next generation of elements (adjacent element). How to determine the position of the element in the next, obviously is the key to the problem. Determine the adjacent generation element, we must first determine a generating element of the drawing direction, according to the Hilbert-Peano curve feature that is easy to determine the direction of each drawing elements and generated elements generated by the initial drawing direction. (a) type of paper used in the program as an initial forming element-forming element, the drawing direction of the drawing from left to right, i.e. starting point of the left and right end point of the end point, in this drawing, the drawing direction of (b), (c), (d) type generated element followed by: from right to left, top to bottom, from bottom to top. Iterative process to record the transmission continuity in an iterative process using the matrix, the matrix is called an Iterative Continuous Matrix (ICM). Fig.4 shows the continuity of the matrix elements of each generation after the first iteration generated. Where: RIGHT: right next to draw a generating element LEFT: draw a next generation element left DOWN: draw a next generation element down UP: The next generation of elements drawing up EXIT: as the last generation element FIG.