### Nonrecursive fractal

A Koch snowflake.

CC-BY-SA Wikimedia Commons While thinking about the Koch snowflake it occurred to me that a recursive algorithm to generate one side of the curve would be trivial, but a

CC-BY-SA Wikimedia Commons While thinking about the Koch snowflake it occurred to me that a recursive algorithm to generate one side of the curve would be trivial, but a

*non*-recursive algorithm is pretty simple as well, although it took a lot of thought on my part to get it to work. I don't claim to be an expert at algorithms but I'm pleased when I can figure something out. Here's what I came up with. Your browser does not support the HTML5 canvas tag.Fractal order:**←**0**→**(click the arrows) The idea is to start out with the smallest generator unit, calculating its size by scaling per the length of the parent segments, and accumulating the rotation angles. Then draw the generator unit at that scale and rotation. Repeat for the total number of smallest generator units, which would be the number of segments in the unit to the power of (fractal order − 1).Here's the code including the graphics scaling. // display initialization and scaling var c = document.…