You can use the calc library to calculate the vector between the first two points. By using the + path operator, you can draw a line from a third point in the direction of this vector:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[dot/.style={circle,inner sep=1pt,fill,label={#1},name=#1},
extended line/.style={shorten >=-#1,shorten <=-#1},
extended line/.default=1cm]
\node [dot=A] at (2,1) {};
\node [dot=B] at (3,2) {};
\node [dot=P] at (2,2) {};
\draw [extended line=0.5cm] (A) -- (B);
\draw [extended line=0.5cm] (P) -- +($(B)-(A)$);
\end{tikzpicture}
\end{document}
