A mathematical function for calculating the distance between two points.