¿Como crear animaciones matematicas usando LaTeX?
En este video explico como realizar una animacion a partir de imagenes, de un archivo en pdf y utilizando solamente codigo.
\documentclass{article}
\usepackage{animate}
\usepackage{graphicx}
\usepackage{ifthen}
\usepackage{tikz}
\newcounter{a}
\setcounter{a}{-6}
\newcounter{grado}
\setcounter{grado}{0}
\begin{document}
\textbf{Animacion a partir de varias imagenes c1.png, c2.png,..., c6.png}
\begin{center}
\animategraphics[controls,loop,width=0.5\linewidth]{3}{c}{1}{9}
\end{center}
\newpage
\textbf{Animacion a partir de varias paginas del archivo un tparabolico.pdf}
\begin{center}
\begin{figure}
\animategraphics[controls]{1}{tparabolico}{}{}
\end{figure}
\end{center}
\newpage
\textbf{Animacion utilizando un buche While}
\begin{center}
\begin{animateinline}[loop, poster = first, controls]{2}
\whiledo{\thea<7}{
\begin{tikzpicture}
\draw[thick,->,blue] (-3,0)--(3,0) node[below] {$x$}; % x axis
\draw[thick,->,blue] (0,-3)--(0,3) node[left] {$y$}; % y axis
\draw[ultra thick,cyan] (0,0) -- (0.5*\thea,0.5*\thea);
\end{tikzpicture}
\stepcounter{a}
\ifthenelse{\thea<7}{
\newframe
}{
\end{animateinline}
}
}
\end{center}
\newpage
\textbf{Animacion utilizando un buche While}
\begin{center}
\begin{animateinline}[loop, poster = first, controls]{30}
\whiledo{\thegrado<359}{
\begin{tikzpicture}
\draw[thick,->,blue] (-3,0)--(3,0) node[below] {$x$}; % x axis
\draw[thick,->,blue] (0,-3)--(0,3) node[left] {$y$}; % y axis
\draw[ultra thick,red,->] (0,0) -- (\thegrado:2.5cm);
\draw[dashed,cyan,-] (0,0) |- (\thegrado:2.5cm);
\draw[dashed,cyan,-] (0,0) -| (\thegrado:2.5cm);
\end{tikzpicture}
\stepcounter{grado}
\ifthenelse{\thegrado<359}{
\newframe
}{
\end{animateinline}
}
}
\end{center}
\end{document}
tparabolico.tex
\documentclass{article}
\usepackage[papersize={12cm,6.8cm},top=1mm,left=1mm,right=1mm,]{geometry}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}
\foreach \i in {0,1,2,...,10}{
\begin{tikzpicture}
\draw[thick,->,blue] (0,0)--(10,0) node[below] {$x$}; % x axis
\draw[thick,->,blue] (0,0)--(0,5) node[left] {$y$}; % y axis
\node[red] at (\i,2.0*\i-0.20*\i*\i){$\bullet$};
\draw[domain=0:\i, smooth, variable=\x, cyan] plot ({\x}, {2.0*\x-0.20*\x*\x});
\node at (5,-0.3){$0.2x(10-x)$};
\end{tikzpicture}
}
\end{document}