How to calculate an angle?