// Define the id of your board in BOARDID
const board = JXG.JSXGraph.initBoard(BOARDID, {
boundingbox: [-5, 10, 7, -6],
axis: true
});
// Some initial points
var p = [];
p.push(board.create('point', [0, -2], {size: 2, name: 'C(a)'}));
p.push(board.create('point', [-1.5, 5], {size: 2, name: ''}));
p.push(board.create('point', [1, 4], {size: 2, name: ''}));
p.push(board.create('point', [3, 3], {size: 2, name: 'C(b)'}));
// Lagrange interpolation through the points
var fg = JXG.Math.Numerics.Neville(p);
var graph = board.create('curve', fg, {strokeWidth: 3, strokeOpacity: 0.5});
// Line
var line = board.create('line', [p[0], p[3]], {strokeColor: '#ff0000', dash: 1});
// Derivatives of the curve
var df = JXG.Math.Numerics.D(fg[0]);
var dg = JXG.Math.Numerics.D(fg[1]);
// Usually, the extended mean value theorem is formulated as
// df(t) / dg(t) == (p[3].X() - p[0].X()) / (p[3].Y() - p[0].Y())
// We can avoid division by zero with the following formulation:
var quot = (t) => df(t) * (p[3].Y() - p[0].Y()) - dg(t) * (p[3].X() - p[0].X());
// Construct the point C(ξ)
var r = board.create('glider', [
() => fg[0](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
() => fg[1](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
graph
], {name: 'C(ξ)', size: 4, fixed: true, color: 'blue'});
// Tangent to C through C(ξ)
board.create('tangent', [r], {strokeColor: '#ff0000'});
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: [-5, 10, 7, -6],
axis: true
});
// Some initial points
var p = [];
p.push(board.create('point', [0, -2], {size: 2, name: 'C(a)'}));
p.push(board.create('point', [-1.5, 5], {size: 2, name: ''}));
p.push(board.create('point', [1, 4], {size: 2, name: ''}));
p.push(board.create('point', [3, 3], {size: 2, name: 'C(b)'}));
// Lagrange interpolation through the points
var fg = JXG.Math.Numerics.Neville(p);
var graph = board.create('curve', fg, {strokeWidth: 3, strokeOpacity: 0.5});
// Line
var line = board.create('line', [p[0], p[3]], {strokeColor: '#ff0000', dash: 1});
// Derivatives of the curve
var df = JXG.Math.Numerics.D(fg[0]);
var dg = JXG.Math.Numerics.D(fg[1]);
// Usually, the extended mean value theorem is formulated as
// df(t) / dg(t) == (p[3].X() - p[0].X()) / (p[3].Y() - p[0].Y())
// We can avoid division by zero with the following formulation:
var quot = (t) => df(t) * (p[3].Y() - p[0].Y()) - dg(t) * (p[3].X() - p[0].X());
// Construct the point C(ξ)
var r = board.create('glider', [
() => fg[0](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
() => fg[1](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
graph
], {name: 'C(ξ)', size: 4, fixed: true, color: 'blue'});
// Tangent to C through C(ξ)
board.create('tangent', [r], {strokeColor: '#ff0000'});
<div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; ">
<div id="board-0" class="jxgbox" style="aspect-ratio: 3 / 2; width: 100%;" data-ar="3 / 2"></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: [-5, 10, 7, -6],
axis: true
});
// Some initial points
var p = [];
p.push(board.create('point', [0, -2], {size: 2, name: 'C(a)'}));
p.push(board.create('point', [-1.5, 5], {size: 2, name: ''}));
p.push(board.create('point', [1, 4], {size: 2, name: ''}));
p.push(board.create('point', [3, 3], {size: 2, name: 'C(b)'}));
// Lagrange interpolation through the points
var fg = JXG.Math.Numerics.Neville(p);
var graph = board.create('curve', fg, {strokeWidth: 3, strokeOpacity: 0.5});
// Line
var line = board.create('line', [p[0], p[3]], {strokeColor: '#ff0000', dash: 1});
// Derivatives of the curve
var df = JXG.Math.Numerics.D(fg[0]);
var dg = JXG.Math.Numerics.D(fg[1]);
// Usually, the extended mean value theorem is formulated as
// df(t) / dg(t) == (p[3].X() - p[0].X()) / (p[3].Y() - p[0].Y())
// We can avoid division by zero with the following formulation:
var quot = (t) => df(t) * (p[3].Y() - p[0].Y()) - dg(t) * (p[3].X() - p[0].X());
// Construct the point C(ξ)
var r = board.create('glider', [
() => fg[0](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
() => fg[1](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
graph
], {name: 'C(ξ)', size: 4, fixed: true, color: 'blue'});
// Tangent to C through C(ξ)
board.create('tangent', [r], {strokeColor: '#ff0000'});
</script>
<jsxgraph width="100%" aspect-ratio="3 / 2" title="Extended mean value theorem" description="This construction was copied from JSXGraph examples database: http://jsxgraph.uni-bayreuth.de/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: [-5, 10, 7, -6],
axis: true
});
// Some initial points
var p = [];
p.push(board.create('point', [0, -2], {size: 2, name: 'C(a)'}));
p.push(board.create('point', [-1.5, 5], {size: 2, name: ''}));
p.push(board.create('point', [1, 4], {size: 2, name: ''}));
p.push(board.create('point', [3, 3], {size: 2, name: 'C(b)'}));
// Lagrange interpolation through the points
var fg = JXG.Math.Numerics.Neville(p);
var graph = board.create('curve', fg, {strokeWidth: 3, strokeOpacity: 0.5});
// Line
var line = board.create('line', [p[0], p[3]], {strokeColor: '#ff0000', dash: 1});
// Derivatives of the curve
var df = JXG.Math.Numerics.D(fg[0]);
var dg = JXG.Math.Numerics.D(fg[1]);
// Usually, the extended mean value theorem is formulated as
// df(t) / dg(t) == (p[3].X() - p[0].X()) / (p[3].Y() - p[0].Y())
// We can avoid division by zero with the following formulation:
var quot = (t) => df(t) * (p[3].Y() - p[0].Y()) - dg(t) * (p[3].X() - p[0].X());
// Construct the point C(ξ)
var r = board.create('glider', [
() => fg[0](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
() => fg[1](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
graph
], {name: 'C(ξ)', size: 4, fixed: true, color: 'blue'});
// Tangent to C through C(ξ)
board.create('tangent', [r], {strokeColor: '#ff0000'});
</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: [-5, 10, 7, -6],
axis: true
});
// Some initial points
var p = [];
p.push(board.create('point', [0, -2], {size: 2, name: 'C(a)'}));
p.push(board.create('point', [-1.5, 5], {size: 2, name: ''}));
p.push(board.create('point', [1, 4], {size: 2, name: ''}));
p.push(board.create('point', [3, 3], {size: 2, name: 'C(b)'}));
// Lagrange interpolation through the points
var fg = JXG.Math.Numerics.Neville(p);
var graph = board.create('curve', fg, {strokeWidth: 3, strokeOpacity: 0.5});
// Line
var line = board.create('line', [p[0], p[3]], {strokeColor: '#ff0000', dash: 1});
// Derivatives of the curve
var df = JXG.Math.Numerics.D(fg[0]);
var dg = JXG.Math.Numerics.D(fg[1]);
// Usually, the extended mean value theorem is formulated as
// df(t) / dg(t) == (p[3].X() - p[0].X()) / (p[3].Y() - p[0].Y())
// We can avoid division by zero with the following formulation:
var quot = (t) => df(t) * (p[3].Y() - p[0].Y()) - dg(t) * (p[3].X() - p[0].X());
// Construct the point C(ξ)
var r = board.create('glider', [
() => fg[0](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
() => fg[1](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
graph
], {name: 'C(ξ)', size: 4, fixed: true, color: 'blue'});
// Tangent to C through C(ξ)
board.create('tangent', [r], {strokeColor: '#ff0000'});
<div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; ">
<div id="board-0" class="jxgbox" style="aspect-ratio: 3 / 2; width: 100%;" data-ar="3 / 2"></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: [-5, 10, 7, -6],
axis: true
});
// Some initial points
var p = [];
p.push(board.create('point', [0, -2], {size: 2, name: 'C(a)'}));
p.push(board.create('point', [-1.5, 5], {size: 2, name: ''}));
p.push(board.create('point', [1, 4], {size: 2, name: ''}));
p.push(board.create('point', [3, 3], {size: 2, name: 'C(b)'}));
// Lagrange interpolation through the points
var fg = JXG.Math.Numerics.Neville(p);
var graph = board.create('curve', fg, {strokeWidth: 3, strokeOpacity: 0.5});
// Line
var line = board.create('line', [p[0], p[3]], {strokeColor: '#ff0000', dash: 1});
// Derivatives of the curve
var df = JXG.Math.Numerics.D(fg[0]);
var dg = JXG.Math.Numerics.D(fg[1]);
// Usually, the extended mean value theorem is formulated as
// df(t) / dg(t) == (p[3].X() - p[0].X()) / (p[3].Y() - p[0].Y())
// We can avoid division by zero with the following formulation:
var quot = (t) => df(t) * (p[3].Y() - p[0].Y()) - dg(t) * (p[3].X() - p[0].X());
// Construct the point C(ξ)
var r = board.create('glider', [
() => fg[0](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
() => fg[1](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
graph
], {name: 'C(ξ)', size: 4, fixed: true, color: 'blue'});
// Tangent to C through C(ξ)
board.create('tangent', [r], {strokeColor: '#ff0000'});
</script>
<jsxgraph width="100%" aspect-ratio="3 / 2" title="Extended mean value theorem" description="This construction was copied from JSXGraph examples database: http://jsxgraph.uni-bayreuth.de/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: [-5, 10, 7, -6],
axis: true
});
// Some initial points
var p = [];
p.push(board.create('point', [0, -2], {size: 2, name: 'C(a)'}));
p.push(board.create('point', [-1.5, 5], {size: 2, name: ''}));
p.push(board.create('point', [1, 4], {size: 2, name: ''}));
p.push(board.create('point', [3, 3], {size: 2, name: 'C(b)'}));
// Lagrange interpolation through the points
var fg = JXG.Math.Numerics.Neville(p);
var graph = board.create('curve', fg, {strokeWidth: 3, strokeOpacity: 0.5});
// Line
var line = board.create('line', [p[0], p[3]], {strokeColor: '#ff0000', dash: 1});
// Derivatives of the curve
var df = JXG.Math.Numerics.D(fg[0]);
var dg = JXG.Math.Numerics.D(fg[1]);
// Usually, the extended mean value theorem is formulated as
// df(t) / dg(t) == (p[3].X() - p[0].X()) / (p[3].Y() - p[0].Y())
// We can avoid division by zero with the following formulation:
var quot = (t) => df(t) * (p[3].Y() - p[0].Y()) - dg(t) * (p[3].X() - p[0].X());
// Construct the point C(ξ)
var r = board.create('glider', [
() => fg[0](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
() => fg[1](JXG.Math.Numerics.root(quot, (fg[3]() + fg[2]) * 0.5)),
graph
], {name: 'C(ξ)', size: 4, fixed: true, color: 'blue'});
// Tangent to C through C(ξ)
board.create('tangent', [r], {strokeColor: '#ff0000'});
</jsxgraph>