Dragon Curve
The Basic Formula
The Levy C Curve and the Dragon Curve are closely related. If you recall, the Levy C Curve is formed by consistently folding a line segment in the same direction. Let’s call that clockwise direction RIGHT. To form the Dragon Curve, instead of always folding to the RIGHT, you alternate folding to the RIGHT and to the LEFT.
The Code
As in the Levy C section, the function at the top of the page describes how to use my code to create the Dragon Curve. Note that the main difference between is that now we're using a different pattern. Instead of always folding in the same direction, we are alternating RIGHT and LEFT-hand folds. This is represented by a pattern of [0,1] or [1,0].
You can follow the link below to the function itself. To run the code, simply put the function in your working directory for Matlab. Then, you can copy the function call into the main Matlab interface. Note that you cannot run a function by itself; you must call it from another script. The full code can be found on the "Levy C Curve" page.
Tiling Examples
Folding_Curve_4lines(14,0,[-2.5,2.5],[-2.5,2.5],[0,1],2,'filename1')
Folding_Curve_4lines(14,0,[-2.5,2.5],[-2.5,2.5],[0,1],4,'filename1')