Dragon curve
The dragon curve is a fractal object that is created similar to the Koch curve and the Hilbert curve by substitution.
Construction
A descriptive method to generate the dragon curve is the following:
- Take a strip of paper and fold it in half so that halved its length.
- This can be repeated any number of times, it is important to ensure that each is folded once in the same direction.
- Finally, you fold the paper apart and arrange it in such a way that the interior angles of the folds be always 90 °.
Algorithm
Lindenmayer system
The dragon curve can be described by a Lindenmayer system with the following properties:
- Angle: 90 °
- Start String:
- Derivation rules:
Pseudocode
For a simplified representation of a dragon curve encoding the symbols R and L is used in the following. The drawing of the dragon curve is rather similar turtle graphics: R represents a 90 ° rotation to the right and L is a 90 ° turn to the left. You start with a line up. Then, after each symbol, a line is drawn in the current direction. So there are in each Dragon curve, a line more than symbols. Using this encoding can be algorithmically a dragon curve how to construct the following:
- The dragon curve 0th order consists only of the start line "upwards".
- The dragon curve 1st order is R ( start line, then turn to the right and another line )
- Compute a dragon curve of order i 1 as follows: Hanging on a dragon curve of order i is an R to
- Hanging on the outcome of the dragon curve of order i, the central character is replaced by L again.
As an example, the encoding of the dragon curve of order 0 to 5 Inset R is printed below in bold, the average character replaced by L in italics.
0 order: ε (the empty string ) 1st order: R 2nd order: RRL 3rd order: RRLRRLL 4th order: RRLRRLLRRRLLRLL 5th order: RRLRRLLRRRLLRLLRRRLRRLLLRRLLRLL Dragon curves of different orders
A dragon curve of order n consists of segments. The following are the first 16 dragon curves:
Dragon curve 1st order
Dragon curve of 2nd order
Dragon curve of 3rd order
Dragons 4th order curve
Dragon curve 5th order
Dragon curve 6th order
Dragon curve 7th order
Dragon curve 8th order
Dragon curve 9th order
Dragon curve 10th order
Dragon curve 11 order
Dragon curve 12 order
Dragon curve to the 13th harmonic
Dragon curve 14 order
Dragon curve 15 order