{"action":"closed","issue":{"url":"https://api.github.com/repos/teamdelta2016/TeamDelta/issues/21","repository_url":"https://api.github.com/repos/teamdelta2016/TeamDelta","labels_url":"https://api.github.com/repos/teamdelta2016/TeamDelta/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/teamdelta2016/TeamDelta/issues/21/comments","events_url":"https://api.github.com/repos/teamdelta2016/TeamDelta/issues/21/events","html_url":"https://github.com/teamdelta2016/TeamDelta/issues/21","id":136666238,"number":21,"title":"Bug in getClosestRoadDirection","user":{"login":"Dgleish","id":9089875,"avatar_url":"https://avatars.githubusercontent.com/u/9089875?v=3","gravatar_id":"","url":"https://api.github.com/users/Dgleish","html_url":"https://github.com/Dgleish","followers_url":"https://api.github.com/users/Dgleish/followers","following_url":"https://api.github.com/users/Dgleish/following{/other_user}","gists_url":"https://api.github.com/users/Dgleish/gists{/gist_id}","starred_url":"https://api.github.com/users/Dgleish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dgleish/subscriptions","organizations_url":"https://api.github.com/users/Dgleish/orgs","repos_url":"https://api.github.com/users/Dgleish/repos","events_url":"https://api.github.com/users/Dgleish/events{/privacy}","received_events_url":"https://api.github.com/users/Dgleish/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"Basha133","id":8684794,"avatar_url":"https://avatars.githubusercontent.com/u/8684794?v=3","gravatar_id":"","url":"https://api.github.com/users/Basha133","html_url":"https://github.com/Basha133","followers_url":"https://api.github.com/users/Basha133/followers","following_url":"https://api.github.com/users/Basha133/following{/other_user}","gists_url":"https://api.github.com/users/Basha133/gists{/gist_id}","starred_url":"https://api.github.com/users/Basha133/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Basha133/subscriptions","organizations_url":"https://api.github.com/users/Basha133/orgs","repos_url":"https://api.github.com/users/Basha133/repos","events_url":"https://api.github.com/users/Basha133/events{/privacy}","received_events_url":"https://api.github.com/users/Basha133/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-02-26T11:09:58Z","updated_at":"2016-02-26T15:25:56Z","closed_at":"2016-02-26T15:25:56Z","body":"```java\r\npublic Direction getClosestRoadDirection() {\r\n        double min_diff = 360;\r\n        Direction closest = new Direction(0);\r\n        for (Direction dir : m_road_angles) {\r\n            double diff = Math.min(Math.abs(m_primary_direction.getDegrees() - dir.getDegrees()),\r\n   !!!!!!!                 Math.abs(Math.abs(m_primary_direction.getDegrees() - dir.getDegrees() - 360)));\r\n            if (diff < min_diff) {\r\n                min_diff = diff;\r\n                closest = dir;\r\n            }\r\n        }\r\n        return closest;\r\n    }\r\n```\r\n\r\nOn the line denoted !!!!!!, I don't understand the use of two `Math.abs()` calls. Also, as subtraction is left-associative, this gives `(m_primary_direction.getDegrees() - dir.getDegrees)-360` whereas I would have thought `m_primary_direction.getDegrees() - (dir.getDegrees-360)` is the right order.\r\n\r\nThis could very well be me just not understanding however."}}