methode getDistance and tests passed