measures a cosine similarity between two vectors