Angle measurement and height calculation