Finding the distance and displacement