Fibonacci spiral

Here are my whiteboard plans for drawing the Fibonacci spiral. The main issues were figuring out the x and y positions of each of the squares. I knew that I would need a loop that iterates around North, West, South and East directions anti-clockwise.

Once those x and y positions were figured out, it was easy to code this up in JavaScript:

Here is the JavaScript running to draw the spiral:

This entry was posted in programming and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.