Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
rotation
//g++ 4.9.3 #include <iostream> #include <math.h> static const float deg2rad = M_PI / 180.0; static const float rad2deg = 180.0 / M_PI; float NormalizeAngle(float angle){ double intpart; float outAngle = modf(angle/(2*M_PI), &intpart)*2*M_PI; if (outAngle < 0) outAngle += 2*M_PI; return outAngle; } int main() { float B = 0; float Y = 10*deg2rad; float U = NormalizeAngle(B-Y); if (U > M_PI) U -= 2*M_PI; std::cout << U*rad2deg; }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
rstring
pow implementation
a simple tuple implementation
TempSpecial
Hello world.c
cppPyGuessTheNum2
python
cast
Hangman
CyclicExpression Checker
Please log in to post a comment.