Calculating Distance and Height