atan()

Returns the inverse tangent of the argument in radians.

Syntax

atan(n)

Example 1

Use atan() to return the inverse tangent of 0.0:

#include <iostream>
#include <cmath>
int main() {
double x = 0.0;
double result;
result = std::atan(x);
std::cout << result << " radians" << "\n";
// Output: 1.5708 radians
}

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn C++ on Codecademy

Contributors