Given two points $$(x_1,y_1)$$ and $$(x_2, y_2)$$ the distance between them is:
$$d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}\text{.}\label{distance_formula}\tag{B.1.1}$$
$$d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2 + (z_2-z_1)^2}\label{distance_formula_3d}\tag{B.1.2}$$