Adding angle calculation functions.