HP C/iX Library Reference Manual (30026-90004)

Chapter 5 109
HP C/iX Library Function Descriptions
atan2
atan2
Returns the arc tangent of the input Cartisian coordinates
x
and
y
.
Syntax
#include math.h>
double atan2 (double
y
, double
x
)
Parameters
y
A real number indicating the Cartisian coordinate y.
x
A real number indicating the Cartisian coordinate x.
Return Values
n The arc tangent of (
x
,
y
).
0 Indicates both arguments are zero and errno is set to EDOM. A DOMAIN
error is also printed on the standard error output device.
Description
The atan2 function returns the arc tangent of
y/x
, in the range of pi to pi. It uses the
signs of both arguments to determine the quadrant of the return value.
Error handling can be changed by a user-written matherr function.
See Also
matherr(), ANSI C 4.5.2.4, POSIX.1 8.1