A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.com/reference/cmath/atan/ below:

function

<cmath> <ctgmath>

atan
     double atan  (double x);      float atanf (float x);long double atanl (long double x);
     double atan (double x);      float atan (float x);long double atan (long double x);
     double atan (double x);      float atan (float x);long double atan (long double x);     double atan (T x);           // additional overloads for integral types

Compute arc tangent

Returns the principal value of the arc tangent of x, expressed in radians.

In trigonometrics, arc tangent is the inverse operation of tangent.

Notice that because of the sign ambiguity, the function cannot determine with certainty in which quadrant the angle falls only by its tangent value. See atan2 for an alternative that takes a fractional argument instead.

Header

<tgmath.h>

provides a type-generic macro version of this function.



Parameters
x
Value whose arc tangent is computed.

Return Value Principal arc tangent of x, in the interval [-pi/2,+pi/2] radians.
One radian is equivalent to 180/PI degrees.

Example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* atan example */
#include <stdio.h>      /* printf */
#include <math.h>       /* atan */

#define PI 3.14159265

int main ()
{
  double param, result;
  param = 1.0;
  result = atan (param) * 180 / PI;
  printf ("The arc tangent of %f is %f degrees\n", param, result );
  return 0;
}

Output:
The arc tangent of 1.000000 is 45.000000 degrees.


See also
atan2
Compute arc tangent with two parameters (function)
tan
Compute tangent (function)
sin
Compute sine (function)
cos
Compute cosine (function)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4