{"id":6,"date":"2008-10-21T22:44:02","date_gmt":"2008-10-21T22:44:02","guid":{"rendered":"http:\/\/hodgestar.za.net\/blog\/?p=6"},"modified":"2008-10-22T08:08:33","modified_gmt":"2008-10-22T08:08:33","slug":"the-dragon-curve","status":"publish","type":"post","link":"http:\/\/hodgestar.za.net\/blog\/2008\/10\/the-dragon-curve\/","title":{"rendered":"The Dragon Curve"},"content":{"rendered":"<p>My <a title=\"H*\" href=\"http:\/\/hodgestar.za.net\/\">front page<\/a> needed something to distinguish it a bit from the sea of internet homepages and the obvious thing was a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Fractal\">fractal<\/a>. After hunting around a little on the <a href=\"http:\/\/en.wikipedia.org\/wiki\/List_of_fractals_by_Hausdorff_dimension\">Wikipedia list<\/a> I opted for the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Dragon_curve\">Dragon Curve<\/a>.<\/p>\n<p>The dragon curve or Heighway dragon is one of the many named space-filling (you can see it has <a href=\"http:\/\/en.wikipedia.org\/wiki\/Hausdorff_dimension\">Hausdorff dimension<\/a> 2 in the list) curves and happens to look quite nice while being slightly less well-known. You can generate it either by recursively adding detail to a straight line (as is often done for the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Koch_curve\">Koch curve<\/a> and <a href=\"http:\/\/en.wikipedia.org\/wiki\/Sierpinski_triangle\">Sierpinski triangles<\/a>) or by taking the limit set of an iterated function system (like for the <a href=\"http:\/\/en.wikipedia.org\/wiki\/Mandelbrot_set\">Mandelbrot set<\/a>).<\/p>\n<p>Of course it would have been a bit boring to just slap up an image, and I felt it would be cool to have something that actually used the refinement algorithm to construct the dragon curve on screen, so with the help of <a href=\"http:\/\/jquery.com\/\">jQuery<\/a> and <a href=\"http:\/\/keith-wood.name\/svgRef.html\">jQuery.svg<\/a>, I made a little Javascript and SVG (sorry, IE users) implementation that performs the first 14 iterations.<\/p>\n<p>The result is <a href=\"http:\/\/hodgestar.za.net\/\">here<\/a> and the Javascript code <a title=\"And the code is actually fairly shiny considering the horrible hacks I did before I found jQuery.svg\" href=\"http:\/\/hodgestar.za.net\/dragon.js\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My front page needed something to distinguish it a bit from the sea of internet homepages and the obvious thing was a fractal. After hunting around a little on the Wikipedia list I opted for the Dragon Curve. The dragon curve or Heighway dragon is one of the many named space-filling (you can see it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[9,11,10,12,13],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-tech","tag-dragon","tag-fractals","tag-heighway","tag-javascript","tag-svg"],"_links":{"self":[{"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":7,"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"predecessor-version":[{"id":8,"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/posts\/6\/revisions\/8"}],"wp:attachment":[{"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hodgestar.za.net\/blog\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}