distance and midpoint formula examples