calculate_distance function

Function calculating the distance between two vectors.