roybiv
1
I have a float variable defined as

`float var = -Mathf.Atan(y/x);`

which gives the expected value of -18 degrees (after converting from rad). However, when I change this line to

`float var = 360-Mathf.Atan(y/x);`

the value of var becomes ~20,000. Why is this happening?

Thanks

which gives the expected value of -18 degrees (after converting from rad)

Degrees/Radians is the issue. I think you want `(2*Math.PI)-Mathf.Atan(y/x);`

roybiv
3
Thanks for answering, but I found out what the problem was: me. I was converting to radians **after** adding 90. Oops. Thanks anyway