atan2() and atan2f()

Syntax
  #include <math.h>

  
  double atan2(double y, double x);

  
  float  atan2f(float y, float x);

  
Description

atan2() computes the principal value of the arc tangent of y/x. It uses the sign of both operands to determine the quadrant of the result.

Return

The arc tangent tan^(-1)(y/x), in the range from -Pi to Pi radian, if not both x and y are 0. If both x and y are 0, it returns 0.

See also

acos() and acosf(),

asin() and asinf(),

atan() and atanf(),

cos() and cosf(),

sin() and sinf(), and

tan() and tanf()