A RetroSearch Logo

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

Search Query:

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

function

<cmath> <ctgmath>

tan
     double tan  (double x);      float tanf (float x);long double tanl (long double x);
     double tan (double x);      float tan (float x);long double tan (long double x);
     double tan (double x);      float tan (float x);long double tan (long double x);     double tan (T x);           // additional overloads for integral types

Compute tangent

Returns the tangent of an angle of x radians.

Header

<tgmath.h>

provides a type-generic macro version of this function.



Parameters
x
Value representing an angle, expressed in radians.
One radian is equivalent to 180/PI degrees.

Return Value Tangent of x radians.

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

#define PI 3.14159265

int main ()
{
  double param, result;
  param = 45.0;
  result = tan ( param * PI / 180.0 );
  printf ("The tangent of %f degrees is %f.\n", param, result );
  return 0;
}

Output:
The tangent of 45.000000 degrees is 1.000000.


See also
sin
Compute sine (function)
cos
Compute cosine (function)
atan
Compute arc tangent (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