I made a handout on which are drawn parallelograms of the same area.
\documentclass[]{article}
\usepackage[np]{numprint}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}
\draw[dashed] (0,0)--(13,0);
\draw[dashed] (0,3)--(13,3);
\draw[<->,>={Latex}](.5,0)--(.5,3)node[midway,fill=white]{\numprint[cm]{3}};
\draw[fill=green!30] (4.5,0)--(5.5,3)--(9.5,3)--(8.5,0)--cycle ;% parallelo 1
\draw[<->,>={Latex}](4.5,-.3)--(8.5,-.3)node[midway,fill=white]{\numprint[cm]{4}};
\begin{scope}
\draw[dashed] (0,-4)--(13,-4);
\draw[dashed] (0,-1)--(13,-1);
\draw[<->,>={Latex}](.5,-4)--(.5,-1)node[midway,fill=white]{\numprint[cm]{3}};
\draw[fill=green!30] (8,-4)--(2,-1)--(6,-1)--(12,-4)--cycle;% parallelo 4
\draw[<->,>={Latex}](8,-4.3)--(12,-4.3)node[midway,fill=white]{\numprint[cm]{4}};
\end{scope}
\end{tikzpicture}
\end{document}
When the students have finished working, I want to project on the board the same document in the form of a slide beamer, but composed of the two following animations that will be activated at the click of the mouse.
First animation:
\documentclass[tikz]{standalone}
\usetikzlibrary{arrows.meta,patterns}
\usepackage[np]{numprint}
\usepackage{animate}
\usepackage{fontawesome}
\begin{document}
\foreach \y in {0,.2,...,3}{% découper le parallélogramme - images 1 - 16
\begin{tikzpicture}
\useasboundingbox (-6.5,-.5) rectangle (6.5,4);
\draw[dashed] (-6.5,0)--(6.5,0);
\draw[dashed] (-6.5,3)--(6.5,3);
\draw[<->,>={Latex}](-6,0)--(-6,3)node[midway,fill=white]{\numprint[cm]{3}};
\draw[<->,>={Latex}](-2,-.3)--(2,-.3)node[midway,fill=white]{\numprint[cm]{4}};
\fill[green!50](-2,0)--(-1,3)--(3,3)--(2,0)--cycle;
\fill[pattern=north east lines,pattern color=blue!30](2,0)--(2,\y)--(2+\y/3,\y)--cycle;
\draw[dashed](2,0)--(2,\y);
\draw[dashed](2,0)--(2+\y/3,\y);
\end{tikzpicture}
}
\foreach \iangle in {2,4,...,180}{% déplacer le triangle
\begin{tikzpicture}
\fill[white] (-6.5,-.5) rectangle (6.5,4);
\draw[dashed] (-6.5,0)--(6.5,0);
\draw[dashed] (-6.5,3)--(6.5,3);
\draw[<->,>={Latex}](-6,0)--(-6,3)node[midway,fill=white]{\numprint[cm]{3}};
\draw[<->,>={Latex}](-2,-.3)--(2,-.3)node[midway,fill=white]{\numprint[cm]{4}};
\fill[green!50](-2,0)--(-1,3)--(2,3)--(2,0)--cycle;
\fill[green,opacity=.5] (\iangle:20mm and 8mm)--([shift={(0,3)}]\iangle:20mm and 8mm)--([shift={(1,3)}]\iangle:20mm and 8mm)--cycle;
\draw[thin,dashed,pattern=north east lines,pattern color=blue!30](2,3)--(2,0)--(3,3)--cycle;
\draw[thin,dashed,pattern=north east lines,pattern color=blue!30] (\iangle:20mm and 8mm)--([shift={(0,3)}]\iangle:20mm and 8mm)--([shift={(1,3)}]\iangle:20mm and 8mm)--cycle;
\node at ([shift={(.4,1.5)}]\iangle:20mm and 8mm)[black]{\faHandPointerO};
\end{tikzpicture}
}
\end{document}
Second animation:
\documentclass[tikz]{standalone}
\usepackage{animate}
\usepackage{pgf}
\usepackage{multido}
\usepackage{numprint}
\usetikzlibrary{patterns,decorations,arrows.meta}
\pgfdeclaredecoration{ignore}{final}{
\state{final}{}
}
\pgfdeclaremetadecoration{start}{initial}{
\state{initial}[width={0pt},next state=middle]{
\decoration{moveto}
}
\state{middle}[width={\pgfmetadecoratedpathlength*\pgfdecorationsegmentlength},next state=final]{
\decoration{lineto}
}
\state{final}{\decoration{ignore}}
}
\tikzset{
start segment/.style={decoration={start,raise=1mm},decorate, segment length=#1},
}
\tikzset{every path/.style={>={Straight Barb[]}}}
\begin{document}
\def\couleur{white}
\begin{tikzpicture}% fond écran vert - triangles 1 et 2 - image 1
\useasboundingbox (0,3.1) rectangle (13,-.5);
\fill[green!40](2,3) rectangle (12,0);
\draw[dashed] (0,0)--(13,0);
\draw[dashed] (0,3)--(13,3);
\draw[<->](.5,0)--(.5,3)node[midway,fill=white]{\numprint[cm]{3}};
\draw[<->](8,-.3)--(12,-.3)node[midway,fill=white]{\numprint[cm]{4}};
\fill[\couleur] (12,0)--(12,3)--(6,3)--cycle;
\fill[\couleur] (2,0)--(2,3)--(8,0)--cycle;
\end{tikzpicture}
\foreach \rpos in {.02,.04,...,1}{% inscrire le parallélogramme dans un rectangle - images 2-51
\begin{tikzpicture}
\useasboundingbox (0,3.1) rectangle (13,-.5);
\fill[green!40](2,3) rectangle (12,0);
\draw[dashed] (0,0)--(13,0);
\draw[dashed] (0,3)--(13,3);
\draw[<->](.5,0)--(.5,3)node[midway,fill=white]{\numprint[cm]{3}};
\draw[<->](8,-.3)--(12,-.3)node[midway,fill=white]{\numprint[cm]{4}};
\fill[\couleur] (12,0)--(12,3)--(6,3)--cycle;
\fill[\couleur] (2,0)--(2,3)--(8,0)--cycle;
\draw[start segment=\rpos,blue,semithick] (2,3) -- (2,0) -- (12,0) -- (12,3) --cycle ;
\end{tikzpicture}
}
\foreach \rpos in {.1,.2,...,3}{% colorer le triangle 2 progressivement - 30 images: 52-81
\begin{tikzpicture}
\useasboundingbox (0,3.1) rectangle (13,-.5);
\fill[green!40](2,3) rectangle (12,0);
\draw[dashed] (0,0)--(13,0);
\draw[dashed] (0,3)--(13,3);
\draw[<->,](.5,0)--(.5,3)node[midway,fill=white]{\numprint[cm]{3}};
\draw[<->](8,-.3)--(12,-.3)node[midway,fill=white]{\numprint[cm]{4}};
\fill[\couleur] (12,0)--(12,3)--(6,3)--cycle;
\fill[\couleur] (2,0)--(2,3)--(8,0)--cycle;
\draw[blue,thin] (2,3) -- (2,0) -- (12,0) -- (12,3) --cycle ;
\draw[blue,thin] (2,3) -- (2+2*\rpos,3-\rpos);
\fill[pattern color=blue,pattern=north east lines](2,3)--(2+2*\rpos,3-\rpos)--(2,3-\rpos)--cycle;
\end{tikzpicture}
}
\foreach \rpos in {.1,.2,...,3}{% colorer le triangle 1 progressivement - 30 images: 82-111
\begin{tikzpicture}
\useasboundingbox (0,3.1) rectangle (13,-.5);
\fill[green!40](2,3) rectangle (12,0);
\draw[dashed] (0,0)--(13,0);
\draw[dashed] (0,3)--(13,3);
\draw[<->](.5,0)--(.5,3)node[midway,fill=white]{\numprint[cm]{3}};
\draw[<->](8,-.3)--(12,-.3)node[midway,fill=white]{\numprint[cm]{4}};
\fill[\couleur] (12,0)--(12,3)--(6,3)--cycle;
\fill[\couleur] (2,0)--(2,3)--(8,0)--cycle;
\draw[blue,thin] (2,3) -- (2,0) -- (12,0) -- (12,3) --cycle ;
\draw[blue,thin] (2,3) -- (8,0);
\fill[pattern color=blue,pattern=north east lines](2,3)--(8,0)--(2,0)--cycle;
\draw[blue,thin] (12,0) -- (12-2*\rpos,\rpos);
\fill[pattern color=blue,thin,pattern=north east lines](12,0)--(12,\rpos)--(12-2*\rpos,\rpos);
\end{tikzpicture}
}
\foreach \x in {11.95,11.9,...,8}{% translation du triangle 1 - 80 images: 112-191
\begin{tikzpicture}
\useasboundingbox (0,3.1) rectangle (13,-.5);
\fill[green!40](2,3) rectangle (12,0);
\draw[dashed] (0,0)--(13,0);
\draw[dashed] (0,3)--(13,3);
\draw[<->](.5,0)--(.5,3)node[midway,fill=white]{\numprint[cm]{3}};
\draw[<->](8,-.3)--(12,-.3)node[midway,fill=white]{\numprint[cm]{4}};
\fill[\couleur] (2,0)--(2,3)--(8,0)--cycle;
\draw[blue,thin] (2,3) -- (2,0) -- (12,0) -- (12,3) --cycle ;
\draw[blue,thin] (2,3) -- (8,0);
\fill[pattern color=blue,pattern=north east lines](2,3)--(8,0)--(2,0)--cycle;
\draw[blue,thin,fill=white](\x,0)--(\x,3)--(\x-6,3)--cycle;
\fill[pattern color=blue,pattern=north east lines] (\x,0)--(\x,3)--(\x-6,3)--cycle;
\end{tikzpicture}
}
\end{document}
I tried to use the beamer's Movie command, but I couldn't.
\documentclass[aspectratio=1610]{beamer}
\usepackage{animate}
\usepackage{multimedia}
\usepackage{media9}
\begin{document}
\begin{frame}{Aire du parallélogramme}
\movie[]{}{para1.pdf}
%\includemedia[]{}{para1.pdf}
\movie[]{}{para4.pdf}
%\includemedia[]{}{para4.pdf}
\end{frame}
\end{document}
- Is it possible to place two animations in the same beamer frame?
- If so, how?
- Should I change the format of animations: gif, swf, mp4, ... instead of pdf?
\animationOne
and\animationTwo
, on the first slide do\animationOne{\X} \animationTwo{0}
, then\animationOne{0} \animationTwo{\X}
and finally ``\animationOne{\X} \animationTwo{\X}` where\X
is the variable that gets animated.