atan2 [C++ Reference]
Keywords: c,math,atan2
Date: 2009-03-19T23:43:10-0700

[[atan2]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## atan2

Syntax:

        #include <cmath>
        double atan2( double y, double x );

The atan2() function computes the arc tangent of y/x, using the signs of the arguments to compute the quadrant of the return value. The returned values are in the range [-pi, pi]. Note the order of the arguments passed to this function.

C++ also provides the following overloaded forms:

        #include <cmath>
        float atan2( float y, float x ); // same as atan2f() in C99
        long double atan2( long double y, long double x ); // same as atan2l() in C99

Related Topics: acos, asin, atan, cos, cosh, sin, sinh, tan, tanh

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •