TASK-21: Fix angle calculations