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