CORDIC algorithm for angle calculations