calculate angle bugfix