# Math not working in curve with out and in angle

I am facing a strange error. I am using pgf/tikz 3.0.1 cvs to plot a curve with in and out angles. I am using mathematical calculations to obtain the second coordinate. Strangely, when I use a trigonometric function in the x coordinate I get an error but the same expression works in the y coordinate. I am pasting the code below

    \documentclass{report}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows.meta,positioning,calc,decorations.markings}
\usepackage{float}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\node at (0,0) {$xs$}; % initial point
\node at (11.5,2) {$xg$}; % final point
%\draw (0:0.375) to[out=0,in=210] ({11.5+0.375*cos(210)},{2+0.375*sin(210)});
%Does not work
\draw (0:0.375) to[out=0,in=210] ({11.5+0.375*0.5},{2+0.375*sin(210)});
% Works fine
\end{tikzpicture}
\caption{title}
\label{fig:trajs}
\end{figure}
\end{document}


I would appreciate if anyone could help me out here.

• I don't know why but a second pair of braces solved the problem: ({{11.5+0.375*cos(210)}},... – Ignasi Feb 25 '16 at 10:24

You can take advantage of \pgfmathsetmacro to define your coordinates.

\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows.meta,positioning,calc,decorations.markings}
\usepackage{float}

\pgfmathsetmacro\xcor{11.5+0.375*cos(210)}
\pgfmathsetmacro\ycor{2+0.375*sin(210)}

\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
\node at (0,0) {$xs$}; % initial point
\node at (11.5,2) {$xg$}; % final point
\draw (0:0.375) to[out=0,in=210] (\xcor,\ycor);
\draw (0:0.375) to[out=0,in=210] ({11.5+0.375*0.5},{2+0.375*sin(210)});
% Works fine
\end{tikzpicture}
\caption{title}
\label{fig:trajs}
\end{figure}
\end{document}