# What is the formula to convert an angle measure in degrees to one between 0 and 360 degrees?

I know that I can find an equivalent angular measure to $460^\circ$ that's at least $0^\circ$ and less than $360^\circ$ by repeatedly subtracting $360^\circ$ till it's smaller than $360^\circ$, which comes out to be $100^\circ$.

But is there a general formula to do this? Or is there a formula for this "subtract till smaller than $360^\circ$" in math?

I have tried using modulo but that doesn't make sense … in fact I didn't know what I was doing at the end.

I think I used to know, but now I don't.

• n mod 360 where n is your angle Commented Sep 16, 2013 at 17:05
• If $\theta$ is your angle, use $\theta-360 \lfloor \frac{\theta}{360} \rfloor$. Commented Sep 16, 2013 at 17:08
• Divide by 360, and take the remainder.
– MJD
Commented Sep 16, 2013 at 17:08
• MJD wont further steps be needed Commented Sep 16, 2013 at 17:26
• @MuhammadUmer copper.hat's equation is precisely what you wrote. Those funny square brackets is the floor function.
– EuYu
Commented Sep 16, 2013 at 17:32

• or abs(n mod 360) Commented Sep 27, 2016 at 1:05
• abs(n mod 360) gives you 1 for -1. If you need to get 359 instead, use the @aau's solution ((n mod 360) + 360) mod 360 Commented Oct 31, 2021 at 19:45
$$n$$ mod $$360$$ where $$n$$ is your angle.
In most programming languages, mod is the % operator.