atan2

Computes the principal value of the arc tangent of y/x , using the signs of both arguments to determine the quadrant of the return value

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Mathematical Computation

Syntax

  #include <math.h>  
   
  double atan2  (  
     double   y,   
     double   x);
  

Parameters

x and y
(IN) Specifies the arguments whose arc tangent is to be computed.

Return Values

The atan2 function returns the arc tangent of y/x, in the range (-pi,pi). When the arguments are outside the permissible range, errno is set and matherr is called.

Remarks

A domain error occurs if both arguments are zero.

See Also

acos, asin, atan, matherr

Example

  #include <math.h>  
  #include <stdio.h>  
   
  main ()  
  {  
     printf ("%f\n", atan2 (.5, 1.) );  
  }
  

produces the following:

  0.463648