我认为rad(atan(pi*\x))
和atan(pi*\x r)
是等价的。这是错误还是我遗漏了什么?
梅威瑟:
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
I thought \verb=rad(atan(pi*\x))= and \verb=atan(pi*\x r)= were equivalent. Is that a bug or am I missing something?
\begin{tikzpicture}[samples=200, domain=-2.5:2.5]
\useasboundingbox (-2.5,-pi/2) rectangle (2.5,pi/2);
\draw[black] plot (\x,{rad(atan(pi*\x))});
\begin{scope}[xshift=4cm]
\draw[black] plot (\x,{atan(pi*\x r)});
\end{scope}
\end{tikzpicture}
\end{document}
答案1
rad(...)
,deg(...)
然后与或r
相乘。显然,在三角函数内部或外部执行此操作是不一样的。以下是执行相同操作的一些等效方法:180/pi
pi/180
\documentclass[tikz, border=1 cm]{standalone}
\begin{document}
\begin{tikzpicture}[samples=200, domain=-2.5:2.5]
\draw[red] plot (\x,{rad(atan(pi*\x))});
\draw[cyan] plot (\x,{atan(pi*\x r)});
\begin{scope}[xshift=4cm]
\draw[red] plot (\x,{pi/180*(atan(pi*\x))});
\draw[cyan] plot (\x,{atan(180/pi*pi*\x)});
\end{scope}
\begin{scope}[xshift=8cm]
\draw[cyan] plot (\x,{atan(deg(pi*\x))});
\end{scope}
\end{tikzpicture}
\end{document}