// Define the id of your board in BOARDID
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-3, 10, 3, -3],
axis: true,
showClearTraces: true
});
var p = [];
p.push(board.create('point', [-2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
p.push(board.create('point', [0, Math.random() * 5 - 1], {
name: '',
size: 2
}));
p.push(board.create('point', [2.2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
// f defines the function graph through the three points
var f = JXG.Math.Numerics.lagrangePolynomial(p);
var plot = board.create('functiongraph', [f, -3, 3]);
var s = board.create('glider', [-2, f(-2), plot], {
name: 'drag me',
color: 'black',
size: 5
});
var int = board.create('integral', [
[function() {
return p[0].X();
}, function() {
return s.X();
}], plot
], {
fillOpacity: 0.2
});
var F = board.create('point', [function() {
return s.X();
}, function() {
return JXG.Math.Numerics.I([p[0].X(), s.X()], f);
}], {
trace: true,
name: 'F',
fillColor: '#0000aa',
strokeColor: '#0000aa',
face: '[]'
});
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!
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-3, 10, 3, -3],
axis: true,
showClearTraces: true
});
var p = [];
p.push(board.create('point', [-2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
p.push(board.create('point', [0, Math.random() * 5 - 1], {
name: '',
size: 2
}));
p.push(board.create('point', [2.2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
// f defines the function graph through the three points
var f = JXG.Math.Numerics.lagrangePolynomial(p);
var plot = board.create('functiongraph', [f, -3, 3]);
var s = board.create('glider', [-2, f(-2), plot], {
name: 'drag me',
color: 'black',
size: 5
});
var int = board.create('integral', [
[function() {
return p[0].X();
}, function() {
return s.X();
}], plot
], {
fillOpacity: 0.2
});
var F = board.create('point', [function() {
return s.X();
}, function() {
return JXG.Math.Numerics.I([p[0].X(), s.X()], f);
}], {
trace: true,
name: 'F',
fillColor: '#0000aa',
strokeColor: '#0000aa',
face: '[]'
});
<div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; ">
<div id="board-0" class="jxgbox" style="aspect-ratio: 2 / 1; width: 100%;" data-ar="2 / 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, {
boundingbox: [-3, 10, 3, -3],
axis: true,
showClearTraces: true
});
var p = [];
p.push(board.create('point', [-2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
p.push(board.create('point', [0, Math.random() * 5 - 1], {
name: '',
size: 2
}));
p.push(board.create('point', [2.2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
// f defines the function graph through the three points
var f = JXG.Math.Numerics.lagrangePolynomial(p);
var plot = board.create('functiongraph', [f, -3, 3]);
var s = board.create('glider', [-2, f(-2), plot], {
name: 'drag me',
color: 'black',
size: 5
});
var int = board.create('integral', [
[function() {
return p[0].X();
}, function() {
return s.X();
}], plot
], {
fillOpacity: 0.2
});
var F = board.create('point', [function() {
return s.X();
}, function() {
return JXG.Math.Numerics.I([p[0].X(), s.X()], f);
}], {
trace: true,
name: 'F',
fillColor: '#0000aa',
strokeColor: '#0000aa',
face: '[]'
});
</script>
<jsxgraph width="100%" aspect-ratio="2 / 1" title="Antiderivative" 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.
*/
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-3, 10, 3, -3],
axis: true,
showClearTraces: true
});
var p = [];
p.push(board.create('point', [-2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
p.push(board.create('point', [0, Math.random() * 5 - 1], {
name: '',
size: 2
}));
p.push(board.create('point', [2.2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
// f defines the function graph through the three points
var f = JXG.Math.Numerics.lagrangePolynomial(p);
var plot = board.create('functiongraph', [f, -3, 3]);
var s = board.create('glider', [-2, f(-2), plot], {
name: 'drag me',
color: 'black',
size: 5
});
var int = board.create('integral', [
[function() {
return p[0].X();
}, function() {
return s.X();
}], plot
], {
fillOpacity: 0.2
});
var F = board.create('point', [function() {
return s.X();
}, function() {
return JXG.Math.Numerics.I([p[0].X(), s.X()], f);
}], {
trace: true,
name: 'F',
fillColor: '#0000aa',
strokeColor: '#0000aa',
face: '[]'
});
</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!
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-3, 10, 3, -3],
axis: true,
showClearTraces: true
});
var p = [];
p.push(board.create('point', [-2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
p.push(board.create('point', [0, Math.random() * 5 - 1], {
name: '',
size: 2
}));
p.push(board.create('point', [2.2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
// f defines the function graph through the three points
var f = JXG.Math.Numerics.lagrangePolynomial(p);
var plot = board.create('functiongraph', [f, -3, 3]);
var s = board.create('glider', [-2, f(-2), plot], {
name: 'drag me',
color: 'black',
size: 5
});
var int = board.create('integral', [
[function() {
return p[0].X();
}, function() {
return s.X();
}], plot
], {
fillOpacity: 0.2
});
var F = board.create('point', [function() {
return s.X();
}, function() {
return JXG.Math.Numerics.I([p[0].X(), s.X()], f);
}], {
trace: true,
name: 'F',
fillColor: '#0000aa',
strokeColor: '#0000aa',
face: '[]'
});
<div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; ">
<div id="board-0" class="jxgbox" style="aspect-ratio: 2 / 1; width: 100%;" data-ar="2 / 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, {
boundingbox: [-3, 10, 3, -3],
axis: true,
showClearTraces: true
});
var p = [];
p.push(board.create('point', [-2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
p.push(board.create('point', [0, Math.random() * 5 - 1], {
name: '',
size: 2
}));
p.push(board.create('point', [2.2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
// f defines the function graph through the three points
var f = JXG.Math.Numerics.lagrangePolynomial(p);
var plot = board.create('functiongraph', [f, -3, 3]);
var s = board.create('glider', [-2, f(-2), plot], {
name: 'drag me',
color: 'black',
size: 5
});
var int = board.create('integral', [
[function() {
return p[0].X();
}, function() {
return s.X();
}], plot
], {
fillOpacity: 0.2
});
var F = board.create('point', [function() {
return s.X();
}, function() {
return JXG.Math.Numerics.I([p[0].X(), s.X()], f);
}], {
trace: true,
name: 'F',
fillColor: '#0000aa',
strokeColor: '#0000aa',
face: '[]'
});
</script>
<jsxgraph width="100%" aspect-ratio="2 / 1" title="Antiderivative" 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.
*/
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-3, 10, 3, -3],
axis: true,
showClearTraces: true
});
var p = [];
p.push(board.create('point', [-2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
p.push(board.create('point', [0, Math.random() * 5 - 1], {
name: '',
size: 2
}));
p.push(board.create('point', [2.2, Math.random() * 5 + 2], {
name: '',
size: 2
}));
// f defines the function graph through the three points
var f = JXG.Math.Numerics.lagrangePolynomial(p);
var plot = board.create('functiongraph', [f, -3, 3]);
var s = board.create('glider', [-2, f(-2), plot], {
name: 'drag me',
color: 'black',
size: 5
});
var int = board.create('integral', [
[function() {
return p[0].X();
}, function() {
return s.X();
}], plot
], {
fillOpacity: 0.2
});
var F = board.create('point', [function() {
return s.X();
}, function() {
return JXG.Math.Numerics.I([p[0].X(), s.X()], f);
}], {
trace: true,
name: 'F',
fillColor: '#0000aa',
strokeColor: '#0000aa',
face: '[]'
});
</jsxgraph>