# Relative positioning of nodes in TikZ

Consider this simple example:

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

\begin{tikzpicture}[scale=1.5]
% Draw axes
\draw [<->,thick] (0,2.2) node (yaxis) [above] {$t$}
|- (2.2,0) node (xaxis) [right] {$s$};
% Draw triangle's legs
\draw (0.5,0.5) coordinate (a)  -- +(1.3,0) coordinate (b);
\draw (b) -- +(0,1.5) coordinate (c);

\draw (a) .. controls +(10:1) and +(265:1) .. (c)
node[sloped,above,pos=0.5] {$t=g(s)$};

% Draw vertices and labels
\fill[red] (a) circle (1pt);
\draw (a) node[left] {$a$};
\fill[red] (b) circle (1pt);
\draw (b) node[right] {$b$};
\fill[red] (c) circle (1pt);
\draw (c) node[right] {$c$};
\end{tikzpicture}
\end{document}


I want to position a fourth point d relative to one of the other points. I want it to be a standalone coordinate, such that later in the code I could refer to it. For example, have \draw (d) -- (0,0); or something similar.

Thanks!

-

This can be done using the following ways:

\usetikzlibrary{calc}
% ...

\coordinate (d) at ($(c) + (1,3)$);


or

\path (c) ++(1,3) coordinate (d);


The latter one might add a invisible path to your picture, which should not be an issue most of the time.

-
I can confirm that both approached solved my issue. Thanks! – Dror Apr 13 '11 at 8:53
Note that in the first case one can also subtract, in the other option one has to add a negative number, for example (c) ++(-1,3). – Dror Apr 13 '11 at 9:21
@Dror: Yes, the ++ is a fixed syntax, there is no --, so you have to use negative numbers. – Martin Scharrer Apr 13 '11 at 9:47