Dragon Curve is a member of fractal curves. This fractal curve is iterative, which can be approximated with recursion. This makes Dragon Curve an interesting mathematical and computer science problem.
It consists of self-similar axioms forming into unfolded fractals reminding a figure of the Dragon, therefore the name "Dragon Curve". It can be seen in the real world, recursively folding a paper ribbon. Although, the shape of the Dragon is not as clearly visible as it is possible with the computer graphics.
It was first discovered by NASA physicists John Heighway. So originally it Dragon Curve is called Harter–Heighway dragon or even Jurassic Park dragon, because it was introduced in the book visualization by Michael Crichton in his famous novel. Heighway's work was published in Scientific American, Mathematical Games in 1967 based on papers by Chandler Davis and Donald Knuth.
Each iteration is more complex than the previous one. Dragon Curve start as a line segment, which is always duplicated and rotated by 45 degrees to the right or left. Because of this, it is an ideal problem for having some fun with recursions instead of Fibonacci numbers that is notoriously explained everywhere. A very nice bonus is that as it is fractal, it has its own visually appealing representation.
There are many other variants of the Dragon Curve, such as Lévy Dragon, Terdragon, or Twindragon. Unfortunately, it goes beyond the scope of this repository.
This code aims to present an alternative of recursive tasks compared to commonly used examples in computer science. It is written in the object-oriented paradigm of C++ programming language and SFML
OpenGL library for drawing objects on the screen.