Distance and Height Calculation