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

sin

函数  <cmath> <ctgmath>

C90 double sin(double x);
C99 double sin (double x);
float sinf (float x);
long double sinl (long double x);
C++98 double sin (double x);
float sin (float x);
long double sin (long double x);
C++11 double sin (double x);
float sin (float x);
long double sin (long double x);
double sin (T x);    // additional overloads for integral types

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

☲  参数


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

☉  返回值



x的Sine弧度。

☣  示例



/* sin example */
#include <stdio.h>      /* printf */
#include <math.h>       /* sin */

#define PI 3.14159265

int main ()
{
  double param, result;
  param = 30.0;
  result = sin (param*PI/180);
  printf ("The sine of %f degrees is %f.\n", param, result );
  return 0;
}

输出:
The sine of 30.000000 degrees is 0.500000.

🍄  另请参阅



cos 余弦(function )
tan 正切(function )


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