About fractal procedures

xiaoxiao2021-03-06  40

In the last two, I once turned into fractal, and I realized a Mund Bowl collection fractal program, which could be enlarged. This article is to talk about its algorithms and principles. The specific mathematical idea can be said to be profound, I don't understand it, I can only talk about it here. The algorithm of the fractal program on this site is as follows.

The program algorithm is not difficult, that is, two iterative types, exit iteration after iteration satisfies certain conditions, and then coloring the points on the discipline control according to the different results of the iteration. The worst case I set up is 300 per pixel iterations. If you want to draw 800 × 600 map, it will iterate 800 × 600 × 300 times, and iterately uses the double precision floating point, the amount of calculation is large. . The time complexity of the program is large. However, I haven't reached the time to draw a picture.

It's hard to have its mathematical idea, the biggest feature of fractal is self-similarity. Currently I do just the iteration z → z ^ 2 c (^ represents passenger) on the recipient, which is apparent to X → X ^ 2-Y ^ 2 CX, Y → 2XY CY, obviously infinite It is an attraction, but there is a region near 0, no matter how many iterations, the points can't run this area, this is the Mund Bowl collection (M episode), according to the iterative situation, for each pixel I got a beautiful fractal map.

Usually, the M set is an iterative secondary function: z → z ^ 2 c generated, this function is embodied: x → x ^ 2-y ^ 2 CX, Y → 2XY CY where x ^ 2 is represented The square of x, z = x iy, c = cx icy. The M set is actually an image composed of constant c = (cx, cy). Let C will start changing from the upper left corner of the screen, an increase in progress, which has changed to the lower right corner of the screen. If the area takes 200 multiplied 200, a total of 40,000 points is calculated, and the calculation result is marked with different colors, it is an image, which is the M set (Mund Bowl).

It is easy to know that infinity is definitely an iterative attraction, that is, for the initial conditions on the recipient, iterations eventually run to infinity. But the study found that there is still a strange area near the origin, and this area will never run in the iterative process. From the non-strict sense, the collection of points in this area is the M set. Our task is to draw the boundaries of this collection. In fact, the boundaries are fractal curves, but they are complex, the charm of M setup images is here.

On the completion surface, we use the origin (0, 0) as a reference point, observe whether the iterative process is far from the origin, and the speed of escaping the origin. To this end, a distance function D = x ^ 2 y ^ 2, in fact, there are many different tissues, the above method is the most common. It can be seen that if D is large, it indicates that the iteration point is far from the origin. If D is smaller, it indicates that the iteration point is closer to the origin. Assuming to any one C, iteration is from (X0, Y0) = (0), we observe the iterative point column (x1, y1), (x2, y2), ..., (xn, yn), ... Change status. Calculate the corresponding D value each time (such as D1 corresponds to X1 ^ 2 Y1 ^ 2). Take a reference distance R and may wish to achieve a large, such as R = 40. What is going to do now is that the actual distance D is greater than R. If the D is less than R during iteration, continue to make computer iterations, to specify an iterative upper limit (otherwise it will craze ^ _ ^, because there is already a point set, no matter how it iterate, will not run to infinity , Then his d must have a top world, if D

Simplely said: select point C = (cx, cy) iteration x → x ^ 2-y ^ 2 cx, y → 2xy cy (iterative start point is x0 = (0, 0)) calculate D value D = x ^ 2 y ^ 2 Compare D and R . Note: The absolute value of the iterative point C can not be too large, and the end of the infinity is an attractor. If the point is too big, he must escape to infinity, generally selected near 0.

The fractal is a universal law between the universe. This set is only a manifestation of fractal laws in mathematics. The existence of fractal may be revealed thereby. In fact, there are also fractal characteristics in the law of human life, such as: When a person is organizing a lot of information, it will look at a certain aspect, and it will further surf the information about a problem. Wake up, I found that I originally organized the information, and I returned to the starting point (or may be difficult and returned to the starting point, the reason is uncertain). He then organized a good book, and there was a trend of seeing it. There is similarity every time each link. When people discover this habit, they must develop their goals. Don't be too random, but walking, discovering the goals need to be corrected, constantly correcting, do not know where to go, they will be exactly chaotic. This regular line multi-elephant fracture. The purpose of this program is to illustrate the importance of the algorithm. More importantly, mathematics, mathematics are also beautiful, but it is very abstract, only a few people can understand, and fractal is an intuitive expression of mathematics.

Learning programming cannot be programmed for programming, programming is based on application, programming is also the highest in the United States, whether it is in the algorithm or in the code of code, we all pursue beauty. Only these programming have been realized. But I am also very garbage, this procedure is not at the art, just throwing bricks.

Of course, fractal is an extremely rich mathematical branch, fractal art (non-light fractal, and fractal music and other art works) are also increasingly known and accepted.

At present, my procedure is just a fractal in the fractal, and there is a L Lin system, Julia set, generally joined, real maid, differential equation system, etc..

Of course, I will work hard to do it. The next step is to do, the fractal of the L Lin system, and the problem to solve, I also admit that the current figure is not beautiful, I can't call the art.

keep it up

It's so much better.

(Note: The program is the active code written by Easy language, you can download it on my website, address: http://rockcarry.126.com)

Author: Chen Kai 2004.1.3 All Rights Reserved

转载请注明原文地址:https://www.9cbs.com/read-72882.html

New Post(0)