Skip to content

Instantly share code, notes, and snippets.

@bragboy
Created August 8, 2015 20:24
Show Gist options
  • Save bragboy/58b68500f0a7730f384f to your computer and use it in GitHub Desktop.
Save bragboy/58b68500f0a7730f384f to your computer and use it in GitHub Desktop.
double angle(int h, int m)
{
double hangle = 0.5D * (h*60 + m);
double mangle = 6*m;
angle = abs(hangle – mangle);
angle = min(angle, 360-angle);
return angle;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment