mass function

Computes the Distance between the 'data' and the 'query'.