website | twitter

Monday, October 06, 2008

Inspy from Turtle Geometry

Turtle Geometry by Harold Abelson and Andrea diSessa has a lot of interesting examples of turtle graphics. Especially I was fascinated "inspy" program. The basic structure of inspy is same as spiral. But instead of the side, value of the angle is changed in each step. I have explored a bit for a demo of Chalkboard project http://tinlizzie.org/chalkboard/#Inspi.

To make the study easier, I made a trick to connect an event handler and an inspy program. You can play with a dynamic version of inspy program with it (Please move the mouse on next rectangle). And you may find various patterns even from such simple program. Here I present stand alone version (Only Firefox and Safari are supported).

inspy
inspi = function(side, angle, inc) {
  for (var i = 0; i < 720; i++) {
    forward(side)
    right(angle + inc * i)
  }
}
inspi(15, mouseX(), mouseY())
 
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.