calculate distance between two points using coordinates