2
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[>=latex]
\draw[gray,very thin] (0,-2) grid (8,2);
\draw[thick] (0,0) sin (1,2) cos (2,0) sin (3,-2) cos (4,0) sin (5,2) cos (6,0) sin (7,-2) cos (8,0);
\draw[<->,xshift=-2mm](0,-2)--++(90:1) node[midway,left]{$1.0$ cm};
\draw (current bounding box.south) 
 node[below=2mm]{c.r.o. screen};
\draw[<->,yshift=-2mm](0,-2)--++(0:1) 
  node[midway,below]{$1.0$ cm};
 \end{tikzpicture}
\end{document}

enter image description here

\documentclass[pstricks,border=25pt]{standalone}
\usepackage{pst-coil,graphicx,pst-plot}
\begin{document}
\begin{pspicture}(8,4)
\psgrid[subgriddiv=0,gridlabels=0]

\pssin[periods=2cm](0,2)(8,2)

\def\Fig{\pcline[arrowinset=0]{<->}(0,0)(1,0)}
\rput(0,-.15){\Fig \nbput{\small 1.0 cm}}
\rput(-.15,0){\rotatebox{90}{\Fig \naput{\small 1.0 cm}}}

\end{pspicture}
\end{document}

enter image description here

Question:

In PSTricks, what is the equivalent of

\draw[thick] (0,0) sin (1,2) cos (2,0) sin (3,-2) cos (4,0) sin (5,2) cos (6,0) sin (7,-2) cos (8,0);

? And help me to complete it as TikZ's result?

3

I do not understand your question, because drawing the sin curve is very simple:

\documentclass[pstricks,border=25pt]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-0.5,0)(8,4)
\psgrid[subgriddiv=0,gridlabels=0]
\psplot[algebraic]{0}{8}{2*sin(x*1.57)+2}
\pcline[arrowinset=0,offset=-0.2]{<->}(0,0)(1,0)\nbput{\small 1.0 cm}
\pcline[arrowinset=0,offset=-0.2]{<->}(0,1)(0,0)\nbput{\small 1.0 cm}
\end{pspicture}
\end{document}

enter image description here

  • 1
    the amplitude is 2 the zero line is at (0,2) and the period is 4, which must be 2pi – user2478 Dec 27 '18 at 15:25

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.