Distance and midpoint calculator - with detailed explanation