Turtle spiral: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<html> | <html> | ||
<form><textarea id="inputtext" rows=5 cols=35 wrap="off" style="width:600px;">for (var i=0;i< | <form><textarea id="inputtext" rows=5 cols=35 wrap="off" style="width:600px;">for (var i=0;i<1000;i++){ | ||
t.forward(i*0.5); | t.forward(i*0.5); | ||
t.left( | t.left(71); | ||
} | } | ||
</textarea><br /> | </textarea><br /> |
Revision as of 20:22, 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();
}
</jsxgraph>
- Hints how to "Slow the turtle down"