Calculate sign of rotation angle properly