5

Using beamer I want to show how different linear transformations act on the plane. I tried to do this by uncovering different \pgftransformcm commands, but it doesn't work. What would be the best way to do this?

Here's my code:

    \documentclass{beamer}
    \usepackage{tikz}
    \begin{document}
    \begin{frame}
    \[\begin{tikzpicture}
    \begin{scope}
    \clip (0,0) rectangle (10cm,6cm);

    \uncover<1>{\pgftransformcm{1}{0}{0}{1}{\pgfpoint{5cm}{2cm}};}
    %\uncover<2>{\pgftransformcm{1}{-0.5}{1}{1}{\pgfpoint{5cm}{2cm}};}
    %\uncover<3>{\pgftransformcm{1}{1}{1}{-1}{\pgfpoint{5cm}{2cm}};}

    \draw[style=help lines,dashed] (-14,-14) grid[step=1cm] (14,14);
    \draw[thick,red,->] (0,0)--(1,0) node[anchor=south]{$e_1$};
    \draw[thick,blue,->] (0,0)--(0,1) node[anchor=south]{$e_2$};
    \draw[thick,green,->] (0,0)--(1,3) node[anchor=south]{$v$};
    \end{scope}
    \end{tikzpicture}\]
    \end{frame}
    \end{document}
7

Like this

\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\def\mypicture{
\draw[style=help lines,dashed] (-14,-14) grid[step=1cm] (14,14);
\draw[thick,red,->]  (0,0)--(1,0) node[anchor=south]{$e_1$};
\draw[thick,blue,->] (0,0)--(0,1) node[anchor=south]{$e_2$};
\draw[thick,green,->](0,0)--(1,3) node[anchor=south]{$v$};
}
\begin{tikzpicture}
\begin{scope}
\clip (0,-0.02) rectangle (10cm,6cm);

\only<1>{
\pgftransformcm{1}{0}{0}{1}{\pgfpoint{5cm}{2cm}};
\mypicture
}
\only<2>{
\pgftransformcm{1}{-0.5}{1}{1}{\pgfpoint{5cm}{2cm}};
\mypicture
}
\only<3>{
\pgftransformcm{1}{1}{1}{-1}{\pgfpoint{5cm}{2cm}};
\mypicture
}

\end{scope}
\end{tikzpicture}
\end{frame}
\end{document}

Output

enter image description here

  • I also meant for the grid to transform, but it was an easy fix. Thanks! – Jompa Aug 13 '16 at 19:44
  • 1
    Answer updated, \clip (0,-0.02) rectangle (10cm,6cm); here -0.02 to show arrow head in the third slide. – Salim Bou Aug 13 '16 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.