You would find at chapter one, for instance, the following: In Jurassic Park, at each chapter heading, there is a fractal. Thus the cheaper algorithm in pseudo-code follows: Now the first part and the last part of the iteration differs only by one turn. Last n = First n-1 + "R" + Last n-1 // Left turn becomes right turn, etc. Program has to create a stack of turns before it can draw a path backwards.Ī cheaper way of calculating the second part can be derived from further expanding the equation: If a computer program was to draw this as described above, drawing the second half would be expensive because the The first half involves drawing the previous iteration, the second half involves drawing the first image backwards,Īnd every right turn becomes a left turn and vice versa. (apostrophe means traverse the path backwards.)īasically what these equations mean is that A) the first iteration is just a straight path with no turning, andī) in further iterations, drawing the image involves drawing the first half, making a 90° rotation (a left turn in this case), and then drawing the second half. Iteration 0 Iteration 1 Iteration 2 Iteration 3 The rotation can be either clockwise or counter-clockwise, as long as it is consistant throughout all other iterations. So that the copy is a 90° rotation of the first image, rotated about the finish point of the previous image. Step 2: Starting at the finishing point of that image, draw a copy of that image Step 1: Draw the previous iteration from start to finish. Some interesting facts about this fractalĪppears several times in the book " Jurassic Park". The dragon fractal is a path that doubles in length, and the distance from start to finish grows by a multiple of 2^.5 for every new iteration.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |