Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.