If points A (5, p) B (1, 5), C (2, 1) and D (6, 2) form a square ABCD, then p =
(a) 7
(b) 3
(c) 6
(d) 8
The distance $d$ between two points $\left(x_{1}, y_{1}\right)$ and $\left(x_{2}, y_{2}\right)$ is given by the formula
$d=\sqrt{\left(x_{1}-x_{2}\right)^{2}+\left(y_{1}-y_{2}\right)^{2}}$
In a square all the sides are equal to each other.
Here the four points are A(5,p), B(1,5), C(2,1) and D(6,2).
The vertex ‘A’ should be equidistant from ‘B’ as well as ‘D’
Let us now find out the distances ‘AB’ and ‘AD’.
$\mathrm{AB}=\sqrt{(5-1)^{2}+(p-5)^{2}}$
$\mathrm{AB}=\sqrt{(4)^{2}+(p-5)^{2}}$
$\mathrm{AD}=\sqrt{(5-6)^{2}+(p-2)^{2}}$
$\mathrm{AD}=\sqrt{(-1)^{2}+(p-2)^{2}}$
These two need to be equal.
Equating the above two equations we have,
$\mathrm{AB}=\mathrm{AD}$
$\sqrt{(4)^{2}+(p-5)^{2}}=\sqrt{(-1)^{2}+(p-2)^{2}}$
Squaring on both sides we have,
$(4)^{2}+(p-5)^{2}=(-1)^{2}+(p-2)^{2}$
$16+p^{2}+25-10 p=1+p^{2}+4-4 p$
$6 p=36$
$p=6$
Hence the correct choice is option (c).