# Convert bearing range

• March 8th 2012, 09:49 AM
SterlingM
Convert bearing range
Hi, I have a radian measure in the range of (-pi, pi]. But I need it to be in [0,2pi). I have tried doing this -

NewValue = (((OldValue - OldMin) * (NewMax - NewMin)) / (OldMax - OldMin)) + NewMin

But it did not work for me. I'm guessing that is because I'm working with radians. How can I convert these values to the range of [0,2pi)? Any help is appreciated, thanks.
• March 8th 2012, 10:40 AM
Plato
Re: Convert bearing range
Quote:

Originally Posted by SterlingM
Hi, I have a radian measure in the range of (-pi, pi]. But I need it to be in [0,2pi).

If $0\le\theta\le\pi$ then $\theta\mapsto\theta$.

If $=-\pi<\theta<0$ then $\theta\mapsto\theta+2\pi$.