ATAN2(3) Library Functions Manual ATAN2(3)

atan2arc tangent function

#include <math.h>

double atan2(double y, double x);

The atan2() function 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.

An application wishing to check for error situations should set errno to 0 before calling . If errno is non-zero on return, or the return value is NaN, an error has occurred.

Upon successful completion, atan2() returns the arc tangent of y/x in the range [-, ] radians. If both arguments are 0.0, an implementation-dependent value is returned and errno may be set to [EDOM].

If or is NaN, NaN is returned and errno may be set to [EDOM].

If the result underflows, 0.0 is returned and errno may be set to [ERANGE].

The atan2() function may fail if:

Both arguments are 0.0 or one or more of the arguments is NaN.
The result underflows.

No other errors will occur.

None.

None.

None.

atan(3) , isnan(3) , tan(3) , <math.h> .

Derived from Issue 1 of the SVID.

February 1997 posix.fail