# Unit Vector Between Two Points

Suppose you are interested in finding the unit vector between two points, $P$ and $Q$, which are described in cartesian coordinates as $(2,-1,3)$ and $(-1,1,0)$, respectively.

You would begin by finding the vector between these two points. The direction of this vector may be important so look for key words such as $from'' P$ $to$ $Q$. Once we have established the direction we’re going in, $P$ to $Q$ in this case, we subtract the beginning point from the end point. $Q - P$. This will give us the vector we are looking for. The next step would be to convert this vector into a unit vector, by dividing it by it’s magnitude.

These are the two formulas we are looking at:
$\vec {PQ} = < (Q_x - P_x) , (Q_y - P_y) , (Q_z - P_z) >$
$\vec U_{PQ} = \frac{\vec {PQ}}{|\vec {PQ}|}$

Note:
Here I use $\vec {PQ}$ as my vector from $P$ to $Q$ and $\vec U_{PQ}$ denotes the unit vector from $P$ to $Q$.

Implementing these formulas:
$\vec {PQ} = < (-1 - 2) , (1 - -1) , (0 - 3) > = < -3, 2, -3 >$
$\vec U_{PQ} = \frac{< -3, 2, -3 >}{|< -3, 2, -3 >|} = \frac{< -3, 2, -3 >}{\sqrt {(-3)^2 + 2^2 + (-3)^2}} = < \frac{-3}{\sqrt 22},\frac{2}{\sqrt 22},\frac{-3}{\sqrt 22}>$

Hmm.. The End