# Break down angle to 360 degrees

• May 7th 2010, 06:27 PM
mrwelcam
Break down angle to 360 degrees
Hi, i have an angle that can range from - 10000 to 10000 and could like to know what angle its on in a 0 - 360 spectrum.

Eg. 1145 would equal 65
-20 would equal 340

Cheers
• May 7th 2010, 09:37 PM
Fohr
Quote:

Originally Posted by mrwelcam
Hi, i have an angle that can range from - 10000 to 10000 and could like to know what angle its on in a 0 - 360 spectrum.

Eg. 1145 would equal 65
-20 would equal 340

Cheers

Just subtract 360 from the original angle until it is between 0 and 360. For example:

1145 - 360 = 785
785 - 360 = 425
425 - 360 = 65

*Edit* or add if it is negative. For example

-20 + 360 = 340
• May 7th 2010, 09:46 PM
MobiusJoe
It's really late, but the basic formula is going to be something like

for x > 360, take the remainder of x/360.

400, for example. 400/360 is 1 (throw that away) with a remainder of 40, or think of it as 40 degrees past one full circle.

For x < 0 ....
take x + (360+360*INT(x/360))
meaning -20 gives
-20 + 360 + 0, or 340.

-400 gives us
-400 + 360 + (360*1) or 720 - 400 = 320.

Double check that, but it looks close.