The formula
A unit vector has magnitude 1. To find the unit vector pointing the same way as any vector a, divide by its own magnitude:
a^=∣a∣aWorked example
Find the unit vector in the direction of a=i^+j^+2k^.
Solution: ∣a∣=12+12+22=6, so:
a^=61(i^+j^+2k^)Worked example: between two points
Find the unit vector in the direction of PQ where P(1,2,3) and Q(4,5,6).
Solution: PQ is found by subtracting coordinates: (4−1,5−2,6−3)=(3,3,3)=3i^+3j^+3k^. Its magnitude is 27=33, so:
PQ^=333(i^+j^+k^)=31(i^+j^+k^)Worked example: scaling to a target magnitude
Find a vector in the direction of a=i^−2j^ with magnitude 7.
Solution: First find the unit vector, then scale it up to magnitude 7. ∣a∣=1+4=5:
7a^=7⋅5i^−2j^=57i^−514j^