RawDistance function based on Cosine Angular similarit