Skip to content

Instantly share code, notes, and snippets.

@dbrockman
Created February 12, 2013 21:52
Show Gist options
  • Save dbrockman/4773781 to your computer and use it in GitHub Desktop.
Save dbrockman/4773781 to your computer and use it in GitHub Desktop.
Convert degrees <-> radians C macros
// Converts degrees to radians.
#define degreesToRadians(angleDegrees) (angleDegrees * M_PI / 180.0)
// Converts radians to degrees.
#define radiansToDegrees(angleRadians) (angleRadians * 180.0 / M_PI)
Copy link

ghost commented Nov 21, 2018

Elegant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment