C examples for math.h:tan
function
<cmath> <ctgmath> <math.h>
Returns the tangent of an angle of x radians.
long double tanl (long double x); long double tan (long double x); double tan (double x); float tanf (float x); float tan (float x); double tan (T x);
Parameter | Description |
---|---|
x | Value representing an angle, expressed in radians. |
Tangent of x radians.
#include <stdio.h> #include <math.h> #define PI 3.14159265//from w ww.j a va2s. c om int main () { double param = 45.0; double result = tan ( param * PI / 180.0 ); printf ("The tangent of %f degrees is %f.\n", param, result ); return 0; }