computeDistance function

Compute distance between two points