\pgfmathparse{1}\let\L\pgfmathresult

\coordinate (A) at (-\L,-\L);
\coordinate (B) at ( \L, \L);

\fill (A) circle(2pt) node [left] {$A~~$};
\fill (B) circle(2pt) node [left] {$B~~$};
\draw ($(A)!-1.5!(B)$) -- ($(A)!2.5!(B)$);

\foreach \t in {-1,-0.5,0,0.5,1,1.5,2}
{
   \fill ($(A)!\t!(B)$) circle(1.5pt) node [right] {$~~t=\t$};
}
