\documentclass{standalone}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{tikz}



\begin{document}

\begin{tikzpicture}
\draw[thick, ->] (0,0) -- (6,0) node [below] {$x$};
\draw[thick, ->] (0,0) -- (0,4) node [left] {$y$};
\draw[dashed] (0.5,0.5) -- (0.5,3) -- (4.5,3) -- (4.5,0.5) -- cycle;
\draw[fill=gray!20!] (0.5,0.5) -- (3,3) -- (4.5,1.5) -- cycle;
\draw (0.5,0.5) node [below right] {$P_1(x_1,y_1)$};
\draw (4.5,1.5) node [right] {$P_2(x_2,y_2)$};
\draw (3,3) node [above] {$P_3(x_3,y_3)$};
\draw (8,2) node {$A = \frac{1}{2}
  \left|\begin{array}{ccc}
  x_1 & y_1 & 1\\
  x_2 & y_2 & 1\\
  x_3 & y_3 & 1
  \end{array}\right|$};
\end{tikzpicture}

\end{document}