Convert Number to Angle?

For questions about using Classic.

Post » Sun May 08, 2011 7:30 pm

n-360*floor(n/360) will do the same thing as "%" but preserve floating point numbers.

If you want only a positive angle as a answer:
n-360*floor(n/360) +360*(n<0)
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Sun May 08, 2011 7:40 pm

Oh wow, was using windows calc, but I see now that Construct wont accept floats with %.

[quote="R0J0hound":3fu98zmd]n-360*floor(n/360) will do the same thing as "%" but preserve floating point numbers.

If you want only a positive angle as a answer:
n-360*floor(n/360) +360*(n<0)[/quote:3fu98zmd]

heh figured Rojo, or one of the other brains would figure it out.
Guess you could also use int() there too.
450.33-360*int(450.33/360)
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sun May 08, 2011 7:42 pm

Thank you!

That does it.
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests