Riemann integrability: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
var brd = JXG.JSXGraph.initBoard('box', {boundingbox:[-3,4,3,-4],axis:true}); | var brd = JXG.JSXGraph.initBoard('box', {boundingbox:[-3,4,3,-4],axis:true}); | ||
var p = []; | var p = []; | ||
p.push(brd.create('point',[-2,(Math.random()-0.5)*5])); | p.push(brd.create('point',[-2.7,(Math.random()-0.5)*5])); | ||
p.push(brd.create('point',[-1,(Math.random()-0.5)*5])); | p.push(brd.create('point',[-1,(Math.random()-0.5)*5])); | ||
p.push(brd.create('point',[0,(Math.random()-0.5)*5])); | p.push(brd.create('point',[0,(Math.random()-0.5)*5])); | ||
p.push(brd.create('point',[1,(Math.random()-0.5)*5])); | p.push(brd.create('point',[1,(Math.random()-0.5)*5])); | ||
p.push(brd.create('point',[2,(Math.random()-0.5)*5])); | p.push(brd.create('point',[2.7,(Math.random()-0.5)*5])); | ||
var f = brd.lagrangePolynomial(p); | var f = brd.lagrangePolynomial(p); | ||
Line 12: | Line 12: | ||
var plot = brd.create('functiongraph',[f,-3,3]); | var plot = brd.create('functiongraph',[f,-3,3]); | ||
var | var up = brd.createElement('riemannsum',[f,function(){ return n.Value();}, 'upper',-3,3],{fillColor:'#ff0000', fillOpacity:0.3}); | ||
var lo = brd.createElement('riemannsum',[f,function(){ return n.Value();}, 'lower',-3,3],{fillColor:'#ffff00', fillOpacity:0.3}); | |||
/* | /* |