Riemann sum III: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 10: Line 10:
</html>
</html>
<jsxgraph width="800" height="400" box="box">
<jsxgraph width="800" height="400" box="box">
var brd = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox:[-8,40,8,-5], grid:true});
var brd = JXG.JSXGraph.initBoard('box', {axis:true, boundingbox:[-2,40,8,-5]});
var s = brd.create('slider',[[1,30],[5,30],[1,10,50]],{name:'n',snapWidth:1});
var s = brd.create('slider',[[1,30],[5,30],[1,50,500]],{name:'n',snapWidth:1});
var a = brd.create('slider',[[1,20],[5,20],[-10,-3,0]],{name:'start'});
var a = brd.create('slider',[[1,20],[5,20],[-10,0,0]],{name:'start'});
var b = brd.create('slider',[[1,10],[5,10],[0,Math.PI,10]],{name:'end'});
var b = brd.create('slider',[[1,10],[5,10],[0,6,10]],{name:'end'});
var f = function(x){ return x*x; };
var f = function(x){ return x*x; };
var plot = brd.create('functiongraph',[f,function(){return a.Value();}, function(){return b.Value();}]);
var plot = brd.create('functiongraph',[f,function(){return a.Value();}, function(){return b.Value();}]);

Revision as of 15:23, 2 February 2010

Riemann sum type:

The underlying JavaScript code

<jsxgraph width="800" height="400" box="box">
</jsxgraph>