Skip to content

A simple recursive program for drawing the dragon curve of given depth.

Notifications You must be signed in to change notification settings

riemass/cairo-dragon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dragon curve program

Dragon curve image

This program draws the dragon curve, a plane filling curve, recursively. (there was a dynamic solution at some point but it had 2^(depth) memory complexity, so it's better this way, unless you have memory to spare)

The dragon curve is so awesome Donald Knuth has one made up of tiles in his house.

It's implemented in turtle graphics with cairo, so be shure to have the cairo libs installed.

Running

make
./dragon_curve <depth>

should compile and draw a dragon of given depth in .svg to the dragon.svg file.

Note viewport overflows are not handled.

About

A simple recursive program for drawing the dragon curve of given depth.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published