Reducing all degrees down to "out of 360"

bitcloud

New member
Joined
Jun 5, 2017
Messages
1
Hi, I have a rotation that can go from 0 degrees all the way to any number - eg 720.
If it's higher than 360, eg if it's 365, I want the number to be from 0.

So a few examples:

12 = 12
90 = 90
340 = 340
360 = 0
365 = 5
400 = 40

etc etc. Is there a simple mathematical way of reducing a number back to some fraction of 360?

Thanks in advance!
Lachlan
 
Same Thing as Denis suggested

Division

405 / 360 = 1.125

Discard Integer Portion and multiply.

0.125 *360 = 45

Careful on negative values.
 
Top