定积分定义动画演示
Clear;f: = x^2; a = 0; b = 1.5; m = 0;
g1 = Plot, {x, a, b}, PlotStyle -> {RGBColor},
DisplayFunction -> Identity];
For[j = 3, j <= 50, j += 2, m = j; tt1 = {}; tt2 = {};
For[i = 0, i < m, i++, x1 = a + i*(b - a)/m; x2 = x1 + (b - a)/m;
tt1 = Append[tt1,
Graphics[{RGBColor, Rectangle[{x1, 0}, {x2, f}]}]];
tt2 = Append[tt2,
Graphics[{RGBColor, Rectangle[{x1, f}, {x2, 0}]}]]];
Show[tt1, tt2, g1, DisplayFunction -> $DisplayFunction,
PlotLabel -> m'' intervals'']]
定积分的动画演示,运行没有结果,请各位大虾看看错在哪里?
f := x^2 + 1; a = 0; b = 2; m = 0;
g = Plot, {x, a, b}, PlotStyle -> Red,
DisplayFunction -> Identity]
For[n = 0, n < 100, n = n + 4; t1 = {}; t2 = {};
For[i = 0, i < n, i++, x1 = a + (b - a) i/n; x2 = x1 + (b - a)/n;
t1 = Append[t1,
Graphics[{Blue, Rectangle[{x1, f}, {x2, f}]}]];
t2 = Append}, {x2, 0}]}]]];
Show[t1, t2, g, DisplayFunction -> $DisplayFunction,
PlotLabel -> n "intervals"]]
太高端,不懂,帮顶
已经解决。谢谢小木虫的大虾。
f := x^2 + 1; a = 0; b = 2; m = 0;
g = Plot, {x, a, b}, PlotStyle -> Red];
Animate[t1 = {}; t2 = {};
For[i = 0, i < n, i++, x1 = a + (b - a) i/n; x2 = x1 + (b - a)/n;
t1 = Append[t1,
Graphics[{Blue, Rectangle[{x1, f}, {x2, f}]}]];
t2 = Append}, {x2, 0}]}]]];
Show, {n, 4, 100, 4},
AnimationRunning -> False]
牛。牛牛。
收藏起来慢慢看
收藏起来慢慢看
好牛,厉害
页:
[1]