4

Is it possible to write something like this?

\draw[dotted] (pi*0.5,sin(pi*0.5)) -- ++(10,0);

I would like to use the trigonometric functions when entering x, y-parts of the coordinates. I got Package Tikz error. It is incorrect syntax, or this method is not possible?

8

Yes, put braces around your functions.

\begin{tikzpicture}
\draw[dotted] ({pi*0.5},{sin(90)}) -- ++(10,0);
\end{tikzpicture}

But use degrees otherwise you need to enter <number> r to indicate that they are radians. So the second coordinate is just 1.decimals hence the sine is close to zero but not zero. See the manual for math operations.

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.