Examples
Examples in the JSXGraph-wiki:
First impressions (the points A,B,C,D,E can be dragged):
Here is the source code for the above construction. It uses the JSXGraph plugin for WordPress.
<pre><jsxgraph width="500" height="500" box="box">
brd = JXG.JSXGraph.initBoard('box',
{axis:true,originX: 250, originY: 250, unitX: 50, unitY: 25});
brd.suspendUpdate();
var p = [];
p[0] = brd.createElement('point', [-4,2], {style:6});
p[1] = brd.createElement('point', [3,-1], {style:6});
addPoint(-2);
addPoint(0.5);
addPoint(1);
var pol = brd.lagrangePolynomial(p);
g = brd.createElement('functiongraph', [pol, -10, 10], {strokeWidth:3});
g2 = brd.createElement('functiongraph', [brd.D(pol), -10, 10],
{dash:3, strokeColor:'#ff0000'});
function addPoint(x) {
p.push(brd.createElement('point',
[x,(Math.random()-0.5)*3],{style:6}));
brd.update();
}
brd.unsuspendUpdate();
</jsxgraph></pre>
Recent Comments