method that calculates distance between two location points