Computing the geodesic.