c语言中sin函数和cos函数的用法?

如题所述

C语言里sin函数和cos函数是C标准数学函数库中的函数,调用需要引入math.h头文件。

一、sin() 函数描述:

C 库函数 double sin(double x) 返回弧度角 x 的正弦。sin() 函数的声明:double sin(double x)。

参数:x -- 浮点值,代表了一个以弧度表示的角度。

返回值:该函数返回 x 的正弦。

二、cos() 函数描述:

cos() 函数的功能是求某个角的余弦值。cos() 函数的声明:double cos(double x)。

参数:x -- 浮点值,代表了一个以弧度表示的角度。

返回值:该函数返回 x 的余弦。

扩展资料:

相关的三角函数:

double asin (double); 结果介于[-PI/2,PI/2]

double acos (double); 结果介于[0,PI]

double atan (double); 反正切(主值),结果介于[-PI/2,PI/2]

double atan2 (double,double); 反正切(整圆值),结果介于[-PI,PI]

参考资料来源:百度百科-math.h

温馨提示:答案为网友推荐,仅供参考
相似回答