Dot product does give you cosine
planspace.org