How can vector dot products be used to prove the law of cosines?