The relationship between circular motion and simple harmonic motion in LaTeX

You seem to have very old students, who know how these record players looked like.

\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{shadings}
\begin{document}
\tdplotsetmaincoords{70}{30}
\foreach \Angle in {180,185,...,360}
{\begin{tikzpicture}[tdplot_main_coords,line cap=round,line join=round,
    pics/cyl/.style={code={
        \draw[left color=orange,right color=orange!20] (\tdplotmainphi:0.2) arc[start angle=\tdplotmainphi,
            end angle=\tdplotmainphi-180,radius=0.2] 
            -- ($(\tdplotmainphi-180:0.2)+(0,0,1)$)
            arc[start angle=\tdplotmainphi-180,
            end angle=\tdplotmainphi,radius=0.2] -- cycle;
        \draw[fill=orange] (0,0,1) circle[radius=0.2];  
    }},pics/projected cyl/.style={code={
    \draw[gray,fill=gray!20] (-0.2,0) rectangle (0.2,1);
    }}]
 \begin{scope}[canvas is xz plane at y=5.5]
  \fill[gray] (-6,0) rectangle (6,-2);
  \fill[gray!10] (-6,0) rectangle (6,2);
  \path ({4*cos(\Angle)},0) pic[transform shape]{projected cyl};
 \end{scope}
 \begin{scope}[canvas is xy plane at z=0]
  \shade[upper left=black,upper right=gray!30,
    lower left=gray!50,lower right=black,even odd rule] circle[radius=5]
    circle[radius=2];
    \draw foreach \r in {2.1,2.2,...,4.9} {circle[radius=\r]};
    \fill[blue!50!gray] (0,0) circle[radius=2];
 \end{scope}
 \path (\Angle:4) pic{cyl};
\end{tikzpicture}}
\end{document}

enter image description here

P.S. I first did not understand what was meant by "details" but after starring long enough on the screen shot I, too, could see a duck (even though I am still not sure if it is really there).

\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\usepackage{tikzducks}
\usetikzlibrary{arrows.meta,bending,shadings}
\begin{document}
\tdplotsetmaincoords{70}{30}
\foreach \Angle in {5,15,...,355}
{\begin{tikzpicture}[tdplot_main_coords,line cap=round,line join=round,
    pics/cyl/.style={code={
        \draw[left color=orange,right color=orange!80,middle color=orange!10] 
        (\tdplotmainphi:0.2) arc[start angle=\tdplotmainphi,
            end angle=\tdplotmainphi-180,radius=0.2] 
            -- ($(\tdplotmainphi-180:0.2)+(0,0,1)$)
            arc[start angle=\tdplotmainphi-180,
            end angle=\tdplotmainphi,radius=0.2] -- cycle;
        \draw[fill=orange] (0,0,1) circle[radius=0.2];  
    }},pics/projected cyl/.style={code={
    \draw[gray,fill=gray!20] (-0.2,0) rectangle (0.2,1);
    }}]
 \begin{scope}[canvas is xz plane at y=5.5]
  \fill[gray] (-6,0) rectangle (6,-2);
  \fill[gray!10] (-6,0) rectangle (6,2);
  \draw[thick,-Stealth] (-6,3) -- (6,3);
  \draw[transform shape] (-4,2.8) -- ++ (0,0.4) node[above]{$x=-A$}
   (0,2.8) -- ++ (0,0.4) node[above]{$x=0$}
   (4,2.8) -- ++ (0,0.4) node[above]{$x=A$};
  \path ({4*cos(\Angle)},0) pic[transform shape]{projected cyl};
 \end{scope}
 \begin{scope}[canvas is xy plane at z=0]
  \shade[upper left=black,upper right=gray!30,
    lower left=gray!50,lower right=black,even odd rule] circle[radius=5]
    circle[radius=2];
  \draw foreach \r in {2.1,2.2,...,4.9} {circle[radius=\r]};
  \fill[blue!50!gray] (0,0) circle[radius=2];
  \path[nodes={transform shape,anchor=base,font={\large\sffamily},text=white}] 
   foreach \Char [count=\Z,
    evaluate=\Z as \myangle using {\tdplotmainphi+\Angle+\Z*8+(\Z==1?-4:0)}] 
    in {M,o,z,a,r,t}
    {(\myangle:1.5) node[rotate=\myangle+90]{\Char}};
  \duck[rotate=\Angle,xshift=-1cm,yshift=-1cm]  
  \pgflowlevelsynccm
  \draw[very thick,blue,-{Stealth[bend]}] 
    (180:5.5) arc[start angle=180,end angle=240,radius=5.5];
 \end{scope}
 \path (\Angle:4) pic{cyl};
\end{tikzpicture}}
\end{document}

