NAME
atan2 — arc
tangent function
SYNOPSIS
#include <math.h> double atan2(double y, double x);
DESCRIPTION
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 atan2(). If errno is non-zero on return, or the return value is NaN, an error has occurred.
RETURN VALUE
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 x or y 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].
ERRORS
The atan2() function may fail if:
- [EDOM]
- Both arguments are 0.0 or one or more of the arguments is NaN.
- [ERANGE]
- The result underflows.
No other errors will occur.
EXAMPLES
None.
APPLICATION USAGE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
DERIVATION
Derived from Issue 1 of the SVID.