Calculation of Distance and Height