C语言中的三角函数计算需要将角度转弧度,,比如以下代码是计算sin()的值:
#include"stdio.h"
#include"math.h"
main()
{
int i;
float t;
printf("请输入要计算的角度:");
scanf("%d",i);
printf("sin(%d)=%f",i,t);
}
调用math.h中的三角函数,需要将角度值变换为弧度值,代码如下:
#includestdio.h
#includemath.h
int main()
float st,a;
scanf("%f",st);
printf("sin(st)=%f\n", sin(a));
printf("cos(st)=%f\n", cos(a));
return 0;
以上就是土嘎嘎小编为大家整理的c语言三角函数中的表述相关主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!