# Finding the Distance Between Two Points Using Vectors

The distance between two points $P=\phantom{\rule{-0.17em}{0ex}}\left({x}_{1},{y}_{1}\right)$ and $Q=\phantom{\rule{-0.17em}{0ex}}\left({x}_{2},{y}_{2}\right)$ is the length of the vector $\stackrel{\to }{PQ}$. This formula finds the distance between the two points (the length of the vector) for you:

Formula

### TheDistanceBetweenTwoPoints

 $\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{PQ}|=\sqrt{\phantom{\rule{-0.17em}{0ex}}{\left({x}_{2}-{x}_{1}\right)}^{2}+\phantom{\rule{-0.17em}{0ex}}{\left({y}_{2}-{y}_{1}\right)}^{2}}$

Example 1

Find the distance between $A=\phantom{\rule{-0.17em}{0ex}}\left(8,12\right)$ and $B=\phantom{\rule{-0.17em}{0ex}}\left(16,18\right)$.

$\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{AB}|& =\sqrt{\phantom{\rule{-0.17em}{0ex}}{\left(16-8\right)}^{2}+\phantom{\rule{-0.17em}{0ex}}{\left(18-12\right)}^{2}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\sqrt{{8}^{2}+{6}^{2}}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\sqrt{64+36}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =\sqrt{100}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =10\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Example 2

Decide $s$ such that $\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{AB}|=4$, when $A=\phantom{\rule{-0.17em}{0ex}}\left(s,1\right)$ and $B=\phantom{\rule{-0.17em}{0ex}}\left(2,5\right)$

Here, you can insert the numbers right into the formula and solve for $s$: $\begin{array}{llll}\hfill \phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{AB}|=\sqrt{\phantom{\rule{-0.17em}{0ex}}{\left(2-s\right)}^{2}+\phantom{\rule{-0.17em}{0ex}}{\left(5-1\right)}^{2}}& =4\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill \sqrt{\phantom{\rule{-0.17em}{0ex}}{\left(2-s\right)}^{2}+\phantom{\rule{-0.17em}{0ex}}{\left(4\right)}^{2}}& =4\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill \phantom{\rule{-0.17em}{0ex}}{\left(2-s\right)}^{2}+16& =16\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 4-4s+{s}^{2}& =0\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Solving the equation ${s}^{2}-4s+4=0$:

 $s=\frac{4±\sqrt{16-4\cdot 1\cdot 4}}{2}=\frac{4}{2}=2.$

The left-hand side is

 $\sqrt{\phantom{\rule{-0.17em}{0ex}}{\left(2-2\right)}^{2}+\phantom{\rule{-0.17em}{0ex}}{\left(5-1\right)}^{2}}=\sqrt{16}=4,$

and the right-hand side is 4. As the left-hand and right-hand side are equal, $s=2$ makes the length $\phantom{\rule{-0.17em}{0ex}}|\stackrel{\to }{AB}|$ equal to 4.