[Tex/LaTex] Define \coordinate relative to other \coordinate

tikz-pgf

i have a tikz question. Is it possible to use relative coordinates in a \coordinate definition? I have to define a lot of coordinates and it would be much easier if i could define those relative to already defined coordinates like this:

\coordinate (A) at (0.0, 0.0);
\coordinate (B) at (A)+(120:1);

As you can see, i want to especially use the angle:length notation here. But in general i want to define the coordinate B relative to A. Is this possible?

Best Answer

\coordinate is only a shorthand for \path coordinate. You may thus place coordinates along an arbitrary path which supports relative coordinates without a hassle.

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
  \coordinate (A) at (0,0);
  \path (A) +(120:1) coordinate (B);
  % or \path (A) -- +(120:1) coordinate (B);

  \draw (A) circle (2pt);
  \draw (B) circle (2pt);
\end{tikzpicture}
\end{document}

enter image description here