4

I have a tikZ picture. But couldn't understand how to ad some details.

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}[xscale=1,yscale=2]
  \draw[domain=1.5:14.3,samples=300,blue, rotate=90, yshift=-128pt] plot(\x,{sin(\x r)});
  \draw[domain=1.5:14.3,samples=300,blue, rotate=90, yshift=-64pt] plot(\x,{cos((\x+1.7) r)});
  \draw[domain=1.5:14.3,samples=300,blue, rotate=90] plot(\x,{sin(\x r)});
  \draw[domain=1.5:14.3,samples=300,blue, rotate=90, yshift=64pt] plot(\x,{cos((\x+1.7) r)});
  \draw[domain=1.5:14.3,samples=300,blue, rotate=90, yshift=128pt] plot(\x,{sin(\x r)});
  \draw[domain=1.5:14.3,samples=300,blue, rotate=90, yshift=192pt] plot(\x,{cos((\x+1.7) r)});

\end{tikzpicture}
\end{document}

I would like to add minimum and maximum distance between the two waves(somewhere around middle of the wave).
Ref: How to plot this diagram?

  • What do you mean by that exactly? A double arrow between the waves? – Torbjørn T. Jun 10 '17 at 21:49
  • @TorbjørnT. Somewhere like this, yes double arrow. – L.K. Jun 10 '17 at 21:52
  • 1
    Is it intentional that you have +1.7 in the cosine functions, and not +1.57 (approximately pi/2)? – Torbjørn T. Jun 10 '17 at 21:54
  • @TorbjørnT. Thanks for that input, my ignorance. – L.K. Jun 10 '17 at 21:56
3

Here's one suggestion, the code is simplified a bit. As you know the minima/maxima of sine/cosine functions, you can just draw two arrows where the y-coordinates are calculated with sin/cos.

enter image description here

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[
   xscale=1,yscale=2,
   every plot/.append style={samples=50,domain=1.5:14.3},
   rotate=90]

\begin{scope}[blue]
  \draw plot(\x,{sin(\x r) - 5});
  \draw plot(\x,{cos((\x+pi/2) r) - 2.5});
  \draw plot(\x,{sin(\x r)});
  \draw plot(\x,{cos((\x+pi/2) r) + 2.5});
  \draw plot(\x,{sin(\x r) + 5});
  \draw plot(\x,{cos((\x+pi/2) r) + 7.5});
\end{scope}

  \draw [<->,>=stealth] (5*pi/2,{sin(5*pi/2 r)}) -- node[above] {$a$} (5*pi/2,{cos((5*pi/2+pi/2) r)+2.5});
  \draw [<->,>=stealth] (5*pi/2,{sin(5*pi/2 r)}) -- node[above] {$b$} (5*pi/2,{cos((5*pi/2+pi/2) r)-2.5});
\end{tikzpicture}
\end{document}

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.