It is not that difficult to those of us who know math. Obvious analogy
to the function below exists in 'perl'. 

double vectorAngle( double x, double y ) 
{
  double r2 = x*x+y*y;
  if( r2 == 0 ) return -10; // error case

  int quadrant = x > 0 ? (y >= 0 : 0 : 3) : (y > 0 ? 1 : 2);

  return pi/2 * quadrant + asin( abs(y)/sqrt( r2 ) );
} 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to