S
seia0106
Hello,
I have a C++ program , which has following two lines of code
z=atan2(x,y);
z=(float)(fmod(2*pi+z, 2*pi);
The comments written by the other programmer says that second line is
used to extend the range of variable z from '-pi to pi' to '-2pi to
2pi'.
I dont fully understand why function fmod() is used here. Can someone
please explain its use in second line?
thanks in advance.
I have a C++ program , which has following two lines of code
z=atan2(x,y);
z=(float)(fmod(2*pi+z, 2*pi);
The comments written by the other programmer says that second line is
used to extend the range of variable z from '-pi to pi' to '-2pi to
2pi'.
I dont fully understand why function fmod() is used here. Can someone
please explain its use in second line?
thanks in advance.