Hi! I need help understanding how the CosineSimilarity is calculated.

For example: I created knn-index with parameters ‘knn’: True, ‘knn.space_type’: ‘cosinesimil’, ‘type’: ‘knn_vector’, ‘dimension’: 3 (as in example how to use knn). Then i added two vectors: [1, 2, 3] and [3, 4, 6]

Now I’m trying to compare [1, 2, 3] with vector [3, 4, 5]:

open-distro result: 0.22400923,

manually cosine = (1*3+2*4+3*5)/(sqrt(14)*sqrt(50)) = 0.9827076298239908

compare [3, 4, 6] with vector [3, 4, 5]:

open-distro result: 0.5,

manually cosine = (3*3+4*4+6*5)/(sqrt(61)*sqrt(50)) = 0.9958932064677039

how calculation works in open-distro? Maybe you can help me, please.

P.S. Sorry for my English