ATAN2(3) Linux Programmer's Manual ATAN2(3)NAME
atan2 - arc tangent function of two variables
SYNOPSIS
#include <math.h>
double atan2(double y, double x);
DESCRIPTION
The atan2() function calculates the arc tangent of the two variables x and y. It is similar to calculating the arc tangent of y / x,
except that the signs of both arguments are used to determine the quadrant of the result.
RETURN VALUE
The atan2() function returns the result in radians, which is between -PI and PI (inclusive).
CONFORMING TO
SVID 3, POSIX, BSD 4.3, ISO 9899
SEE ALSO acos(3), asin(3), atan(3), cos(3), sin(3), tan(3)
1993-06-08 ATAN2(3)
Check Out this Related Man Page
ATAN2(3) BSD Library Functions Manual ATAN2(3)NAME
atan2 -- arc tangent function of two variables
SYNOPSIS
#include <math.h>
double
atan2(double y, 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.
SPECIAL VALUES
atan2(+-0, -0) returns +-pi.
atan2(+-0, +0) returns +-0.
atan2(+-0, x) returns +-pi for x < 0.
atan2(+-0, x) returns +-0 for x > 0.
atan2(y, +-0) returns -pi/2 for y > 0.
atan2(+-y, -infinity) returns +-pi for finite y > 0.
atan2(+-y, +infinity) returns +-0 for finite y > 0.
atan2(+-infinity, +x) returns +-pi/2 for finite x.
atan2(+-infinity, -infinity) returns +-3*pi/4.
atan2(+-infinity, +infinity) returns +-pi/4.
NOTES
The atan2() function is used mostly to convert from rectangular (x,y) to polar (r,theta) coordinates that must satisfy x = r*cos theta and y
= r*sin theta. In general, conversions to polar coordinates should be computed thus:
r := hypot(x,y); ... := sqrt(x*x+y*y)
theta := atan2(y,x).
SEE ALSO acos(3), asin(3), atan(3), cos(3), cosh(3), sin(3), sinh(3), tan(3), tanh(3), math(3),
STANDARDS
The atan2() function conforms to ISO/IEC 9899:1999(E).
BSD November 18, 2002 BSD