cc [ flag ... ] file ... -lm [ library ... ] #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.
Upon successful completion, atan2() returns the arc tangent of y/x in the range [-pi,pi] radians. If both arguments are 0.0, 0.0 is returned and errno may be set to EDOM.
If x or y is NaN, NaN is returned.
In IEEE 754 mode atan2() handles the following exceptional arguments in the spirit of ANSI/IEEE Std 754-1985.
For exceptional cases, matherr(3M) tabulates the values to be returned as dictated by Standards other than XPG4.
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.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|