update work flow
This commit is contained in:
@@ -1430,11 +1430,49 @@ The area under a curve approximated by a Riemann sum.
|
||||
# url = "riemann.js"
|
||||
#CalculusWithJulia.WeaveSupport.JSXGraph(:integrals, url, caption)
|
||||
# This is just wrong...
|
||||
url = "https://raw.githubusercontent.com/jverzani/CalculusWithJulia.jl/master/CwJ/integrals/riemann.js"
|
||||
url = "./riemann.js"
|
||||
CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
|
||||
#CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
```=html
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
```
|
||||
|
||||
```ojs
|
||||
//| echo: false
|
||||
//| output: false
|
||||
JXG = require("jsxgraph");
|
||||
|
||||
b = JXG.JSXGraph.initBoard('jsxgraph', {
|
||||
boundingbox: [-0.5,0.3,1.5,-1/4], axis:true
|
||||
});
|
||||
|
||||
g = function(x) { return x*x*x*x + 10*x*x - 60* x + 100}
|
||||
f = function(x) {return 1/Math.sqrt(g(x))};
|
||||
|
||||
type = "right";
|
||||
l = 0;
|
||||
r = 1;
|
||||
rsum = function() {
|
||||
return JXG.Math.Numerics.riemannsum(f,n.Value(), type, l, r);
|
||||
};
|
||||
n = b.create('slider', [[0.1, -0.05],[0.75,-0.05], [2,1,50]],{name:'n',snapWidth:1});
|
||||
|
||||
graph = b.create('functiongraph', [f, l, r]);
|
||||
os = b.create('riemannsum',
|
||||
[f,
|
||||
function(){ return n.Value();},
|
||||
type, l, r
|
||||
],
|
||||
{fillColor:'#ffff00', fillOpacity:0.3});
|
||||
|
||||
b.create('text', [0.1,0.25, function(){
|
||||
return 'Riemann sum='+(rsum().toFixed(4));
|
||||
}]);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
The interactive graphic shows the area of a right-Riemann sum for different partitions. The function is
|
||||
|
||||
|
||||
Reference in New Issue
Block a user