C语言:三角函数的参数为弧度,通常的角度值需要转化为弧度

#include <stdio.h>
#include <math.h> 
//三角函数的参数为弧度,是角度必须转化为弧度
//3.14=180,1度=3.14/180,转化方法:(3.14/180)*角度值 
main()
{
    float a,b,c;
    c=30;
    printf("%f",sin(c));
    b=30*3.14/180;
    printf("\n%f",sin(b));
    getchar();
 }

 

 

posted @ 2022-10-06 16:19  myrj  阅读(429)  评论(0编辑  收藏  举报