General Help with Atan2

Hi, is there anyone who can explain to me in detail how to use Atan2? I have spent the last 3 days trying to figure out how it works but I could not find any tutorial on it

Much appreicate any input


probably

1 Like

It’s the measure of the angle counter-clockwise of a vector <x,y> off <1,0>

It’s used similarly to ‘atan(y/x)’ the only problem is that ‘atan(y/x)’ will give you the measure of the shortest angle in either direction. Where as atan2 measures in the same direction every time. This is useful if you need <0,1>'s angle (90 degrees) to be distinct from <0,-1> (270 degrees).

1 Like

thx to both of you, you both helped me finaly fully understand some complicated vectors i was stuck on, mainly coz of Atan2…

Just a small fix the digram angle is calculating [y,x] not [x,y]… took me for ever to figure that out lol

Coordinates are generally given as (x,y) and (x,y,z) etc
The documentation for Atan2, linked in post states the function takes Atan2(float y, float x);
Always read the docs carefully

1 Like

Ahh yes!