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