Fixed angle diff calculations

http://stackoverflow.com/a/7571008
Merge pull request #1 from dannywils/master

Update build