Home C&C++函数库 c++ 语法 程序源码 Linux C库

tan

函数  <cmath> <ctgmath>

C90 double tan (double x);
C99 double tan (double x);
float tanf (float x);
long double tanl (long double x);
C++98 double tan (double x);
float tan (float x);
long double tan (long double x);
C++11 double tan (double x);
float tan (float x);
long double tan (long double x);
double tan (T x);        // additional overloads for integral types

计算正切
返回x弧度角度的正切值。
C99 头文件<tgmath.h> 提供了该函数的类型泛型宏版本。
C++98 这个函数在<complex>和<valarray> 中重载(参见complex tan和valarray tan)。
C++11 这个头文件(<cmath>) 为整型提供了额外的重载:这些重载在计算之前将x转换为double (在T是任何整型时定义)。
这个函数在<complex>和<valarray> 中也重载(参见complex tan和valarray tan)。

☲  参数


x
表示角度的值,用弧度表示。
一弧度(radian)等于180/PI degrees。

☉  返回值



x的tan 弧度。

☣  示例



/* 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;
}

输出:
The tangent of 45.000000 degrees is 1.000000.

🍄  另请参阅



sin 正弦(function )
cos 余弦(function )
atan 反正切(function )


联系我们 免责声明 关于CandCplus 网站地图