Possible Duplicate:
Problems with TikZ calculations
I am trying to get the following arrows to get lengths defined by a trigonometric function, in this case cos. This was my attempt, but it does not yield any results:
\begin{tikzpicture}
\foreach \y in {1,0.8,...,0}
\path (1,\y) edge[->] ++(2-cos(\y*pi/2),0)(1,-\y) edge[->] ++(2-cos(\y*pi/2),0);
\end{tikzpicture}
The errors I get are both from tikz/pgf: "no shape named 2-cos(0 is known." and "Giving up on this path, did you forget a semicolon?"
( )using{ }. Also please always state the exact error you get, "does not yield any results" doesn't tell other people much. Thanks. – Martin Scharrer Oct 19 '11 at 09:10\path (1,\y) edge[->] ++({2-cos(\y*pi/2)},0) (1,-\y) edge[->] ++({2-cos(\y*pi/2)},0);to make it work. – Martin Scharrer Oct 19 '11 at 09:12