tan
double tan ( double x ); | math.h |
cplusplus.com |
Calculate tangent.
Performs the trigonometric tangent operation on x.
Parameters.
Return Value.
Tangent of x.
Portability.
Defined in ANSI-C.
ANSI-C++ adds float and double overloaded versions of this function,
with the same bahavior but being both, parameter and result, of one of these types.
Example.
/* tan example */
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
main ()
{
double param, result;
param = 60;
result = tan (param*PI/180);
printf ("Tangent of %lf degrees is %lf\n", param, result );
return 0;
}
Output:
Tangent of 60.000000 degrees is 1.732051
See also.
acos,
asin,
atan,
cos,
sin