To compute the value, the function uses the sign of both arguments to determine the quadrant.
In C++, this function is overloaded in <valarray> (see valarray atan2).
Parameters
- y
- Floating point value representing an y-coordinate.
- x
- Floating point value representing an x-coordinate.
If both arguments passed are zero, a domain error occurs, which sets the global variable ERRNO to the EDOM value.
Return Value
Principal arc tangent of y/x, in the interval [-pi,+pi] radians.Portability
In C, only the double version of this function exists with this name.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Output:
The arc tangent for (x=-10.000000, y=10.000000) is 135.000000 degrees. |
See also
| atan | Compute arc tangent (function) |
| tan | Compute tangent (function) |
| sin | Compute sine (function) |
| cos | Compute cosine (function) |
