atan()
Anonymous contributor
Published Jun 18, 2021Updated May 15, 2024
Contribute to Docs
The atan()
function returns the inverse tangent of an argument in radians.
Syntax
atan(n)
The n
parameter can be any real number (positive, negative, or zero).
- If
n
is zero, the result will be zero with the same sign. - If
n
is positive or negative infinity, the result will be 1.5708 radians with the same sign.
Example
The following example uses the atan()
function that returns the inverse tangent of value 0.0
:
#include <iostream>#include <cmath>int main() {double x = 0.0;double result;result = std::atan(x);std::cout << result << " radians" << "\n";}
This produces the following output:
0.0 radians
Codebyte Example
The following example returns the inverse tangent of the value
with the atan()
function:
All contributors
- Anonymous contributor
- THE-Spellchecker
- Christine_Yang
- codewithdev
- garanews
- christian.dinh
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.