Difference between revisions of "Turtle spiral"

From JSXGraph Wiki
Jump to navigationJump to search
Line 43: Line 43:
 
   t.cs();
 
   t.cs();
 
}
 
}
 +
run();
 
</jsxgraph>
 
</jsxgraph>
 
</source>
 
</source>

Revision as of 21:23, 1 April 2009


Source code

<jsxgraph width="600" height="600">
var brd = JXG.JSXGraph.initBoard('jxgbox', {originX: 300, originY: 300, unitX: 1, unitY: 1});
var t = brd.createElement('turtle');

function run() {
  brd.suspendUpdate();
  var code = $('inputtext').value;
  if (code=='') { return; }
  eval(code);
  brd.unsuspendUpdate();
}
function clearturtle() {
  t.cs();
}
run();
</jsxgraph>

External links