Namespaces
Variants
Views
Actions

std::atan2

From cppreference.com
< cpp‎ | numeric‎ | math
Revision as of 14:22, 17 January 2012 by Cubbi (Talk | contribs)

Template:cpp/numeric/math/sidebar Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <cmath>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
float       atan2( float y, float x );
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
double      atan2( double y, double x );
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
long double atan2( long double y, long double x );
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">

<td >
double      atan2( Integral y, Arithmetic x );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> <tr class="t-dcl ">

<td >
double      atan2( Arithmetic y, Integral x );
</td>

<td class="t-dcl-nopad"> </td> <td > (since C++11) </td> </tr> Template:ddcl list end

Computes the inverse tangent of y/x using the signs of arguments to correctly determine quadrant.

Contents

Parameters

x, y - floating point value

Return value

arc tangent of y/x in radians in the range of [-π; π] radians.

Example

Template:example cpp


See also

Template:cpp/numeric/math/dcl list atanTemplate:cpp/numeric/math/dcl list asinTemplate:cpp/numeric/math/dcl list acosTemplate:cpp/numeric/math/dcl list tan