check the picture below.
[tex]\bf ~~~~~~~~~~~~\textit{distance between 2 points}
\\\\
\begin{array}{ccccccccc}
&&x_1&&y_1&&x_2&&y_2\\
% (a,b)
&A&(~ 1 &,& 2~)
% (c,d)
&B&(~ 3 &,& 4~)
\end{array}~~~
% distance value
d = \sqrt{( x_2- x_1)^2 + ( y_2- y_1)^2}
\\\\\\
AB=\sqrt{(3-1)^2+(4-2)^2}\implies AB=\sqrt{2^2+2^2}
\\\\\\
AB=\sqrt{2\cdot 2^2}\implies AB=2\sqrt{2}[/tex]