Random points

From JSXGraph Wiki
Revision as of 14:10, 7 December 2008 by A WASSERMANN (talk | contribs) (New page: <html> <link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" /> <script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/pro...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<html> <link rel="stylesheet" type="text/css" href="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraph.css" /> <script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/prototype.js"></script> <script type="text/javascript" src="http://jsxgraph.uni-bayreuth.de/distrib/jsxgraphcore.js"></script> <form><input type='button' value="Next iteration" onClick="run();"></form>

<script language="JavaScript">

       board = JXG.JSXGraph.initBoard('box', {originX: 10, originY:390 , unitX:380 , unitY: 380});
               
       var level = 0;
       function run() {
           JXG.JSXGraph.freeBoard(board);        
           board = JXG.JSXGraph.initBoard('box', {originX: 10, originY: 390, unitX: 380, unitY: 380});            
           for (var i=0;i<1000;i++) {
               var p = board.createElement('point',
                      [Math.random(),Math.random()],{style:5});
           board.unsuspendUpdate();
       }