To find the distance between two points [tex] A = (A_x, A_y),\ B = (B_x, B_y) [/tex] you may use the formula
[tex] \overline{AB} = \sqrt{(A_x-B_x)^2+(A_y-B_y)^2} [/tex]
In your case, the formula becomes
[tex] \overline{AB} = \sqrt{(a-3a)^2+(-2-5)^2} = \sqrt{(-2a)^2+(-7)^2} = \sqrt{4a^2+49} [/tex]