enter image description here

P.S. Somehow it is not entirely trivial to use decorations.text together with projections on a plane.


If you only need the GIF, is LaTeX necessarily required? If you consider another alternative and my answer isn't considered as spam, there's a ConTeXt example (compile it here when an installation isn't feasible in your case). Unfortunately no fancy 3D:

\starttext
%#1: start; #2: end; #3: step; #4: content
\dostepwiserecurse{0}{330}{30}{%
\startMPpage
labeloffset := 5bp;
numeric u;  u := 1cm;
numeric alpha; alpha := \recurselevel;
pair peg, lilshadow; 
path stick;
stick := fullsquare xscaled 0.2u yscaled 2.2u shifted (1.5u*right);
peg := u*dir alpha;
lilshadow := (1.5u,ypart peg);
fill fullsquare scaled 2.2u withcolor .75[blue,white];
fill stick withcolor 0.75;
fill fullcircle scaled 2u;
fill fullcircle scaled 1/2u withcolor darkblue;
for i = 1/2 step 1/4 until 2:
    draw fullcircle scaled (i*u) withcolor 0.25; 
endfor
fill fullcircle scaled 1/8u withcolor (1,4/5,0);
%Comment the next line if you don't want a dashed line connecting the peg and its shadow
draw peg -- lilshadow dashed evenly withcolor (1,1,0);
drawdot lilshadow withpen pencircle scaled 4 withcolor 0.4;
drawdot peg withpen pencircle scaled 4 withcolor (1,1/2,0);
drawarrow (urcorner stick -- lrcorner stick) shifted (3bp*right);
label.rt("$\tfxx x=-A$", urcorner stick);
label.rt("$\tfxx x=+A$", lrcorner stick);
label.rt("$\tfxx x=0$", 1/2[urcorner stick, lrcorner stick]);
setbounds currentpicture to (fullsquare xscaled 4u yscaled 2.5u shifted (0.75u*right));
\stopMPpage%
}
\stoptext

I've chosen simple colors, but additional tuning is up to your taste. Using the following in the command line (my file is 104.pdf in the example):

convert -density 200 104.pdf 104-%02d.png
convert -delay 15 -dispose 2 104-*.png 104.gif

I finally get this GIF:

enter image description here

EDIT: As pointed out above, changing the step as well as the ending point we have a GIF which moves faster or slower. If we use

\dostepwiserecurse{0}{345}{15}{%

instead, and with the same settings for convert, we get this:

enter image description here


A PSTricks solution only for either fun or comparison purposes.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-node}
\begin{document}
\foreach \i in{0,10,...,350}{%
\begin{pspicture}(-5,-5)(6.5,5)
    \pscircle(0,0){4}
    \psline(5,-5)(5,5)
    \pnodes(4;\i){P}(!5 4 \i\space sin mul){Q}(5,-4){B}(5,0){O}(5,4){T}
    \psset{linecolor=gray,labelsep=12pt}
    \psline(0,0)(P)
    \qdisk(B){2pt}
    \qdisk(O){2pt}
    \qdisk(T){2pt}  
    \uput[0](B){$y=-A$}
    \uput[0](O){$y=0$}
    \uput[0](T){$y=A$}
    %
    \pcline[linestyle=dashed](P)(Q)
    \psset{linecolor=red}
    \qdisk(P){5pt}
    \qdisk(Q){5pt}
    %
    \pnode[!0 \i\space cos 1.5 mul](Q){Qy}
    \psLine[linecolor=blue,linewidth=4pt,arrowinset=0]{->}(Q)(Qy)
\end{pspicture}}
\end{document}

enter image description here