correct calculateAngleFromCosAndSin function