fractal-garden icon indicating copy to clipboard operation
fractal-garden copied to clipboard

Add Dragon Curve

Open trebeljahr opened this issue 2 years ago • 0 comments

Description

Implement the L-System version of the Dragon Curve. Ideally there would be L-Systems for the Dragon, Twindragon and Terdragon! Wikipedia has instructions for each :)

Inspiration

Wikipedia - Dragon Curve

Type

L-System

Difficulties

Centering the L-System is a little bit difficult, since with each iteration it rotates some more. L-System configuration is easy though:

const dragonCurve = {
  maxIterations: 18,
  axiom: "F",
  replace: {
    F: "F+G",
    G: "F-G",
  },
  angle: 90,
};

trebeljahr avatar Sep 29 '22 19:09 trebeljahr