Skip to content

Instantly share code, notes, and snippets.

@crash2burn
Created July 27, 2011 21:53
Show Gist options
  • Save crash2burn/1110462 to your computer and use it in GitHub Desktop.
Save crash2burn/1110462 to your computer and use it in GitHub Desktop.
Shortest angl
def awesome(x,y)
x = x*(Math::PI/180)
y = y*(Math::PI/180)
(Math.atan2(Math.sin(x - y), Math.cos(x - y))/(Math::PI/180)).abs
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment