File:MVT.gif
| Uploaded by | Auswahlaxiom |
|---|---|
| Upload date | 2017-03-29T15:32:47Z |
| MIME type | image/gif |
| Dimensions | 287 × 126 px |
| File size | 789.9 KB |
Summary
| Description |
English: Animation for the Mean Value Theorem for integration
Deutsch: Animation zum Mittelwertsatz für Integrale |
| Date | |
| Source | Own work |
| Author | Auswahlaxiom |
| GIF development | |
| Source code | Asymptote codeimport graph;
size(8cm, 0);
defaultpen(fontsize(14)+linewidth(0.8));
real dt = 0.04;
int n = 0;
void ship() {
write(n);
shipout(outprefix() + format("-%04d", n));
++n;
}
real inf(real f(real), real a, real b, int n) {
return min(map(f, uniform(a, b, n)));
}
real sup(real f(real), real a, real b, int n) {
return max(map(f, uniform(a, b, n)));
}
real average(real f(real), real a, real b, int n) {
return sum(map(f, uniform(a+(b-a)/(2*n), b-(b-a)/(2*n), n-1)))/n;
}
real f(real x) {
return 2+4/(13-x)+sin(2sqrt(x^2+3)-3)/2-(x-4)^2/16;
}
real f(real x) {
return 2+4/(13-x)+sin(2sqrt(x^2+3)-3)/2-(x-4)^2/16;
}
real xmax = 8;
xtick("$\xi$", xmax, invisible);
ytick("$f(\xi)$", sup(f, 0, xmax, 100), invisible);
for(real t = 0; t+dt/2 < 8; t += dt) {
save();
real x = (1-abs(t/4-1))*xmax;
//real x = (0.9*cos(t/4*pi)+0.1*cos(t/4*pi*3)+1)/2*xmax;
real y = f(x);
fill((0, 0)--graph(f, 0, xmax)--(xmax, 0)--cycle, rgb(1.0, 0.5, 0.0)+opacity(0.5));
fill(box((0, 0), (xmax, y)), rgb(0.0, 0.5, 1.0)+opacity(0.5));
draw(Label("$f$", MidPoint, N), graph(f, 0, xmax));
draw((x, 0)--(x, y), dashed);
xaxis(0, xmax, above=true);
yaxis(0, above=true);
yaxis(YEquals(xmax), 0, above=true);
yequals(y);
xtick("$a$", 0);
xtick("$b$", xmax);
xtick("$\xi$", x);
ytick("$f(\xi)$", y);
dot((x, y));
ship();
restore();
}
|
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.