# How to connect relative polar coordinates in TikZ

I am trying to connect two points that are defined relatively to another point by polar coordinates.

Consider the figure below. The goal is to connect B and C by the black line. However, my code does not achieve the correct result.

\begin{tikzpicture}[>=latex]
\coordinate (fov) at (0, 2);
\fill[red] (fov) circle (2pt) node[anchor=east] {A};
\draw[red] (fov) -- ++(295:2cm);
\draw[red] (fov) -- ++(335:2cm);
\fill[red] (fov)++(295:2cm) circle (2pt) node[anchor=east] {B};
\fill[red] (fov)++(335:2cm) circle (2pt) node[anchor=south] {C};
\draw (fov)++(295:2cm) -- (fov)++(335:2cm);
\end{tikzpicture}


What am I doing wrong?

NB: the final goal is to fill the triangle ABC.

-
You can use ([shift={(coord or point)}]<coord or point>) or via calc library ($(fov)+(335:2cm)$). –  percusse Apr 22 '14 at 12:44
Think of the last draw as a path through 4 points, with a line being drawn between the middle two points. –  John Kormylo Apr 22 '14 at 12:50

The following example merges the single path operations to a more compact form. The needed coordinates are defined at their first use. And the lines are behind the circles (the black line on top of the red circles looked too odd to me).

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[>=latex]
\draw[red]
(0, 2)              coordinate (fov)
-- +(295:2cm) coordinate (B)
(fov) -- +(335:2cm) coordinate (C);
\draw (B) -- (C);
(fov) circle node[anchor=east] {A}
(B)   circle node[anchor=east] {B}
(C)   circle node[anchor=south] {C};
\end{tikzpicture}
\end{document}


-

You can place coordinates at the end of the paths and then connect them:

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[>=latex]
\coordinate (fov) at (0, 2);
\fill[red] (fov) circle (2pt) node[anchor=east] {A};
\draw[red] (fov) -- ++(295:2cm);
\draw[red] (fov) -- ++(335:2cm);
\fill[red] (fov)++(295:2cm) coordinate (b) circle (2pt) node[anchor=east]  {B};
\fill[red] (fov)++(335:2cm) coordinate (c) circle (2pt) node[anchor=south] {C};
\draw (b) -- (c);
\end{tikzpicture}

\end{document}


Perhaps rewriting your code with the help of the calc library gives you a better result (the black segment doesn't overwrite the red filled dots):

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}[>=latex]
\coordinate (fov) at (0, 2);
\fill[red] (fov) circle (2pt) node[anchor=east] {A};
\draw[red] (fov) -- ++(295:2cm);
\draw[red] (fov) -- ++(335:2cm);
\coordinate (b) at ( $(fov) + (295:2cm)$ );
\coordinate (c) at ( $(fov) +(335:2cm)$ );
\draw (b) -- (c);
\fill[red] (b) circle (2pt) node[anchor=east]  {B};
\fill[red] (c) circle (2pt) node[anchor=south] {C};
\end{tikzpicture}

\end{document}


-

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}[>=latex]
\begin{scope}{shift={(0,2)}}
\coordinate (fov) at (0,0) ;
\coordinate (B) at (295:2cm) ;
\coordinate (C) at (335:2cm) ;
\end{scope}

\fill[blue!20] (fov)--(B)--(C)--cycle ;
\fill[red] (fov) circle (2pt) node[anchor=east] {A};
\fill[red] (B) circle (2pt) node[anchor=north] {B};
\fill[red] (C) circle (2pt) node[anchor=west] {C};

\end{tikzpicture}
\end{document}

-