Inclined sine wave in TikZ

tikz-pgf

I am able to a horizontal sine wave using the below code.

\draw[domain = 0:4] plot [smooth] (\x,{0.4 * sin(\x * pi/2 r)});

How to draw an inclined sine wave using TikZ? Something similar to the following image:
enter image description here

Best Answer

\documentclass[tikz, border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) -- (2,0) cos (3,1) sin (4,2) -- (6,2);
\end{tikzpicture}
\end{document}

Curve with sine function