<iframe src="https://jsxgraph.org/share/iframe/slow-the-turtle-down" style="border: 1px solid black; overflow: hidden; width: 550px; aspect-ratio: 55 / 65;" name="JSXGraph example: Slow the turtle down" allowfullscreen ></iframe>
<input type="button" value="run" onclick="run(100)"> <div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; "> <div id="board-0" class="jxgbox" style="aspect-ratio: 1 / 1; width: 100%;" data-ar="1 / 1"></div> </div> <script type = "text/javascript"> /* This example is licensed under a Creative Commons Attribution ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/ Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits. */ const BOARDID = 'board-0'; var board = JXG.JSXGraph.initBoard(BOARDID, { boundingbox: [-250, 250, 250, -250], keepaspectratio: true }); var t = board.create('turtle', [100, -50], { strokeOpacity: 0.7, fillColor: '#ff8800', fillOpacity: 0.2 }); t.setPenSize(3); function run(n) { if (n > 0) { t.fd(20); t.lt(90 * (1 - n / 100)); var st = 'run(' + (n - 1) + ')'; setTimeout(st, 25); } } </script>
/* This example is licensed under a Creative Commons Attribution ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/ Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits. */ const BOARDID = 'your_div_id'; // Insert your id here! var board = JXG.JSXGraph.initBoard(BOARDID, { boundingbox: [-250, 250, 250, -250], keepaspectratio: true }); var t = board.create('turtle', [100, -50], { strokeOpacity: 0.7, fillColor: '#ff8800', fillOpacity: 0.2 }); t.setPenSize(3); function run(n) { if (n > 0) { t.fd(20); t.lt(90 * (1 - n / 100)); var st = 'run(' + (n - 1) + ')'; setTimeout(st, 25); } }
<input type="button" value="run" onclick="run(100)">
// Define the id of your board in BOARDID var board = JXG.JSXGraph.initBoard(BOARDID, { boundingbox: [-250, 250, 250, -250], keepaspectratio: true }); var t = board.create('turtle', [100, -50], { strokeOpacity: 0.7, fillColor: '#ff8800', fillOpacity: 0.2 }); t.setPenSize(3); function run(n) { if (n > 0) { t.fd(20); t.lt(90 * (1 - n / 100)); var st = 'run(' + (n - 1) + ')'; setTimeout(st, 25); } }
This example is licensed under a Creative Commons Attribution ShareAlike 4.0 International License. Please note you have to mention The Center of Mobile Learning with Digital Technology in the credits.