Hi folks.
I'm struggling to understand an odd problem I've encountered with Atan2.
I have two vectors and I need to measure the difference of angle.
For testing I have the two vectors 50,0 and 0,50. These when plotted on paper would show a very obvious angle of 90 degrees.
However, when I put these through Atan2 - Angle = Math.Atan2(b.Y - a.Y, b.X - a.X) - I get a result of 65 degrees.
I know my vectors are good, absolutely, they're double checked. So what is going wrong here, am I misunderstanding the use of Atan2?
Thanks folks.
(If this is in the wrong forum please feel free to move it somewhere else.)
I'm struggling to understand an odd problem I've encountered with Atan2.
I have two vectors and I need to measure the difference of angle.
For testing I have the two vectors 50,0 and 0,50. These when plotted on paper would show a very obvious angle of 90 degrees.
However, when I put these through Atan2 - Angle = Math.Atan2(b.Y - a.Y, b.X - a.X) - I get a result of 65 degrees.
I know my vectors are good, absolutely, they're double checked. So what is going wrong here, am I misunderstanding the use of Atan2?
Thanks folks.
(If this is in the wrong forum please feel free to move it somewhere else.)