Fixed angle diff calculations

http://stackoverflow.com/a/7571008