\pgfmathparse{-0.5} \let\t\pgfmathresult;
\pgfmathparse{1}    \let\DistP\pgfmathresult;
\pgfmathparse{0.75} \let\DistM\pgfmathresult;

\pgfmathparse{1}\let\Dst\pgfmathresult;
\pgfmathparse{1}\let\Dst\pgfmathresult;

\pgfmathparse{-1}\let\xp\pgfmathresult;
\pgfmathparse{-2}\let\yp\pgfmathresult;

\pgfmathparse{3}\let\vx\pgfmathresult;
\pgfmathparse{1}\let\vy\pgfmathresult;

\coordinate (P0) at (\xp,\yp);

\coordinate (v) at (\vx,\vy);
\coordinate (n) at (-\vy,\vx);

\coordinate (P1) at ($(P0)+(v)$);
\coordinate (PN) at ($(P0)+(n)$);

\fill (P0) circle(2pt) node [below] {$P_0$};

\draw [-Latex,thick] (P0) -- ++(v);
\draw [-Latex,thick] (P0) -- ++(n);
\tkzLabelSegment[below](P0,P1) {$\underline{v}$};
\tkzLabelSegment[right](P0,PN)  {$\underline{n}$};

\tkzMarkRightAngle[](P1,P0,PN);

%
%Drawing title texts
%

\pgfmathparse{1.25}\let\DstP\pgfmathresult;
\pgfmathparse{0.75}\let\DstM\pgfmathresult;


%Point in positive halfplane
\coordinate (PPlus) at ($(P0)+\DstP*(n)$);

%Point in negative halfplane
\coordinate (PMinus) at ($(P0)-\DstM*(n)$);

\draw ($(P0)!\t!(P1)$) -- ($(P1)!\t!(P0)$) node [right] {$r: ax+by=c$};
\draw (PPlus) node[] {$H_+: ax+by>c$};
\draw (PMinus) node[] {$H_-: ax+by<c$};

%
%Drawing projections
%
\pgfmathparse{1}    \let\DistP\pgfmathresult;
\pgfmathparse{0.75} \let\DistM\pgfmathresult;


%Point in positive halfplane
\coordinate (PPlus) at ($(P0)+\DistP*(v)+\DistP*(n)$);

%Point in negative halfplane
\coordinate (PMinus) at ($(P0)+\DistM*(v)-\DistM*(n)$);

%Projections on line
\coordinate (PP) at ($(P0)!(PPlus)!(P1)$);
\coordinate (PM) at ($(P0)!(PMinus)!(P1)$);

\draw[-Latex,dotted] (PP) -- (PPlus);
\draw[-Latex,dotted] (PM) -- (PMinus);

\fill (PPlus)  circle(1pt) node[above] {$P^+$};
\fill (PMinus) circle(1pt) node[below] {$P^-$};

\fill (PP)  circle(1pt) node[below] {$P^+_p$};
\fill (PM) circle(1pt) node[above] {$P^-_p$};

