
Dragon Curve fractals in LaTeX - JohnHammersley
https://www.overleaf.com/read/msxcdqkpwfjw
======
leni536
Well TikZ/PGF is really capable and "lindenmayersystems" is simply a library
feature. TikZ can even have a custom shading for the Mandelbrot set (page 688.
in [1]). Note that even though it's a baked in TikZ shading it uses a single
function shading PDF element, kind of neat.

[1] [http://ctan.ijs.si/tex-
archive/graphics/pgf/base/doc/pgfmanu...](http://ctan.ijs.si/tex-
archive/graphics/pgf/base/doc/pgfmanual.pdf)

------
DerekL
This is also related to the binary complex number format discussed here:
[https://news.ycombinator.com/item?id=10648847](https://news.ycombinator.com/item?id=10648847)

The set of complex numbers with all zeroes to the left of the radix point
forms a fractal that is two dragon curves joined together:
[https://en.m.wikipedia.org/wiki/Complex_base_systems#Base_.E...](https://en.m.wikipedia.org/wiki/Complex_base_systems#Base_.E2.88.921.C2.B1i)

------
trurl42
Without redundant code:

    
    
      \documentclass[border=3pt]{standalone}
      \usepackage{tikz}
      \usetikzlibrary{lindenmayersystems}
      \begin{document}
      \begin{tikzpicture}[line width=1pt, rounded corners=4pt,
              l-system={
                  rule set={X -> X+YF+,Y->-FX-Y},
                  axiom=FX, angle=90, order=11, step=10pt
              }
          ]
      \foreach \c/\r in {green/0, red/90, blue/180, orange/270}
          \draw[\c, rotate=\r] l-system;
      \end{tikzpicture}
      \end{document}

------
DerekL
It's unreadable on the iPad. The text is gigantic, and it won't let me pinch
to zoom out.

