头文件:math.h
计算:
sin32=sin(x*180/Pi)
其他类似

因为要输入弧度才可以计算,直接sin(30)是不行的。

sin(x)
cos(x)
tan(x)

arcsin(x)
arccos(x)
arctan(x)
arccot(x)

以上四个则是相应的反三角函数,函数值的单位也是弧度。若要求arctan(1)的度数,要用以下的形式:
arctan(1)*180/3.1415926

例子

#include<stdio.h>
#include<math.h>
int main() 
{ 
const double Pi=3.14; //定义pi的值
double a; 
a=sin(45*180/Pi); //角度转化为弧度
printf("%f",a); //printf的正确格式
}

相关文章:

  • 2022-12-23
  • 2022-01-07
  • 2021-12-26
  • 2021-09-07
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-13
  • 2021-11-17
  • 2021-12-26
  • 2021-11-10
  • 2022-12-23
  • 2021-11-28
  • 2021-08-26
相关资源
相似解决方案