// Define the id of your board in BOARDID
// User supplied function to be plotted
var f = (x) => Math.sin(x);
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-5, 2, 5, -2],
axis: true,
keepaspectratio: false
});
var start = -4,
end = 4,
x = start,
step = 0.2,
turtle = board.create('turtle', [x, f(x)]);
var moveForward = function() {
x += step;
if (x > end) {
return;
}
turtle.moveTo([x, f(x)]);
setTimeout(moveForward, 200); // delay by 200 ms
};
turtle.hideTurtle(); // Hide the turtle arrow
moveForward(); // Start the drawing
This example is licensed under a Creative Commons Attribution 4.0 International License.
Please note that you have to mention The Center of Mobile Learning with Digital Technology in the credits.
/*
This example is licensed under a
Creative Commons Attribution 4.0 International License.
https://creativecommons.org/licenses/by/4.0/
Please note that you have to mention
The Center of Mobile Learning with Digital Technology
in the credits.
*/
const BOARDID = 'your_div_id'; // Insert your id here!
// User supplied function to be plotted
var f = (x) => Math.sin(x);
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-5, 2, 5, -2],
axis: true,
keepaspectratio: false
});
var start = -4,
end = 4,
x = start,
step = 0.2,
turtle = board.create('turtle', [x, f(x)]);
var moveForward = function() {
x += step;
if (x > end) {
return;
}
turtle.moveTo([x, f(x)]);
setTimeout(moveForward, 200); // delay by 200 ms
};
turtle.hideTurtle(); // Hide the turtle arrow
moveForward(); // Start the drawing
<div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; ">
<div id="board-0" class="jxgbox" style="aspect-ratio: 10 / 4; width: 100%;" data-ar="10 / 4"></div>
</div>
<script type = "text/javascript">
/*
This example is licensed under a
Creative Commons Attribution 4.0 International License.
https://creativecommons.org/licenses/by/4.0/
Please note that you have to mention
The Center of Mobile Learning with Digital Technology
in the credits.
*/
const BOARDID = 'board-0';
// User supplied function to be plotted
var f = (x) => Math.sin(x);
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-5, 2, 5, -2],
axis: true,
keepaspectratio: false
});
var start = -4,
end = 4,
x = start,
step = 0.2,
turtle = board.create('turtle', [x, f(x)]);
var moveForward = function() {
x += step;
if (x > end) {
return;
}
turtle.moveTo([x, f(x)]);
setTimeout(moveForward, 200); // delay by 200 ms
};
turtle.hideTurtle(); // Hide the turtle arrow
moveForward(); // Start the drawing
</script>
<jsxgraph width="100%" aspect-ratio="10 / 4" title="Function plot animation" description="This construction was copied from JSXGraph examples database: https://jsxgraph.org/share/" useGlobalJS="false">
/*
This example is licensed under a
Creative Commons Attribution 4.0 International License.
https://creativecommons.org/licenses/by/4.0/
Please note that you have to mention
The Center of Mobile Learning with Digital Technology
in the credits.
*/
// User supplied function to be plotted
var f = (x) => Math.sin(x);
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-5, 2, 5, -2],
axis: true,
keepaspectratio: false
});
var start = -4,
end = 4,
x = start,
step = 0.2,
turtle = board.create('turtle', [x, f(x)]);
var moveForward = function() {
x += step;
if (x > end) {
return;
}
turtle.moveTo([x, f(x)]);
setTimeout(moveForward, 200); // delay by 200 ms
};
turtle.hideTurtle(); // Hide the turtle arrow
moveForward(); // Start the drawing
</jsxgraph>
/*
This example is licensed under a
Creative Commons Attribution 4.0 International License.
https://creativecommons.org/licenses/by/4.0/
Please note that you have to mention
The Center of Mobile Learning with Digital Technology
in the credits.
*/
const BOARDID = 'your_div_id'; // Insert your id here!
// User supplied function to be plotted
var f = (x) => Math.sin(x);
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-5, 2, 5, -2],
axis: true,
keepaspectratio: false
});
var start = -4,
end = 4,
x = start,
step = 0.2,
turtle = board.create('turtle', [x, f(x)]);
var moveForward = function() {
x += step;
if (x > end) {
return;
}
turtle.moveTo([x, f(x)]);
setTimeout(moveForward, 200); // delay by 200 ms
};
turtle.hideTurtle(); // Hide the turtle arrow
moveForward(); // Start the drawing
<div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; ">
<div id="board-0" class="jxgbox" style="aspect-ratio: 10 / 4; width: 100%;" data-ar="10 / 4"></div>
</div>
<script type = "text/javascript">
/*
This example is licensed under a
Creative Commons Attribution 4.0 International License.
https://creativecommons.org/licenses/by/4.0/
Please note that you have to mention
The Center of Mobile Learning with Digital Technology
in the credits.
*/
const BOARDID = 'board-0';
// User supplied function to be plotted
var f = (x) => Math.sin(x);
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-5, 2, 5, -2],
axis: true,
keepaspectratio: false
});
var start = -4,
end = 4,
x = start,
step = 0.2,
turtle = board.create('turtle', [x, f(x)]);
var moveForward = function() {
x += step;
if (x > end) {
return;
}
turtle.moveTo([x, f(x)]);
setTimeout(moveForward, 200); // delay by 200 ms
};
turtle.hideTurtle(); // Hide the turtle arrow
moveForward(); // Start the drawing
</script>
<jsxgraph width="100%" aspect-ratio="10 / 4" title="Function plot animation" description="This construction was copied from JSXGraph examples database: https://jsxgraph.org/share/" useGlobalJS="false">
/*
This example is licensed under a
Creative Commons Attribution 4.0 International License.
https://creativecommons.org/licenses/by/4.0/
Please note that you have to mention
The Center of Mobile Learning with Digital Technology
in the credits.
*/
// User supplied function to be plotted
var f = (x) => Math.sin(x);
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-5, 2, 5, -2],
axis: true,
keepaspectratio: false
});
var start = -4,
end = 4,
x = start,
step = 0.2,
turtle = board.create('turtle', [x, f(x)]);
var moveForward = function() {
x += step;
if (x > end) {
return;
}
turtle.moveTo([x, f(x)]);
setTimeout(moveForward, 200); // delay by 200 ms
};
turtle.hideTurtle(); // Hide the turtle arrow
moveForward(); // Start the drawing
</jsxgraph>