Find the distance between $\mathrm{P}\left(x_{1}, y_{1}\right)$ and $\mathrm{Q}\left(x_{2}, y_{2}\right)$ when:
(i) $\mathrm{PQ}$ is parallel to the $y$-axis,
(ii) $\mathrm{PQ}$ is parallel to the $x$-axis.
The given points are $\mathrm{P}\left(x_{1}, y_{1}\right)$ and $\mathrm{Q}\left(x_{2}, y_{2}\right)$.
(i) When PQ is parallel to the y-axis, x1 = x2.
In this case, distance between $\mathrm{P}$ and $\mathrm{Q}=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}}$
$=\sqrt{\left(y_{2}-y_{1}\right)^{2}}$
$=\left|y_{2}-y_{1}\right|$
(ii) When PQ is parallel to the x-axis, y1 = y2.
In this case, distance between $\mathrm{P}$ and $\mathrm{Q}=\sqrt{\left(x_{2}-x_{1}\right)^{2}+\left(y_{2}-y_{1}\right)^{2}}$
$=\sqrt{\left(x_{2}-x_{1}\right)^{2}}$
$=\left|x_{2}-x_{1}\right|$