This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



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);

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

     float
     atan2f(float y, float 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(+-_, -_) returns +-pi.

     atan2(+-_, +_) returns +-0.

     atan2(+-_, x) returns +-pi for x < 0.

     atan2(+-_, x) returns +-0 for x > 0.

     atan2(y, +-_) returns +pi/2 for y > 0.

     atan2(y, +-_) 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                                           December 11, 2006                                          BSD

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...