# Problem with XYZ-Coordinate Systems

Perhaps I made a mistake with the syntax but I think I found a problem.

\documentclass[11pt]{scrartcl}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[x = {(sin(-60) cm,-cos(-60) cm)},
y = {(0.866 cm,-0.5 cm)},
z = {(0cm,1cm)},
scale = 4]
\draw[->] (0,0,0) -- (1,0,0);
\draw[->] (0,0,0) -- (0,1,0);
\draw[->] (0,0,0) -- (0,0,1);
\draw circle (1);
\end{tikzpicture}

\end{document}


I can use cos(60) for the second coordinate but I can't use sin(60) for the first one.

The question is how to work around this problem. What is the better way ?. I can use something like \xcoord with \pgfmathsetmacro\xcoord{sin(-60)} but perhaps there is a better way.

-
use extra curly braces: {sin(20)} –  Marco Daniel Apr 2 '12 at 19:36
x = {({sin(-60)},{-cos(-60)})} works but I can't manage to put cm next to them. I think \pgfmathparse is the robust way of doing it. I can also see that a nice answer is coming :) –  percusse Apr 2 '12 at 19:51
@MarcoDaniel Yes I try the extra curly braces but I can't manage to put cm like percusse –  Alain Matthes Apr 2 '12 at 20:31

As Marco Daniel points out, you can make TikZ parse the expressions by enclosing them in curly braces. To interpret the result as centimetres, you can multiply your expression by * 1cm:

\documentclass[11pt]{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[x = {({sin(-60)*1cm},{-cos(60)*1cm})},
y = {(0.866 cm,-0.5 cm)},
z = {(0cm,1cm)},
scale = 4]
\draw[->] (0,0,0) -- (1,0,0);
\draw[->] (0,0,0) -- (0,1,0);
\draw[->] (0,0,0) -- (0,0,1);
\draw circle (1);
\end{tikzpicture}

\end{document}

-
How to explain this behavior ? Why the problem appears only on the first coordinate? I see this problem in another answer but I can't find it. –  Alain Matthes Apr 3 '12 at 8:15