在 TikZ 中用波浪线模拟多项式

在 TikZ 中用波浪线模拟多项式

如何在 Ti 中绘制波浪线Z 来模拟多项式的图吗?

在此处输入图片描述

答案1

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{shapes.arrows}
\begin{document}
\begin{tikzpicture}
\begin{scope}[local bounding box=left]
\foreach \X  [count=\Y] in {green!60!black,yellow!80!orange,red}
{\draw[\X] plot[variable=\x,domain=0:1,smooth] ({2*\x},{0.7*sin(\x*540)+0.4*\x+2*(2-\Y)});}
\end{scope}
\begin{scope}[xshift=5cm,local bounding box=right]
\foreach \X  [count=\Y] in {green!60!black,yellow!80!orange,red}
{\draw[\X] plot[variable=\x,domain=0:1,smooth]
({2.5*\x+0.5*cos(\x*200)},{-0.7*sin(\x*540)+2*(2-\Y)});}
\end{scope}
\path (left.east) -- (right.west) 
node[midway,font=\sffamily,single arrow, draw]{randomize};
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容