This animation helps explain the geometric interpretation of the definite integral.
Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the
LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de.
En français: TeXnique.fr.
%
%
% Author:
% Efraín Soto Apolinar.
% http://www.aprendematematicas.org/
%
% This animation helps explain the
% geometric interpretation of the
% definite integral.
%
\documentclass[10pt]{beamer}
\usepackage[utf8]{inputenc} % Language = Spanish
%
\usepackage{color}
\usepackage{tikz}
\usepackage{hyperref}
\hypersetup{pdfpagemode=FullScreen}
\usepackage{ifthen}
\usepackage{animate}
%
\usetheme{Warsaw}
\usecolortheme{whale}
%
%
%
\newcounter{angle}
\setcounter{angle}{0}
%
\begin{document}
%
%
%
\newcounter{r}
\newcommand{\escalar}[1]{
\setcounter{r}{#1 * #1 * #1}
}
%
\newcounter{m}
\setcounter{m}{0}
\newcounter{mc}
%
%
%
\begin{frame}[fragile]{Animated Integral}
\begin{center}
\begin{animateinline}[loop, poster = first, controls, palindrome]{2}
\whiledo{\them < 21}{
\begin{tikzpicture}[scale=1.25]
\draw[red,thick,<->] (-1,1) parabola bend (0,0) (2.1,4.41)
node[below right] {$y=x^2$};
\draw[loosely dotted] (-1,0) grid (4,4);
%\path[use as bounding box] (-2,-1) rectangle (5,5);
\draw[->] (-0.2,0) -- (4.25,0) node[right] {$x$};
\draw[->] (0,-0.25) -- (0,4.25) node[above] {$y$};
\foreach \x/\xtext in {1/1, 2/2, 3/3}
\draw[shift={(\x,0)}] (0pt,2pt) -- (0pt,-2pt) node[below] {$\xtext$};
\foreach \y/\ytext in {1/1, 2/2, 3/3, 4/4}
\draw[shift={(0,\y)}] (2pt,0pt) -- (-2pt,0pt) node[left] {$\ytext$};
%
\setcounter{mc}{\value{m}*\value{m}}
\shade[top color=blue,bottom color=gray!50]
(0,0) parabola (0.1*\them,0.01*\themc) |- (0,0);
\escalar{\them}
\draw (3cm,2pt) node[above]
{$\displaystyle\int\limits_0^{\them/10} \!\!x^2\mathrm{d}x =
\displaystyle\frac{\ther}{3000}$};
\draw[fill=orange,color=orange] (0.1*\them,0.01*\themc) circle (0.5pt);
\end{tikzpicture}
%
\stepcounter{m}
\ifthenelse{\them < 21}{
\newframe
}{
\end{animateinline}\relax % BREAK
}
} % END \whiledo...
\end{center}
\end{frame}
%
%
%
\end{document}
Comments
Interesting, but the last frame is not aligned. regards
Yes, that is a bit annoying. We could not figure out why.
If you are interested, here is a corrected version which solves the last frame and the empty first frame issues. Moreover, it uses the \multiframe command provided by animate.sty instead of the \whiledo loop.
ftp://ftp.fzd.de/private/grahn/animated-definite-integral.tex
ftp://ftp.fzd.de/private/grahn/animated-definite-integral.pdf
The example has now been updated and the last frame issue fixed.
Its a bug? The area working only in full-screen-mode correctly.
How I can see this animation, sorry but I haven't so much experience with this things.
Muy chidooo!!!
Adding comments is currently not enabled.