BugInTheSYS

Untitled

Jan 27th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static void Circle2DGI( float x, float y, out float distance, out float angle ) {
  2.   distance = ( float )Math.Sqrt( x * x + y * y );
  3.   y *= 1.0f / distance;
  4.   if( x >= 0 ) {
  5.     angle = ( float )Math.Acos( y ) * 180.0f / ( float )Math.PI;
  6.   } else {
  7.     angle = 180.0f + ( float )Math.Acos( -y ) * 180.0f / ( float )Math.PI;
  8.   }
  9. }
Advertisement
Add Comment
Please, Sign In to add comment