atan2(), atan2f()

arc tangent function of two variables 

Function


SYNOPSIS

#include <math.h>

double atan2(double y, double x)

float atan2f(float y, float x)


DESCRIPTION

The atan2() and atan2f() functions compute the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value.

To check for error situations, set errno to 0 before calling atan2(). If errno is non-zero on return, or the return value is NaN, an error has occurred.

The atan2f() function is a single-precision version of atan2().


PARAMETERS

y 

Is the numerator.

x 

Is the denominator.


RETURN VALUES

The atan2() function returns the arc tangent of y/x, in the range [-pi, +pi] radians.

If both y and x are 0.0, the result is undefined. If in POSIX mode, errno is set to EDOM.

If the value of y or x is NaN, NaN is returned. If the result underflows, 0.0 is returned.


CONFORMANCE

atan2(): ANSI/ISO 9899-1990

atan2f(): PTC MKS Toolkit UNIX APIs extension


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

At high levels of compiler optimizations, the hardware handles the atan2() function intrinsically. In such cases, mathematical exceptions do not cause the matherr() function to be called or the errno value to be set.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
acos(), asin(), atan(), cos(), cosh(), math(), sin(), sinh(), tan(), tanh()


PTC MKS Toolkit 10.5 Documentation Build 40.