Turtle animation of the "8": Difference between revisions

From JSXGraph Wiki
(Created page with "<jsxgraph width="500" height="500"> var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox: [-250, 250, 250, -250]}); var t = brd.create('turtle',[100,-50],{strokeOpacity:0.7,fil...")
 
No edit summary
Line 4: Line 4:
t.setPenSize(3);
t.setPenSize(3);
   
   
function run(n) {
var run = function() {
   if (n>0) {
   t.fd(5);
    t.fd(20);
  t.lt(1);
    t.lt(90*(1-n/100));
  setTimeout(run,25);
    var st = 'run(' + (n-1) + ')';
    setTimeout(st,25);
  }
}
}
run();
</jsxgraph>
</jsxgraph>


[[Category:Turtle Graphics]]
[[Category:Turtle Graphics]]

Revision as of 07:35, 28 August 2013