atan2d(3M)
NAME
atan2d(), atan2df() − degree-valued arctangent-and-quadrant functions
SYNOPSIS
#include <math.h>
double atan2d(double y, double x);
float atan2df(float y, float x);
DESCRIPTION
atan2d() is a degree-valued version of the atan2() function. It returns the arctangent of y/x, in the range −180 to 180, using the signs of both arguments to determine the quadrant of the return value.
atan2df() is a float version of atan2d(); it takes float arguments and returns a float result. To use this function, compile either with the −Ae option or with the −Aa and −D_HPUX_SOURCE options. Otherwise, the compiler promotes the float arguments to double, and the function returns incorrect results.
atan2d() and atan2df() are not specified by any standard, but atan2df() is named in accordance with the conventions specified in the "Future Library Directions" section of the ANSI C standard.
To use these functions, link in the math library by specifying −lm on the compiler or linker command line.
RETURN VALUE
If y and x are +INFINITY, atan2d() returns 45.
If y is +INFINITY and x is −INFINITY, atan2d() returns 135.
If y is −INFINITY and x is +INFINITY, atan2d() returns −45.
If y and x are −INFINITY, atan2d() returns −135.
If y is zero and x is a positive number, atan2d() returns zero.
If y is zero and x is a negative number, atan2d() returns 180.
If y is −zero and x is a negative number, atan2d() returns −180.
If y is a positive number and x is zero, atan2d() returns 90.
If y is a negative number and x is zero, atan2d() returns −90.
If y/x would overflow, atan2d() returns ±90. The result will be 90 if y is a positive number and −90 if y is a negative number.
If y/x after rounding would be smaller in magnitude than MINDOUBLE, atan2d() returns ±180 or zero. The result will be zero if x is a positive number, 180 if x is a negative number and y is a positive number, and −180 if x and y are both negative numbers.
If both x and y are zero, atan2d() returns NaN.
If x or y is NaN, atan2d() returns NaN.
If the correct value after rounding would be smaller in magnitude than MINDOUBLE, atan2d() returns zero.
ERRORS
No errors are defined.
SEE ALSO
atan2(3M), sind(3M), cosd(3M), tand(3M), asind(3M), acosd(3M), atand(3M), isinf(3M), isnan(3M), values(5).
Hewlett-Packard Company — HP-UX Release 10.20: July 1996