Difference between revisions of "Random walks"

From JSXGraph Wiki
Jump to navigationJump to search
Line 21: Line 21:
 
<input type="button" value="run" onClick="run()">
 
<input type="button" value="run" onClick="run()">
 
<input type="button" value="clear" onClick="clearturtle()">
 
<input type="button" value="clear" onClick="clearturtle()">
 +
<input type="text" value="" id="output">
 
</form>
 
</form>
 
</html>
 
</html>
Line 43: Line 44:
 
     t.home();
 
     t.home();
 
   }
 
   }
   alert(sumdist);
+
   $('output').value = sumdist.toFixed(3);
 
   brd.unsuspendUpdate();
 
   brd.unsuspendUpdate();
 
}
 
}
 
function clearturtle() {
 
function clearturtle() {
 +
  sumist = 0.0
 
   t.cs();
 
   t.cs();
 
}
 
}

Revision as of 19:26, 26 May 2009

Number of random walks:

Source code

<jsxgraph width="600" height="600">
</jsxgraph>

External links

  • []