Calculating Heights and Distances