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
92
S
32
G
109
Posts: 5,290
Reputation: 70,991

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 ImageImage
B
169
S
50
G
173
Posts: 8,317
Reputation: 110,278

Post » Sun May 08, 2011 7:42 pm

Thank you!

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

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests