Consider the triangle formed from U, V, and the vector W from the head of U to the head of V. We'll calculate the dot product by applying the Law of Cosines to the triangle formed from vectors U, V, and W.Law of Cosines: |W|

^{2}= |U|^{2}+ |V|^{2}-2|U|*|V| cos t, where t is angle aOb. In our case, since U and V are unit vectors, this is simply |W|^{2}= 1 + 1 - 2 cos t.What is this vector W? |W|

^{2}= |V-U|^{2}= (V-U)(V-U) = VV - 2 UV + UU = 1 -2UV + 1. Since U + W = V, W = V - U.So, combining this expression for |W|

^{2}with the one obtained from the Law of Cosines, we have 1 + 1 - 2 cos aOb = 1 -2 UV +1, hence, for unit vectors, UV = cos t, t the angle between them.