atan2


Arc tangent (y / x)

[Classification]

Mathematical library

[Syntax]

#include <math.h>

double __far atan2(double y, double x);

[Return value]

Returns the arc tangent (arctangent) of y / x. The returned value is in radian and in a range of [-π, π].

When either x or y is Not-a-Number, x and y are both 0, or x and y are both ±∞, this function returns Not-a-Number and sets macro EDOM to global variable errno.

If the solution is a denormal number or has disappeared and became 0, atan2 sets macro ERANGE to global variable errno.

[Description]

This function calculates the arc tangent of y / x. At this time, the quadrant of the return value is determined based on the sign of both arguments.