std::atan2
From cppreference.com
Template:cpp/numeric/math/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td>Defined in header
</td>
<cmath>
<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