The dot product of two vectors is defined as
u·v = |u||v|cos(θ)
and the dot product also happens to be the sum of products of corresponding components:
u·v =
So we have all that is needed to solve for θ:
|u| == =
|v| == =
and
= =
Putting it all together:
=
=
cos(θ) =
θ ==