I do not understand how it is interpreted by a specified angle when using polar coordinates. I prepared three examples in my MWE:
\documentclass{article}
\usepackage{tikz} % TikZ and PGF picture
\usetikzlibrary{intersections}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}
\usetikzlibrary{matrix,arrows,decorations.pathmorphing}
\usetikzlibrary{positioning}
\newdimen\XCoord
\newdimen\YCoord
\newcommand*{\ExtractCoordinate}[1]{\path (#1); \pgfgetlastxy{\XCoord}{\YCoord};}%
\begin{document}
\begin{figure}[htp]
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (0,1);
\coordinate (C) at (1,1);
\node[left, color=blue] at (A) {A};
\node[left, color=blue] at (B) {B};
\node[right, color=blue] at (C) {C};
\draw (A) -- (B) -- (C);
\draw [color=cyan] let \p1=(A), \p2=(B), \p3=(C),
\n1={atan2(\y2-\y1,\x3-\x1)} in
(A) -- (\n1:2cm);
\ExtractCoordinate{B};
\node [below] at (1cm,-2cm) {B $(\XCoord,\YCoord)$};
\ExtractCoordinate{C};
\node [below] at (1cm,-2.5cm) {C $(\XCoord,\YCoord)$};
\end{tikzpicture}
\begin{tikzpicture}
\coordinate (A) at (-90.58205pt, 119.0348pt);
\coordinate (B) at (-90.58205pt, 133.26117pt);
\coordinate (C) at (-40.43698pt, 119.0348pt);
\node[left, color=blue] at (A) {A};
\node[left, color=blue] at (B) {B};
\node[right, color=blue] at (C) {C};
\draw (B) -- (A) -- (C);
\draw [color=cyan] let \p1=(A), \p2=(B), \p3=(C),
\n1={atan2(abs(\y2-\y1), abs(\x3-\x1))} in
(B) -- (74.161134732:2cm);
\draw[right, color=green] (B) -- (0:2cm);
\draw[right, color=red] (B) -- (45:2cm);
\ExtractCoordinate{B};
\node [below] at (1cm,-2cm) {B $(\XCoord,\YCoord)$};
\ExtractCoordinate{C};
\node [below] at (1cm,-2.5cm) {C $(\XCoord,\YCoord)$};
\end{tikzpicture}
\begin{tikzpicture}
\coordinate (A) at (2, 2);
\draw[right, color=green] (A) -- (0:2cm);
\draw[right, color=red] (A) -- (45:2cm);
\draw[right, color=blue] (A) -- (90:2cm);
\draw[right, color=black] (A) -- (74.161134732:2cm);
\end{tikzpicture}
\end{figure}
\end{document}
- first example: everything works fine.
- second example: problem:
In the following command:
\draw [color=cyan] let \p1=(A), \p2=(B), \p3=(C), \n1={atan2(abs(\y2-\y1), abs(\x3-\x1))} in (B) -- (74.161134732:2cm);
I tried to calculate the angle so I joined B to C. Unfortunately, unsuccessfully. I thought that atan2 function works wrong, so I replaced value in the variable \n1 by manually calculated angle, but again I did not connect the two points.
I reached to the conclusion that I can not properly use polar coordinates, and so I tried to test everything in the third example. I expected the green line will be horizontal, but instead, the line is vertical.
For illustration, I attach a picture:

Can you explain where I'm wrong?
