sin函数c语言程序 c语言中sin函数怎么应用( 二 )


的正玄值,然后将结果返回 。返回-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;
}
参考资料:CSDN博客频道-C语言中sin和cos的用法
关于sin函数c语言程序和c语言中sin函数怎么应用的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

推荐阅读