HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)

a
atan2d(3M) 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.
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, compile either with the default
-Ae option or with the -Aa and
-D_HPUX_SOURCE options. Make sure your program includes <
math.h>. 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 greater than zero,
atan2d() returns zero.
If y is zero and x is less than zero, atan2d() returns 180.
If y is zero and x is less than zero, atan2d() returns 180.
If y is greater than zero and x is zero,
atan2d() returns 90.
If y is less than zero and x is zero, atan2d() returns 90.
If y/x would overflow, atan2d() returns ±90. The result will be 90 if y is greater than zero and 90 if y is
less than zero.
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 greater than zero, 180 if x is less than zero and y is greater than zero, and
180 if x and y are both less than zero.
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
acosd(3M), asind(3M), atan2(3M), atand(3M), cosd(3M), sind(3M), tand(3M), math(5), values(5).
Section 328 Hewlett-Packard Company 1 HP-UX 11i Version 1: September 2005