ATAN2(3) | Library Functions Manual | ATAN2(3)

# NAME

`atan2`, `atan2f`, `atan2l` — arc tangent functions of two variables

# SYNOPSIS

Math Library (libm, -lm)
`#include <math.h>`

double
`atan2`(double y, double x);

float
`atan2f`(float y, float x);

long double
`atan2l`(long double y, long double x);

# DESCRIPTION

The `atan2`() function computes the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value. The `atan2f`() function is a single precision version of `atan2`(). The `atan2l`() function is an extended precision version of `atan2`().

# RETURN VALUES

The `atan2`(), `atan2f`() and `atan2l`() functions, if successful, return the arc tangent of y/x in the range [-pi, +pi] radians. If both x and y are zero, the global variable errno is set to `EDOM`.

# SEE ALSO

acos(3), asin(3), atan(3), cos(3), cosh(3), sin(3), sinh(3), tan(3), tanh(3)

# STANDARDS

The `atan2`() function conforms to ANSI X3.159-1989 (“ANSI C89”).

June 7, 2025 | Debian