[Tex/LaTex] tikz – relative coordinates of a second position

tikz-pgf

I'm drawing a kind of sequence diagram but I don't want to calculate every position.

I want to use relative coordinates. With the command coodinate I set the first coordinate (0.25,14.25) as a, but I want to select a second coordinate (0.25,14.75).

Is there a way to do this?

%Actor
\draw[dashed] (0.25,15) -- (0.25,0)  node[above=15] {User};
\draw[dashed] (6,15) -- (6,0)  node[above=15] {HMI};
\draw[dashed] (12,15) -- (12,0) node[above=15] {Server1};
\draw[dashed] (18,15) -- (18,0) node[above=15] {Server2};
%
%Blocks
\begin{scriptsize}
\draw[line width=5pt] (0.25,14.25) -- (0.25,14.75)  node[midway, right] {Test} coordinate (a);
\end{scriptsize}
%
%Arrows
\begin{scope}[>=latex]
\draw[->,black] (a) -- (6,14);
\end{scope}

Best Answer

You can do this using the calc library (See Section 13.5 Coordinate Calculations of the pgf manual):

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

\begin{tikzpicture}
  \coordinate (a) at (2,2);
  \coordinate (b) at (0,-2);
  \node[draw=red] at (a) {a};
  \node[draw=red] at (b) {b};
  \draw[help lines] (-1,-3) grid (3,3);
  \draw ($ (a) + (0,1) $) -- ($ (b) + (0,1) $);
\end{tikzpicture}
\end{document}