This website is a beta version. The official release will be in **2024**.
nth-element of the series: <input type="text" id="input" value="1 / 2^n">
Start summation at n = <input type="number" id="startval" value="0" style="width:3em"><br />
<input type="button" value="start" onClick="start_approx()">
<input type="button" value="stop" onClick="clear_all()">
// Define the id of your board in BOARDID
const board = JXG.JSXGraph.initBoard(BOARDID, {axis:true, boundingbox: [-3, 8, 50, -8]});
var series = board.create('curve', [[], []], {strokeColor: 'black'});
var n, a_n;
var series_add = function() {
var val = a_n(n);
if (series.dataY.length > 0) {
val += series.dataY[series.dataY.length - 1];
}
series.dataX.push(n);
series.dataY.push(val);
n++;
};
var txt = board.create('text', [15, 1.8, () => 'n=' + (series.dataX.length-1) + ': value = ' + series.dataY[series.dataY.length - 1]], {strokeColor: 'blue'});
var timeoutHandle;
// Animation
var approx = function() {
series_add();
board.update();
if (series.dataX.length <= 50) {
timeoutHandle = setTimeout(approx, 500);
}
};
// Start animation
var start_approx = function() {
series.dataX = [];
series.dataY = [];
var txtraw = document.getElementById('input').value;
a_n = board.jc.snippet(txtraw, true, 'n', true);
n = parseInt(document.getElementById('startval').value);
approx();
};
// Stop animation
var clear_all = function() {
clearTimeout(timeoutHandle);
};
Copy to Clipboard
/*
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!
const board = JXG.JSXGraph.initBoard(BOARDID, {axis:true, boundingbox: [-3, 8, 50, -8]});
var series = board.create('curve', [[], []], {strokeColor: 'black'});
var n, a_n;
var series_add = function() {
var val = a_n(n);
if (series.dataY.length > 0) {
val += series.dataY[series.dataY.length - 1];
}
series.dataX.push(n);
series.dataY.push(val);
n++;
};
var txt = board.create('text', [15, 1.8, () => 'n=' + (series.dataX.length-1) + ': value = ' + series.dataY[series.dataY.length - 1]], {strokeColor: 'blue'});
var timeoutHandle;
// Animation
var approx = function() {
series_add();
board.update();
if (series.dataX.length <= 50) {
timeoutHandle = setTimeout(approx, 500);
}
};
// Start animation
var start_approx = function() {
series.dataX = [];
series.dataY = [];
var txtraw = document.getElementById('input').value;
a_n = board.jc.snippet(txtraw, true, 'n', true);
n = parseInt(document.getElementById('startval').value);
approx();
};
// Stop animation
var clear_all = function() {
clearTimeout(timeoutHandle);
};
nth-element of the series: <input type="text" id="input" value="1 / 2^n">
Start summation at n = <input type="number" id="startval" value="0" style="width:3em"><br />
<input type="button" value="start" onClick="start_approx()">
<input type="button" value="stop" onClick="clear_all()">
<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 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';
const board = JXG.JSXGraph.initBoard(BOARDID, {axis:true, boundingbox: [-3, 8, 50, -8]});
var series = board.create('curve', [[], []], {strokeColor: 'black'});
var n, a_n;
var series_add = function() {
var val = a_n(n);
if (series.dataY.length > 0) {
val += series.dataY[series.dataY.length - 1];
}
series.dataX.push(n);
series.dataY.push(val);
n++;
};
var txt = board.create('text', [15, 1.8, () => 'n=' + (series.dataX.length-1) + ': value = ' + series.dataY[series.dataY.length - 1]], {strokeColor: 'blue'});
var timeoutHandle;
// Animation
var approx = function() {
series_add();
board.update();
if (series.dataX.length <= 50) {
timeoutHandle = setTimeout(approx, 500);
}
};
// Start animation
var start_approx = function() {
series.dataX = [];
series.dataY = [];
var txtraw = document.getElementById('input').value;
a_n = board.jc.snippet(txtraw, true, 'n', true);
n = parseInt(document.getElementById('startval').value);
approx();
};
// Stop animation
var clear_all = function() {
clearTimeout(timeoutHandle);
};
</script>