c语言sin()的功能是什么?

如题所述

第1个回答  2022-10-25

C语言sin()用来计算参数x 的正玄值,然后将结果返回。返回-1 至1 之间的计算结果。

例子:

#include <math.h>

main(){

double answer = sin(0.5);

printf("sin(0.5) = %f\n", answer);

}

执行

sin(0.5) = 0.479426

C语言sin():

sin()原型:double sin(double x)

sin()角度与弧度:

π=180°

1°=π/180

1(rad)=180/π

角度转弧度:用角度乘以π/180

弧度转角度:用弧度乘以180/π,或者用rtod()函数

扩展资料:

与sin相似的acos函数

函数名: acos

功 能:计算并返回arccos(x)值、要求-1<=X<=1

函数与形参类型:

double acos(x)

double x;

程序例:

#include <stdio.h>

#include <math.h> int main(void)

{

double result;

double x = 0.5; result = acos(x);

printf("The arc cosine of %lf is %lf\n", x, result);

return 0;

}

参考资料:

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网