Created
February 12, 2013 21:52
-
-
Save dbrockman/4773781 to your computer and use it in GitHub Desktop.
Convert degrees <-> radians C macros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Converts degrees to radians. | |
#define degreesToRadians(angleDegrees) (angleDegrees * M_PI / 180.0) | |
// Converts radians to degrees. | |
#define radiansToDegrees(angleRadians) (angleRadians * 180.0 / M_PI) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Will be problem if use like that:
degreesToRadians(10+5)
Suppose change to (with additional brackets):