Skip to main content
atan2 is y,x http://msdn.microsoft.com/en-us/library/system.math.atan2.aspx
Source Link
Tetrad
  • 30.1k
  • 12
  • 96
  • 143

If you're having trouble calculating the angle, you can use this:

Vector2 target = mousePos - startPos;
float angle = Math.Atan2( target.XY, target.YX );

If you're having trouble calculating the angle, you can use this:

Vector2 target = mousePos - startPos;
float angle = Math.Atan2( target.X, target.Y );

If you're having trouble calculating the angle, you can use this:

Vector2 target = mousePos - startPos;
float angle = Math.Atan2( target.Y, target.X );

If you're having trouble calculating the angle, you can use this:

Vector2 target = mousePos - startPos;
float angle = Math.Atan2( target.yX, target.xY );
  

If you're having trouble calculating the angle, you can use this:

Vector2 target = mousePos - startPos;
float angle = Math.Atan2( target.y, target.x );
 

If you're having trouble calculating the angle, you can use this:

Vector2 target = mousePos - startPos;
float angle = Math.Atan2( target.X, target.Y );
 

If you're having trouble calculating the angle, you can use this:

Vector2 target = mousePos - startPos;
float angle = Math.atan2Atan2( target.y, target.x );
  

If you're having trouble calculating the angle, you can use this:

Vector2 target = mousePos - startPos;
float angle = Math.atan2( target.y, target.x );
 

If you're having trouble calculating the angle, you can use this:

Vector2 target = mousePos - startPos;
float angle = Math.Atan2( target.y, target.x );
 
Source Link
Ray Dey
  • 7k
  • 3
  • 40
  • 45
Loading