some functions to get angles from coordinates